-
Notifications
You must be signed in to change notification settings - Fork 13.4k
builtin dyn impl no guide inference #141352
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
base: master
Are you sure you want to change the base?
Conversation
@bors try |
builtin dyn impl no guide inference cc rust-lang#141347 we can already slightly restrict this behavior in the old solver, so why not do so. Needs crater and an FCP. r? `@compiler-errors`
☀️ Try build successful - checks-actions |
@craterbot check |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🎉 Experiment
|
That |
This PR disables the incomplete inference guidance if there's both a user-written and builtin trait object implementation in the old solver: trait Equals<T: ?Sized> {}
impl<T: ?Sized> Equals<T> for T {}
fn impls_equals<T: Equals<U> + ?Sized, U: ?Sized>() {}
fn main() {
// Two candidates:
// - via user impl, constrains `U` to `dyn Equals<u32>`
// - via builtin impl, constrains `U` to `u32`
//
// We previously constrained it to `dyn Equals<u32>`, with this change
// its ambiguous.
impls_equals::<dyn Equals<u32>, _>();
} This behavior should be unsound in coherence with the old solver, luckily we no longer use that. I don't think this guidance is desirable and explicitly do not do so in the new solver. Crater found a single regression: https://crates.io/crates/px-wsdom-javascript/0.0.5. We should open a PR fixing the regression before landing this change. @rfcbot fcp merge |
Team member @lcnr has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
cc #141347
we can already slightly restrict this behavior in the old solver, so why not do so. Needs crater and an FCP.
r? @compiler-errors