Skip to content

Segfault with explicit, by-value self and vectors #4318

Closed
@Dretch

Description

@Dretch

The following code compiles but segfaults when run:

trait F<T> {
    fn f(self);
}

impl <T> ~[T] : F<T> {
    fn f(self) {}
}

fn main() {
    (~[1]).f();
}

Changing f to take &self makes it work.

This might be related to #4132

Metadata

Metadata

Assignees

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