-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
An option of a generic pointer triggers an LLVM assertion #9719
Labels
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Comments
Reproduced on Linux. |
Example without pub enum Enum<T> {
A(T),
}
pub trait X {}
impl X for int {}
pub struct Z<'self>(Enum<&'self X>);
pub fn main() { let x = 42; let z = Z(A(&x as &X)); let _ = z; } |
It occurs only with tuple structs; as a workaround, you may replace struct Z<'self>(Enum<&'self X>); with struct Z<'self>{
z: Enum<&'self X>
} |
Sorry. It doesn't solve it generally. I'm now embarrassed that trait X {}
impl X for int {}
struct Y<'self>{
x:Option<&'self X>,
}
fn main() {
let x = 42;
let a = Some(&x as &X);
let _y = Y { x: a };
} works, but ...
fn main() {
let x = 42;
let _y = Y { x: Some(&x as &X) }; // inlining a
} does not. |
cc |
This has been fixed, flagging as needstest. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Minimal example:
In my Windows machine, it results in:
Reproduced on Rust 0.8 and 0.9-pre (371a7ec). It doesn't seem to be Windows specific either.
The text was updated successfully, but these errors were encountered: