-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Bubble up opaque <eq> opaque operations instead of picking an order #114586
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @lcnr (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
@bors try |
⌛ Trying commit d64fc80 with merge cde356bd79f103d9897ada6234862d1d3e511791... |
☀️ Try build successful - checks-actions |
@craterbot check |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
//! query, we attempt to actually check the defining anchor, but now we | ||
//! have a situation where the RPIT gets constrained outside its anchor. | ||
|
||
// check-pass |
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.
Given that this works in the new solver already:
// check-pass | |
// revisions: current next | |
//[next] compile-flags: -Ztrait-solver=next | |
// check-pass |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🎉 Experiment
|
All of the regressions are spurious (disk failures or panics in the metadata encoder, probably also due to disk failures). |
r=me unless @compiler-errors also wants to take another look |
d64fc80
to
930affa
Compare
@bors r=lcnr,compiler-errors |
☀️ Test successful - checks-actions |
Finished benchmarking commit (e2b3676): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 630.454s -> 633.716s (0.52%) |
don't globally ignore rustc-ice files Reverts a change that happened in rust-lang#114586 but is unrelated to that PR and wasn't discussed. ICE files appearing is somewhat of a nuisance, but I'd rather clean them up than have them accumulate in my source folder. `@oli-obk` if you want to ignore them you can add them to your local `.git/info/exclude`.
Rollup merge of rust-lang#115885 - RalfJung:dont-ignore-ice, r=oli-obk don't globally ignore rustc-ice files Reverts a change that happened in rust-lang#114586 but is unrelated to that PR and wasn't discussed. ICE files appearing is somewhat of a nuisance, but I'd rather clean them up than have them accumulate in my source folder. `@oli-obk` if you want to ignore them you can add them to your local `.git/info/exclude`.
This does not bubble up the Here is an example that regressed under the PR: #![feature(type_alias_impl_trait)]
type Opaque = impl Sized; //~ ERROR unconstrained opaque type
fn get_rpit() -> impl Sized {}
fn query(_: impl FnOnce() -> Opaque) {}
fn test(_: Opaque) {
query(get_rpit); // although it is constrained here
} |
…r-errors delay a bug when encountering an ambiguity in MIR typeck We shouldn't have any trait selection ambiguities in MIR typeck. See rust-lang#114586 (comment) r? `@oli-obk` `@compiler-errors` `@lcnr`
…ler-errors delay a bug when encountering an ambiguity in MIR typeck We shouldn't have any trait selection ambiguities in MIR typeck. See rust-lang#114586 (comment) r? `@oli-obk` `@compiler-errors` `@lcnr`
Rollup merge of rust-lang#116530 - aliemjay:ice-on-ambiguity, r=compiler-errors delay a bug when encountering an ambiguity in MIR typeck We shouldn't have any trait selection ambiguities in MIR typeck. See rust-lang#114586 (comment) r? `@oli-obk` `@compiler-errors` `@lcnr`
…li-obk revert rust-lang#114586 Reverts rust-lang#114586. cc rust-lang#116877 (not closing until this gets a beta backport) fixes rust-lang#116684 fixes rust-lang#114586 (comment) r? `@oli-obk` or `@lcnr`
Rollup of 5 pull requests Successful merges: - rust-lang#116812 (Disable missing_copy_implementations lint on non_exhaustive types) - rust-lang#116856 (Disable effects in libcore again) - rust-lang#116865 (Suggest constraining assoc types in more cases) - rust-lang#116870 (Don't compare host param by name) - rust-lang#116879 (revert rust-lang#114586) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#116879 - aliemjay:revert-opaque-bubble, r=oli-obk revert rust-lang#114586 Reverts rust-lang#114586. cc rust-lang#116877 (not closing until this gets a beta backport) fixes rust-lang#116684 fixes rust-lang#114586 (comment) r? `@oli-obk` or `@lcnr`
(cherry picked from commit a1e274f)
[beta] backports and stage0 bump - Bump stage0 to released stable compiler - Hide host effect params from docs rust-lang#116670 - Fix a performance regression in obligation deduplication. rust-lang#116826 - Make `#[repr(Rust)]` and `#[repr(C)]` incompatible with one another rust-lang#116829 - Update to LLVM 17.0.3 rust-lang#116840 - Disable effects in libcore again rust-lang#116856 - revert rust-lang#114586 rust-lang#116879 r? cuviper
(cherry picked from commit a1e274f)
In case we are in
Bubble
mode (meaning every opaque type that is defined in the current crate is treated as if it were in its defining scope), we don't try to register an opaque type as the hidden type of another opaque type, but instead bubble up an obligation to equate them at the query caller site. Usually that means we have aDefiningAnchor::Bind
and thus can reliably figure out whether an opaque type is in its defining scope. Where we can't, we'll error out, so the default is sound.With this change we start using
AliasTyEq
predicates in the old solver, too.fixes #108498
But also regresses
tests/ui/impl-trait/anon_scope_creep.rs
. Our use ofBubble
forcheck_opaque_type_well_formed
is going to keep biting us.r? @lcnr @compiler-errors