Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

marmeladema
Copy link
Contributor

@marmeladema marmeladema commented Apr 16, 2020

See #70853

@marmeladema marmeladema changed the title Issue70853/librustc middle local def id 2 Simplify local_def_id and as_local_hir_id Apr 16, 2020
@marmeladema
Copy link
Contributor Author

r? @eddyb

@rust-highfive rust-highfive assigned eddyb and unassigned varkor Apr 16, 2020
@marmeladema marmeladema marked this pull request as ready for review April 16, 2020 20:23
Comment on lines +345 to +346
pub fn as_local_hir_id(&self, def_id: LocalDefId) -> hir::HirId {
self.local_def_id_to_hir_id(def_id)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is hilarious now. Not sure we should in this PR but at some point maybe we can change everything to def_id_to_hir_id? def_id_to is just 1 longer than as_local but clearer IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. Would local_def_id_to_hir_id be even clearer?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure tbh. It's a bit long but it might be worth it.

@JohnTitor JohnTitor added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 16, 2020
@marmeladema marmeladema force-pushed the issue70853/librustc_middle-local-def-id-2 branch from 77734a9 to 2988d3d Compare April 16, 2020 22:45
@marmeladema marmeladema force-pushed the issue70853/librustc_middle-local-def-id-2 branch from 2988d3d to da9c867 Compare April 16, 2020 22:59
@eddyb
Copy link
Member

eddyb commented Apr 16, 2020

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@bors
Copy link
Collaborator

bors commented Apr 16, 2020

⌛ Trying commit da9c867 with merge 4b8b1c55d91c00df6ad5b5b174c4dbfae7bab373...

@bors
Copy link
Collaborator

bors commented Apr 17, 2020

☀️ Try build successful - checks-azure
Build commit: 4b8b1c55d91c00df6ad5b5b174c4dbfae7bab373 (4b8b1c55d91c00df6ad5b5b174c4dbfae7bab373)

@rust-timer
Copy link
Collaborator

Queued 4b8b1c55d91c00df6ad5b5b174c4dbfae7bab373 with parent 7f3df57, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit 4b8b1c55d91c00df6ad5b5b174c4dbfae7bab373, comparison URL.

@eddyb
Copy link
Member

eddyb commented Apr 17, 2020

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 17, 2020

📌 Commit da9c867 has been approved by eddyb

@marmeladema marmeladema force-pushed the issue70853/librustc_middle-local-def-id-2 branch from 4bc4665 to b9ba521 Compare April 23, 2020 22:42
@marmeladema
Copy link
Contributor Author

@ecstatic-morse @Dylan-DPC @eddyb rebased over master and fix the new librustdoc error

@Dylan-DPC-zz
Copy link

@bors r=eddyb

@bors
Copy link
Collaborator

bors commented Apr 23, 2020

📌 Commit b9ba521 has been approved by eddyb

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 23, 2020
@bors
Copy link
Collaborator

bors commented Apr 24, 2020

⌛ Testing commit b9ba521 with merge 94317f50b93fe0774aa16e4f696ee62b7202f4bb...

@Dylan-DPC-zz
Copy link

@bors retry (Yielding to rollup)

@bors
Copy link
Collaborator

bors commented Apr 24, 2020

⌛ Testing commit b9ba521 with merge 5a59527...

@bors
Copy link
Collaborator

bors commented Apr 24, 2020

☀️ Test successful - checks-azure
Approved by: eddyb
Pushing 5a59527 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 24, 2020
@bors bors merged commit 5a59527 into rust-lang:master Apr 24, 2020
@marmeladema
Copy link
Contributor Author

Aaaaaaah finally! Thank you so much @ecstatic-morse @eddyb and @Dylan-DPC !

This change might break some tools because hir method as_local_def_id has changed signature. It does not return an Option anymore. Recommended practice is to call as_local() before on the DefId to get a LocalDefId is possible.
cc @RalfJung @matthiaskrgr

@marmeladema marmeladema deleted the issue70853/librustc_middle-local-def-id-2 branch April 24, 2020 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants