-
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
ICE: called Result::unwrap()
on an Err
value: NoSolution
#128621
Comments
bisects to #120248 🤔 cc @WaffleLapkin |
Minimized: trait Trait {
type Associated;
}
impl Trait for i32 {
type Associated = i64;
}
trait Generic<T> {}
type TraitObject = dyn Generic<<i32 as Trait>::Associated>;
struct Wrap(TraitObject);
fn cast(x: *mut TraitObject) {
x as *mut Wrap;
} This compiles on stable. ICEs on beta. Error output on beta
@rustbot label +regression-from-stable-to-beta Of note, the opposite pointer cast fails to compile on stable, beta, and nightly. This seems wrong to me. The opposite casttrait Trait {
type Associated;
}
impl Trait for i32 {
type Associated = i64;
}
trait Generic<T> {}
type TraitObject = dyn Generic<<i32 as Trait>::Associated>;
struct Wrap(TraitObject);
fn cast(x: *mut Wrap) {
x as *mut TraitObject;
} Error:
|
Just for context (unsure if relevant here) I see in that PR a question for T-lang about a breaking change at this comment and in the following FCP that was approved |
So while the breaking change was approved, I believe this code should compile (and definitely not ICE). The issue seems to be that borrowck can't prove a bound (after typeck did). Seeing for you need a projection to trigger the issue ( |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-high |
Rollup merge of rust-lang#128694 - compiler-errors:norm, r=WaffleLapkin Normalize when equating `dyn` tails in MIR borrowck See the explanation in the comment. Fixes rust-lang#128621 cc `@WaffleLapkin`
auto-reduced (treereduce-rust):
original code
original:
Version information
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc
Program output
@rustbot label +F-ptr_metadata
The text was updated successfully, but these errors were encountered: