-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
broken MIR in DefId(...) (NoSolution) #110534
Comments
Note that while there is a
|
@rustbot label regression-from-stable-to-stable |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-medium |
Wow that's a wild one... not sure whom to Cc here. @tmiasko @compiler-errors for some general MIR knowledge, and @lcnr since traits seem involved somehow. The error is a bit different on latest stable
|
Huh. I'm surprised that this doesn't cause a trait error in HIR typeck. It does if we use a type alias to avoid introducing a higher ranked fn ptr and actually ascribe the
|
Woo, this is due to a lot of fun things. Firstly, we defer the cast of After we apply the cast, we do end up with |
Also, I guess this also has nothing to do with method probing technically: // Borrowing the trait definitions from above above
fn foo<T>(_: Option<T>) where T: IntoSystem {}
fn main() {
let x = None::<fn(_)>;
foo(x);
let y: Option<fn(Ref<'static, u32>)> = x;
} ... which still ICEs during mir borrowck. |
we may want to leak check at the end of hir typeck. Feels like the easiest fix 😁 |
minimized: trait Trait {}
impl<T: for<'a> LeakErr<'a>> Trait for T {}
impl<U: for<'a> LeakErr<'a>> Trait for Option<U> {}
trait LeakErr<'a> {}
impl<T> LeakErr<'static> for T {}
fn impls_trait<T: Trait>(x: T) -> T {
x
}
fn main() {
let y = impls_trait(None);
let _: Option<u32> = y;
} What's happening here is the following:
In HIR typeck, we select In MIR typeck, we select |
Code
Playground.
Meta
Playground:
It wasn't an ICE in 1.62.
Error output
The text was updated successfully, but these errors were encountered: