Skip to content

ICE with slice in a generic struct #3821

Closed
@14427

Description

@14427

The following code causes an internal compiler error:

fn foo<T>() {
    let _x: Bar<T> = Bar{ arr: &[] };
}

struct Bar<T> {
    arr: &[T],
}

fn test_foo() {
    foo::<()>();
}

Switching the &[T] to a Option<T> makes it go away.

Backtrace here: https://gist.github.com/3924593

Metadata

Metadata

Assignees

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