-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Fix ret > 1 bound if shadowed by const #93593
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
.filter(|r| self.trait_defines_associated_type_named(r.def_id(), assoc_name)); | ||
let mut const_candidates = all_candidates() | ||
.filter(|r| self.trait_defines_associated_const_named(r.def_id(), assoc_name)); | ||
|
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 the main fix, the rest should make it more carefully stick to logic prior associated-const equality change which introduced the ice.
Can you verify that the compiler doesn't ICE in situations like: trait Baz {
const Bar: usize;
const Qux: Self::Bar;
} |
I don't think it should ice in that case since there's no shadowing and no name overlaps, but will add a test in |
oh it does ice, I'll look into it a bit further |
I think the stack trace points to an trait Baz {
const Bar: usize;
const Qux: Self::Bar;
// ^ Expected type, found const
} |
yuh, i'm not sure if the best way to fix it is to turn the expect into an actual error, or handle it earlier, for now I can just turn it into an error and if the reviewer wants to do the other I'll update |
r? @oli-obk |
fbdfc36
to
1813d8e
Compare
Prior to a change, it would only look at types in bounds. When it started looking for consts, shadowing type variables with a const would cause an ICE, so now defer looking at consts only if there are no types present.
@bors r+ |
📌 Commit 2dfd77d has been approved by |
Fix ret > 1 bound if shadowed by const Prior to a change, it would only look at types in bounds. When it started looking for consts, shadowing type variables with a const would cause an ICE, so now defer looking at consts only if there are no types present. cc `@compiler-errors` Should Fix rust-lang#93553
Fix ret > 1 bound if shadowed by const Prior to a change, it would only look at types in bounds. When it started looking for consts, shadowing type variables with a const would cause an ICE, so now defer looking at consts only if there are no types present. cc ``@compiler-errors`` Should Fix rust-lang#93553
Fix ret > 1 bound if shadowed by const Prior to a change, it would only look at types in bounds. When it started looking for consts, shadowing type variables with a const would cause an ICE, so now defer looking at consts only if there are no types present. cc ```@compiler-errors``` Should Fix rust-lang#93553
Fix ret > 1 bound if shadowed by const Prior to a change, it would only look at types in bounds. When it started looking for consts, shadowing type variables with a const would cause an ICE, so now defer looking at consts only if there are no types present. cc ````@compiler-errors```` Should Fix rust-lang#93553
Fix ret > 1 bound if shadowed by const Prior to a change, it would only look at types in bounds. When it started looking for consts, shadowing type variables with a const would cause an ICE, so now defer looking at consts only if there are no types present. cc `````@compiler-errors````` Should Fix rust-lang#93553
…askrgr Rollup of 11 pull requests Successful merges: - rust-lang#92735 (Add crate filter parameter in URL) - rust-lang#93402 (Windows: Disable LLVM crash dialog boxes.) - rust-lang#93508 (Add rustdoc info to jsondocck output) - rust-lang#93551 (Add package.json in gitignore) - rust-lang#93555 (Link `try_exists` docs to `Path::exists`) - rust-lang#93585 (Missing tests for rust-lang#92630) - rust-lang#93593 (Fix ret > 1 bound if shadowed by const) - rust-lang#93630 (clippy::perf fixes) - rust-lang#93631 (rustc_mir_dataflow: use iter::once instead of Some().into_iter) - rust-lang#93632 (rustdoc: clippy::complexity fixes) - rust-lang#93638 (rustdoc: remove unused Hash impl) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Prior to a change, it would only look at types in bounds. When it started looking for consts,
shadowing type variables with a const would cause an ICE, so now defer looking at consts only if
there are no types present.
cc @compiler-errors
Should Fix #93553