-
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: unexpected failure #13853
Comments
Here is a smaller bit of code that causes a compiler error. I am not 100% sure it is the same case though.
|
Another testcase
|
Another test case
|
Another testcase: struct AutoBuilder<'a> {
context: &'a int
}
impl<'a> Drop for AutoBuilder<'a> {
fn drop(&mut self) {
}
}
fn main() {
} |
I'm pretty much new at this on many levels (just created this account!), so you should take anything I say with a grain of salt. Anyway, I too hit this bug with essentially the same code as jdm - trying to implement Drop for a struct containing a borrowed pointer. After some git bisecting looks like the commit 7d6f1aa is the first one where this error happens. That commit changed file src/librustc/middle/subst.rs and the stack traces mention middle::subst so maybe there's something to this? When testing with the Drop version of the code, the older versions of rustc suggest adding a #["unsafe_destructor"]. It seems to make the error go away on newer versions too - just tested it on rustc 0.11.0-pre-nightly (faa7ba7 2014-05-31 01:06:40 -0700), x86_64-unknown-linux-gnu, and the code compiled without any complaints. |
Motivated by @irauta's findings, I played around with my testcase and provoked what appears to be Yet Another ICE. It looks different, but it might be caused by the same underlying problem so I'm posting it here instead of creating a new issue. Testcase (notice that only the #![crate_type = "lib"]
enum NodeContents<'a> {
Children(Vec<Node<'a>>),
}
impl<'a> Drop for NodeContents<'a> {
fn drop( &mut self ) {
}
}
struct Node<'a> {
contents: NodeContents<'a>,
}
impl<'a> Node<'a> {
fn noName(contents: NodeContents<'a>) -> Node<'a> {
Node{ contents: contents,}
}
} Output:
|
As of |
Another test case that has the same backtrace.
|
Given how frequently people keep hitting this, could fixing the problem be given a priority boost? |
Due to a rustc bug: rust-lang/rust#13853 rust-lang/rust#14889 this requires the 'unsafe_destructor' attribute on the Transaction class.
I'm happy to report that I'm not getting internal compiler errors on any of these examples anymore. Perhaps @nikomatsakis's #18993 fixed the problem? Can we make sure that there are some regression tests? |
Use diagnostic code as link to full message fixes rust-lang#13823 by adding a vscode setting that will keeping the existing diagnostic code and use it as a link to the full compiler error message. While I was there I also fixed `index` to fallback to `rendered.length` to make the previewRustcOutput feature work.
…st-lang#13853) fix rust-lang#13624 changelog: [`unnecessary_to_owned`]: don't suggest to use `cloned` on `Cow` in `unnecessary_to_owned`
backtrace:
The text was updated successfully, but these errors were encountered: