-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify local_def_id
and as_local_hir_id
#71215
Simplify local_def_id
and as_local_hir_id
#71215
Conversation
local_def_id
and as_local_hir_id
r? @eddyb |
pub fn as_local_hir_id(&self, def_id: LocalDefId) -> hir::HirId { | ||
self.local_def_id_to_hir_id(def_id) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
src/librustc_infer/infer/error_reporting/nice_region_error/find_anon_type.rs
Outdated
Show resolved
Hide resolved
src/librustc_infer/infer/error_reporting/nice_region_error/outlives_closure.rs
Outdated
Show resolved
Hide resolved
77734a9
to
2988d3d
Compare
2988d3d
to
da9c867
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit da9c867 with merge 4b8b1c55d91c00df6ad5b5b174c4dbfae7bab373... |
☀️ Try build successful - checks-azure |
Queued 4b8b1c55d91c00df6ad5b5b174c4dbfae7bab373 with parent 7f3df57, future comparison URL. |
Finished benchmarking try commit 4b8b1c55d91c00df6ad5b5b174c4dbfae7bab373, comparison URL. |
@bors r+ |
📌 Commit da9c867 has been approved by |
4bc4665
to
b9ba521
Compare
@ecstatic-morse @Dylan-DPC @eddyb rebased over master and fix the new librustdoc error |
@bors r=eddyb |
📌 Commit b9ba521 has been approved by |
⌛ Testing commit b9ba521 with merge 94317f50b93fe0774aa16e4f696ee62b7202f4bb... |
@bors retry (Yielding to rollup) |
☀️ Test successful - checks-azure |
Aaaaaaah finally! Thank you so much @ecstatic-morse @eddyb and @Dylan-DPC ! This change might break some tools because hir method |
rustup rust-lang/rust#71215 There's currently an crash in `ui/new_without_default.rs` that I need to figure out how to avoid. changelog: none
rustup rust-lang/rust#71215 There's currently an crash in `ui/new_without_default.rs` that I need to figure out how to avoid. changelog: none
rustup rust-lang/rust#71215 There's currently an crash in `ui/new_without_default.rs` that I need to figure out how to avoid. changelog: none
Changes: ```` rustup to rust-lang#70043 map_clone: avoid suggesting `copied()` for &mut fix redundant_pattern_matching lint Add tests for rust-lang#1654 Don't trigger while_let_on_iterator when the iterator is recreated every iteration Update issue_2356.stderr reference file Update while_let_on_iterator tests Fix while_let_on_iterator suggestion and make it MachineApplicable Add lifetime test case for `new_ret_no_self` rustup rust-lang#71215 Downgrade match_bool to pedantic Run fetch before testing if master contains beta The beta branch update should not require a force push Add a note to the beta sections of release.md Remove apt-get upgrade again Always use the deploy script and templates of the master branch README: fix lit count line clippy_dev: make it fatal when the regex for updating lint count does not match `predecessors_for` will be removed soon Rustup "Remove `BodyAndCache`" Only run (late) internal lints, when they are warn/deny/forbid Only run cargo lints, when they are warn/deny/forbid span_lint_and_note now takes an Option<Span> for the note_span instead of just a span Make lint also capture blocks and closures, adjust language to mention other mutex types don't test the code in the lint docs Switch to matching against full paths instead of just the last element of the path Lint for holding locks across await points Also mention `--fix` for nightly users fix crash on issue-69020-assoc-const-arith-overflow.rs Address review comments remark fixes Update CHANGELOG.md for Rust 1.43 and 1.44 update stderr file util/fetch_prs_between.sh: Add Markdown formatted Link factor ifs into function, add differing mutex test Update the changelog update documentation Apply suggestions from PR review update span_lint_and_help call to six args test for mutex eq, add another test case use if chain cargo dev fmt fix map import to rustc_middle dev update_lints fix internal clippy warnings change visitor name to OppVisitor use Visitor api to find Mutex::lock calls add note about update-all-refs script, revert redundant pat to master move closures to seperate fns, remove known problems use span_lint_and_help, cargo dev fmt creating suggestion progress work on suggestion for auto fix Implement unsafe_derive_deserialize lint Update empty_enum.stderr Formatting and naming Formatting and naming Cleanup: `node_id` -> `hir_id` Fix issue rust-lang#2907. Don't trigger toplevel_ref_arg for `for` loops Cleanup: future_not_send: use `return_ty` method Remove badge FIXME from Cargo.toml Change note_span argument for span_lint_and_note. Add an Option<Span> argument to span_lint_and_help. Fixes internal lint warning in code base. Implement collapsible_span_lint_calls lint. ```` Fixes rust-lang#71453
…=eddyb Convert more queries to use `LocalDefId` This PR is based on commits in rust-lang#71215 and should partially solve rust-lang#70853
…ddyb Convert more queries to use `LocalDefId` This PR is based on commits in rust-lang#71215 and should partially solve rust-lang#70853
Changes: ```` rustup to rust-lang/rust#70043 map_clone: avoid suggesting `copied()` for &mut fix redundant_pattern_matching lint Add tests for rust-lang#1654 Don't trigger while_let_on_iterator when the iterator is recreated every iteration Update issue_2356.stderr reference file Update while_let_on_iterator tests Fix while_let_on_iterator suggestion and make it MachineApplicable Add lifetime test case for `new_ret_no_self` rustup rust-lang/rust#71215 Downgrade match_bool to pedantic Run fetch before testing if master contains beta The beta branch update should not require a force push Add a note to the beta sections of release.md Remove apt-get upgrade again Always use the deploy script and templates of the master branch README: fix lit count line clippy_dev: make it fatal when the regex for updating lint count does not match `predecessors_for` will be removed soon Rustup "Remove `BodyAndCache`" Only run (late) internal lints, when they are warn/deny/forbid Only run cargo lints, when they are warn/deny/forbid span_lint_and_note now takes an Option<Span> for the note_span instead of just a span Make lint also capture blocks and closures, adjust language to mention other mutex types don't test the code in the lint docs Switch to matching against full paths instead of just the last element of the path Lint for holding locks across await points Also mention `--fix` for nightly users fix crash on issue-69020-assoc-const-arith-overflow.rs Address review comments remark fixes Update CHANGELOG.md for Rust 1.43 and 1.44 update stderr file util/fetch_prs_between.sh: Add Markdown formatted Link factor ifs into function, add differing mutex test Update the changelog update documentation Apply suggestions from PR review update span_lint_and_help call to six args test for mutex eq, add another test case use if chain cargo dev fmt fix map import to rustc_middle dev update_lints fix internal clippy warnings change visitor name to OppVisitor use Visitor api to find Mutex::lock calls add note about update-all-refs script, revert redundant pat to master move closures to seperate fns, remove known problems use span_lint_and_help, cargo dev fmt creating suggestion progress work on suggestion for auto fix Implement unsafe_derive_deserialize lint Update empty_enum.stderr Formatting and naming Formatting and naming Cleanup: `node_id` -> `hir_id` Fix issue rust-lang#2907. Don't trigger toplevel_ref_arg for `for` loops Cleanup: future_not_send: use `return_ty` method Remove badge FIXME from Cargo.toml Change note_span argument for span_lint_and_note. Add an Option<Span> argument to span_lint_and_help. Fixes internal lint warning in code base. Implement collapsible_span_lint_calls lint. ```` Fixes #71453
See #70853