-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 involving traits with lifetime params (?) #10201
Comments
This is likely a dupe of any number of other Regardless, thanks for the report! |
Certainly the assertion will go away. I expect the test cases will work properly, but one of the "to do" items is to go through and test them all. |
I've modernized this code here, and it now is erroring out instead of ICE-ing:
produces:
I don't quite understand how this initial code was supposed to work, so I'm not going to close it yet. @nikomatsakis: can we close this? |
Erick, thanks for resurrecting this and doing the modernizing. I had gone too far simplifying things when trying to make the smallest test case, so the type parameters A and B which C depends on weren't determined, just as the helpful compiler message now says (previously hidden by the ICE). So giving A and B concrete types (as they were in the real program), the program now compiles. (Compiles)trait Trait_A {}
struct Struct_A;
impl Trait_A for Struct_A {}
trait Trait_B<A> {}
struct Struct_B<A>;
impl<A:Trait_A> Trait_B<A> for Struct_B<A> {}
struct C<A,B>;
trait Trait_D<'a, A:Trait_A, B:Trait_B<A>> {
fn c(&self) -> &'a C<A,B>;
}
struct Struct_D<'a,A,B> {
c: &'a C<A,B>,
}
impl<'a,A:Trait_A,B:Trait_B<A>> Trait_D<'a,A,B> for Struct_D<'a,A,B> {
fn c(&self) -> &'a C<A,B> {
self.c
}
}
fn foo<'a, A: Trait_A, B: Trait_B<A>, D: Trait_D<'a, A, B>>(d: &'a D) -> uint {
0u
}
pub fn main() {
let a = Struct_A;
let b: Struct_B<Struct_A> = Struct_B;
let c: C<Struct_A, Struct_B<Struct_A>> = C;
let d = Struct_D { c: &c };
let z = foo(&d);
println!("{}", z.to_str());
} I think this one can be closed, great job yall. |
Add missing arguments to `new_lint` example of `cargo` lints changelog: Add missing arguments to `new_lint` code example. From the surrounding text, it seems like this code example is missing the arguments to create a new `cargo` lint.
The following code produces an ICE (unbuntu 13.04 x86-64, 10/30/2013 nightly 0.9-pre build):
Ubuntu 13.04, x86-64, nightly build of 10/31/2013:
$ rustc scratch4.rs
task '' failed at 'assertion failed: rp.is_none()', /build/buildd/rust-nightly-201310300805
e42e378raring/src/librustc/middle/typeck/collect.rs:1108error: internal compiler error: unexpected failure
This message reflects a bug in the Rust compiler.
We would appreciate a bug report: https://github.com/mozilla/rust/wiki/HOWTO-submit-a-Rust-bug-report
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1 to get further details and report the results to github.com/mozilla/rust/issues
task '' failed at 'explicit failure', /build/buildd/rust-nightly-201310300805
e42e378raring/src/librustc/rustc.rs:396The text was updated successfully, but these errors were encountered: