Skip to content

internal compiler error with undeclared 'self lifetime #8196

Closed
@stepancheg

Description

@stepancheg
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions