Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE with slice in a generic struct #3821

Closed
14427 opened this issue Oct 20, 2012 · 4 comments
Closed

ICE with slice in a generic struct #3821

14427 opened this issue Oct 20, 2012 · 4 comments
Assignees

Comments

@14427
Copy link
Contributor

14427 commented Oct 20, 2012

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

@brson
Copy link
Contributor

brson commented Oct 22, 2012

This test case builds for me on incoming.

@brson
Copy link
Contributor

brson commented Oct 22, 2012

Ah, the stage0 compiler does ICE. Maybe we just need to snapshot.

@ghost ghost assigned brson Oct 22, 2012
@brson
Copy link
Contributor

brson commented Oct 22, 2012

I started a snapshot.

@14427
Copy link
Contributor Author

14427 commented Oct 23, 2012

That fixed it.

@14427 14427 closed this as completed Oct 23, 2012
RalfJung pushed a commit to RalfJung/rust that referenced this issue Aug 18, 2024
Set EINVAL for epoll_wait maxevent value 0

Fixes rust-lang#3821
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants