Skip to content

ICE: Default methods and &Self #8148

Closed
Closed

Description

@alexcrichton

The following code gives an ICE:

trait Foo {
    fn foo(&Self) {}
}
fn main() {
}

with the message:

rust: task failed at 'index out of bounds: the len is 0 but the index is 0', /Users/alex/code/rust-opt/src/librustc/middle/liveness.rs:1598

ping @msullivan

Activity

  1. alexcrichton commented on Jul 31, 2013

    @alexcrichton
    MemberAuthor

    I also then realized that this code doesn't parse:

    trait Foo {
        fn foo(_: &Self) {}
    }
    fn main() {
    }
  2. msullivan commented on Aug 22, 2013

    @msullivan
    Contributor

    Hm. This is the same bugs as #8468 and #8417. This was first, but I didn't notice it, so closing it as a dupe.

  3. added a commit that references this issue on Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-trait-systemI-ICE

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions