-
Notifications
You must be signed in to change notification settings - Fork 13.4k
An option of a generic pointer triggers an LLVM assertion #9719
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
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. |
# for free
to join this conversation on GitHub.
Already have an account?
# 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: