-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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: borrowck best_blame_constraint
unwrap on a None
value, OpaqueTypeKey { def_id...
/ None
in compiler/rustc_borrowck/src/region_infer/mod.rs
#133252
Comments
/cc @estebank since this seems to be diagnostics-related (?) |
Backtrace looks like #114640. ICE'd while borrow-checking around https://github.com/Turbo87/crates.io/blob/cf1ac7c853bc4cea21a8fd3fdb7e17260d1a242c/src/controllers/user/me.rs#L68. rust/compiler/rustc_borrowck/src/region_infer/mod.rs Lines 1958 to 1967 in f6e511e
It looks a bit like #114640 and #123157, but #123157 is feature-gated-dependent. @Turbo87 does it repro if you |
Option::unwrap()
on a None
valuebest_blame_constraint
unwrap on a None
value, OpaqueTypeKey { def_id...
yep, reproduces every time I run, also when running |
Thanks for the info. That is certainly curious. |
Reduced as far as I could: use std::future::Future;
trait Owned: 'static {}
fn ice() -> impl Future<Output = &'static dyn Owned> {
async {
let not_static = 0;
force_send(async_load(¬_static));
loop {}
}
}
fn force_send<T: Send>(_: T) {}
fn async_load<'a, T: LoadQuery<'a>>(this: T) -> impl Future {
async {
this.get_future().await;
}
}
trait LoadQuery<'a>: Sized {
type LoadFuture: Future;
fn get_future(self) -> Self::LoadFuture {
loop {}
}
}
impl<'a> LoadQuery<'a> for &'a u8 {
type LoadFuture = SimpleFuture;
}
struct SimpleFuture;
impl Future for SimpleFuture {
type Output = ();
fn poll(
self: std::pin::Pin<&mut Self>,
_: &mut std::task::Context<'_>,
) -> std::task::Poll<Self::Output> {
loop {}
}
} @rustbot label: -E-needs-mcve +S-has-mcve |
auto reduced some more based on ^ //@compile-flags: --edition=2024
trait Owned: 'static {}
fn ice() -> impl Future<Output = &'static dyn Owned> {
async {
let not_static = 0;
force_send(async_load(¬_static));
loop {}
}
}
fn force_send<T: Send>(_: T) {}
fn async_load<'a, T: LoadQuery<'a>>(this: T) -> impl Future {
async {
this.get_future().await;
}
}
trait LoadQuery<'a>: Sized {
type LoadFuture: Future;
fn get_future(self) -> Self::LoadFuture {
loop {}
}
}
impl<'a> LoadQuery<'a> for &'a u8 {
type LoadFuture = ();
} |
best_blame_constraint
unwrap on a None
value, OpaqueTypeKey { def_id...
best_blame_constraint
unwrap on a None
value, OpaqueTypeKey { def_id...
/ None
in compiler/rustc_borrowck/src/region_infer/mod.rs
Avoid ICE in borrowck Provide a fallback in `best_blame_constraint` when `find_constraint_paths_between_regions` doesn't have a result. This code is due a rework to avoid the letf-over `unwrap()`, but avoids the ICE caused by the repro. Fix rust-lang#133252.
Avoid ICE in borrowck Provide a fallback in `best_blame_constraint` when `find_constraint_paths_between_regions` doesn't have a result. This code is due a rework to avoid the letf-over `unwrap()`, but avoids the ICE caused by the repro. Fix rust-lang#133252.
Avoid ICE in borrowck Provide a fallback in `best_blame_constraint` when `find_constraint_paths_between_regions` doesn't have a result. This code is due a rework to avoid the letf-over `unwrap()`, but avoids the ICE caused by the repro. Fix rust-lang#133252.
Code
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: