-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 Cannot relate bound region #25750
Comments
Forgot to add the backtrace:
|
Ok, I was able to produce a small example that causes it:
|
Reduced even further: pub type BoxedFn = Box<Fn(&Trait)>;
pub trait Trait {}
pub fn new() -> Option<(BoxedFn, BoxedFn)> {
None
}
|
And, once again: # Fails
fn fail() -> Option<(Box<Fn(&Sized)>, Box<Fn(&Sized)>)> {
None
}
# Works
fn work<'a>() -> Option<(Box<Fn(&'a Sized)>, Box<Fn(&'a Sized)>)> {
None
} |
FWIW, I ran into this also, but don't have time to whittle this down to a small repro. $ rustc --version main.rs:532:37: 532:41 error: internal compiler error: cannot relate bound region: ReScope(DestructionScope(3503)) <= ReLateBound(DebruijnIndex { depth: 1 }, BrAnon(0)) stack backtrace: |
Don't add a type to breadcrumbs vector when it is reference, pointer, or bare functions. Fixes rust-lang#25750
In particular, when we traverse a type like: `(for <'r> Fn(&'r u8), for <'r> Fn(&'r u8))` we should not add the first type `Fn(&'r u8)` to the bread-crumbs set, because that type ends up being structurally equivalent to the *second* `Fn(&'r u8)` type, even though they each should be considered distinct since they occur under distinct `for <'r>` binders. Fix rust-lang#25750.
In particular, when we traverse a type like: `(for <'r> Fn(&'r u8), for <'r> Fn(&'r u8))` we should not add the first type `Fn(&'r u8)` to the bread-crumbs set, because that type ends up being structurally equivalent to the *second* `Fn(&'r u8)` type, even though they each should be considered distinct since they occur under distinct `for <'r>` binders. Fix rust-lang#25750.
I hit an internal compiler error with this weeks build. It occurs when I try to build https://github.com/Kintaro/wtftw/tree/1d8040fddfedfd3b111bb4d5a8466fcb8120e339
Error output and rustc version are below.
rustc 1.2.0-dev (0fc0476 2015-05-24) (built 2015-05-24)
Unfortunately, #25652 did not fix the issue. It's caused by this part here https://github.com/Kintaro/wtftw/blob/1d8040fddfedfd3b111bb4d5a8466fcb8120e339/core/src/config.rs#L110
The text was updated successfully, but these errors were encountered: