Skip to content
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

Rename ty_def_id so people will stop using it by accident #134265

Merged
merged 1 commit into from
Dec 14, 2024

Conversation

compiler-errors
Copy link
Member

This function is just for cycle detection, but people keep using it because they think it's the right way of getting the def id from a Ty (and I can't blame them necessarily).

@rustbot
Copy link
Collaborator

rustbot commented Dec 13, 2024

r? @oli-obk

rustbot has assigned @oli-obk.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 13, 2024
@rustbot
Copy link
Collaborator

rustbot commented Dec 13, 2024

HIR ty lowering was modified

cc @fmease

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@@ -44,7 +44,6 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>, a
if name == "filter_map"
&& let hir::ExprKind::Call(expr, args) = body.value.kind
&& is_res_lang_ctor(cx, path_res(cx, expr), OptionSome)
&& arg_id.ty_def_id() == args[0].hir_id().ty_def_id()
Copy link
Member Author

Choose a reason for hiding this comment

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

HirId's Key impl just always returns None. So this was always None == None.

@oli-obk
Copy link
Contributor

oli-obk commented Dec 13, 2024

r=me with failures fixed

@rust-log-analyzer

This comment has been minimized.

@compiler-errors
Copy link
Member Author

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Dec 13, 2024

📌 Commit efb66e7 has been approved by oli-obk

It is now in the queue for this repository.

@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 Dec 13, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 13, 2024
Rename `ty_def_id` so people will stop using it by accident

This function is just for cycle detection, but people keep using it because they think it's the right way of getting the def id from a `Ty` (and I can't blame them necessarily).
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 14, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#134252 (Fix `Path::is_absolute` on Hermit)
 - rust-lang#134254 (Fix building `std` for Hermit after `c_char` change)
 - rust-lang#134255 (Update includes in `/library/core/src/error.rs`.)
 - rust-lang#134261 (Document the symbol Visibility enum)
 - rust-lang#134262 (Arbitrary self types v2: adjust diagnostic.)
 - rust-lang#134265 (Rename `ty_def_id` so people will stop using it by accident)
 - rust-lang#134271 (Arbitrary self types v2: better feature gate test)
 - rust-lang#134274 (Add check-pass test for `&raw`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit c55a97e into rust-lang:master Dec 14, 2024
6 checks passed
@rustbot rustbot added this to the 1.85.0 milestone Dec 14, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 14, 2024
Rollup merge of rust-lang#134265 - compiler-errors:ty_def_id, r=oli-obk

Rename `ty_def_id` so people will stop using it by accident

This function is just for cycle detection, but people keep using it because they think it's the right way of getting the def id from a `Ty` (and I can't blame them necessarily).
flip1995 pushed a commit to flip1995/rust that referenced this pull request Dec 15, 2024
Rename `ty_def_id` so people will stop using it by accident

This function is just for cycle detection, but people keep using it because they think it's the right way of getting the def id from a `Ty` (and I can't blame them necessarily).
flip1995 pushed a commit to flip1995/rust that referenced this pull request Dec 15, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#134252 (Fix `Path::is_absolute` on Hermit)
 - rust-lang#134254 (Fix building `std` for Hermit after `c_char` change)
 - rust-lang#134255 (Update includes in `/library/core/src/error.rs`.)
 - rust-lang#134261 (Document the symbol Visibility enum)
 - rust-lang#134262 (Arbitrary self types v2: adjust diagnostic.)
 - rust-lang#134265 (Rename `ty_def_id` so people will stop using it by accident)
 - rust-lang#134271 (Arbitrary self types v2: better feature gate test)
 - rust-lang#134274 (Add check-pass test for `&raw`)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants