-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ICE in libsyntax/diagnostic.rs
#21756
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
#21942 reports that the nalgebra library hits this. |
image library seems to hit this too:
i'm running on a more recent rust version as well:
|
This must have been introduced recently rustc 1.0.0-nightly (3ef8ff1 2015-02-12 00:38:24 +0000) works… |
The issue has been reported 16 days ago, so it wasn't introduced recently. However |
Trying to run this snippet in the rust playpen gives an ICE:
The error log is:
|
router will hit this too, as soon as iron/router#74 is merged. |
I took a quick look at this and it's beyond my knowledge to fix, but the bug is being triggered here, and it looks like maybe @nikomatsakis or @flaper87 was the last one to touch that code? |
Hmm so the minimized code snippet here: trait MyTrait {
fn do_something(&self);
}
impl<'a> MyTrait for MyTrait + 'a {
fn do_something(&self) {
println!("MyTrait");
}
}
fn main() {
} is actually just broken code. That is, the compiler automatically generates an impl of |
I have a fix for some of these problems which I'm going to post, but I suspect there are different issues arising, so I'm not going to declare this bug fixed until I've been able to investigate more of the crates in question. |
`Trait`, prefer the object. Also give a nice error for attempts to manually `impl Trait for Trait`, since they will be ineffectual. Fixes rust-lang#24015. Fixes rust-lang#24051. Fixes rust-lang#24037. Fixes rust-lang#23853. Fixes rust-lang#21942. cc rust-lang#21756.
If we find a blanket impl for `Trait` but we're matching on an object `Trait`, prefer the object (I think we could perhaps go either way, but this seems safer). Also give a nice error for attempts to manually `impl Trait for Trait`, since they will be ineffectual. This fixes the problems around ambiguity ICEs relating to `Any` and `MarkerTrait` that were cropping up all over the place. There may still be similar ICEs reported in #21756 that this PR does not address. Fixes #24015. Fixes #24051. Fixes #24037. Fixes #23853. Fixes #21942. cc #21756. cc @alexcrichton (this fixes crates.io) r? @aturon
Seems to be fixed:
|
Yay! |
The text was updated successfully, but these errors were encountered: