-
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
Probe when assembling upcast candidates so they don't step on eachother's toes in new solver #114828
Probe when assembling upcast candidates so they don't step on eachother's toes in new solver #114828
Conversation
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
@@ -15,7 +18,7 @@ fn test_specific(x: &dyn Foo) { | |||
fn test_unknown_version(x: &dyn Foo) { | |||
let _ = x as &dyn Bar<_>; // Ambiguous | |||
//~^ ERROR non-primitive cast | |||
//~^^ ERROR the trait bound `&dyn Foo: Bar<_>` is not satisfied | |||
//[current]~^^ ERROR the trait bound `&dyn Foo: Bar<_>` is not satisfied |
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.
I actually have no idea where this error message is coming from. It also seems just wrong? This is the error message I'd expect to get if we had &x as &dyn Bar<_>
, not x as &dyn Bar<_>
...
edit: It was a bug in the error reporting code from a few years ago, code was using try_coerce
instead of can_coerce
: #114834
@bors r+ rollup |
…llaumeGomez Rollup of 10 pull requests Successful merges: - rust-lang#114711 (Infer `Lld::No` linker hint when the linker stem is a generic compiler driver) - rust-lang#114772 (Add `{Local}ModDefId` to more strongly type DefIds`) - rust-lang#114800 (std: add some missing repr(transparent)) - rust-lang#114820 (Add test for unknown_lints from another file.) - rust-lang#114825 (Upgrade std to gimli 0.28.0) - rust-lang#114827 (Only consider object candidates for object-safe dyn types in new solver) - rust-lang#114828 (Probe when assembling upcast candidates so they don't step on eachother's toes in new solver) - rust-lang#114829 (Separate `consider_unsize_to_dyn_candidate` from other unsize candidates) - rust-lang#114830 (Clean up some bad UI testing annotations) - rust-lang#114831 (Check projection args before substitution in new solver) r? `@ghost` `@rustbot` modify labels: rollup
Lack of a probe causes one candidate to disqualify the other due to inference side-effects.
r? lcnr