-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Erase regions in New Abstract Consts #98499
Conversation
Some changes occured in const_evaluatable.rs cc @lcnr |
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.
can you add an assert here
rust/compiler/rustc_trait_selection/src/traits/const_evaluatable.rs
Lines 413 to 421 in 64eb9ab
for n in self.nodes.iter() { | |
if let Node::Leaf(ct) = n { | |
if let ty::ConstKind::Unevaluated(ct) = ct.kind() { | |
// `AbstractConst`s should not contain any promoteds as they require references which | |
// are not allowed. | |
assert_eq!(ct.promoted, None); | |
} | |
} | |
} |
that all regions from inside the abstract const are also erased, so something like assert_eq!(ct, self.tcx.erase_regions(ct));
then r=me
b74209a
to
1e40200
Compare
Some changes occurred in const_evaluatable.rs cc @lcnr |
@bors r+ rollup |
📌 Commit 1e40200 has been approved by |
Erase regions in New Abstract Consts When an abstract const is constructed, we previously included lifetimes in the set of substitutes, so it was not able to unify two abstract consts if their lifetimes did not match but the values did, despite the values not depending on the lifetimes. This caused code that should have compiled to not compile. Fixes rust-lang#98452 r? `@lcnr`
Erase regions in New Abstract Consts When an abstract const is constructed, we previously included lifetimes in the set of substitutes, so it was not able to unify two abstract consts if their lifetimes did not match but the values did, despite the values not depending on the lifetimes. This caused code that should have compiled to not compile. Fixes rust-lang#98452 r? ``@lcnr``
Rollup of 7 pull requests Successful merges: - rust-lang#98415 (Migrate some `rustc_borrowck` diagnostics to `SessionDiagnostic`) - rust-lang#98479 (Add `fetch_not` method on `AtomicBool`) - rust-lang#98499 (Erase regions in New Abstract Consts) - rust-lang#98516 (library: fix uefi va_list type definition) - rust-lang#98554 (Fix box with custom allocator in miri) - rust-lang#98607 (Clean up arg mismatch diagnostic, generalize tuple wrap suggestion) - rust-lang#98625 (emit Retag for compound types with reference fields) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
When an abstract const is constructed, we previously included lifetimes in the set of substitutes, so it was not able to unify two abstract consts if their lifetimes did not match but the values did, despite the values not depending on the lifetimes. This caused code that should have compiled to not compile.
Fixes #98452
r? @lcnr