Skip to content

Adding self parameter to trait causes code to segfault #4850

Description

@mcpherrinm

The following snippet segfaults when run. Removing the "self" parameters to thingie makes it not segfault, but makes rustc tell me that form is deprecated.

pub trait TestTrait {
  fn thingie(self) -> ~[u8];
}

impl ~[u8]: TestTrait {
  fn thingie(self) -> ~[u8] {
    ~[0u8]
  }
}

fn main() {
  let n = ~[];
  n.thingie();
}

Activity

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-codegenArea: Code generationA-trait-systemArea: Trait systemI-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions