Skip to content
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

internal compiler error with undeclared 'self lifetime #8196

Closed
stepancheg opened this issue Aug 1, 2013 · 4 comments
Closed

internal compiler error with undeclared 'self lifetime #8196

stepancheg opened this issue Aug 1, 2013 · 4 comments

Comments

@stepancheg
Copy link
Contributor

struct Foo {
    dummy: ()
}

impl Foo {
    fn xx(&'self self) {
    }
}

fn main() {
}

Compiler crashes with:

rust: task failed at 'assertion failed: self.variance.is_some()', /private/tmp/rust-CauM/rust-0.7/src/librustc/middle/typeck/rscope.rs:181
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /private/tmp/rust-CauM/rust-0.7/src/librustc/rustc.rs:354
rust: domain main @0x7f94e9008a10 root task failed

If program is incorrect, compiler should print message and exit.

@pnkfelix
Copy link
Member

pnkfelix commented Oct 2, 2013

probably a subbug of #4846

@nikomatsakis
Copy link
Contributor

cc me

@eminence
Copy link
Contributor

Testing on the latest master (dc48adc)

After changing 'self to 'a, there is no longer an ICE. A correct error message is produced:

a.rs:6:12: 6:14 error: use of undeclared lifetime name `'a`
a.rs:6     fn xx(&'a self) {
                  ^~
error: aborting due to previous error

@steveklabnik
Copy link
Member

I see the same as @eminence . I think this can be closed.

flip1995 pushed a commit to flip1995/rust that referenced this issue Dec 30, 2021
Rustup

r? `@ghost`

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants