-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
STR
use std::fmt;
// CoerceUnsized is not implemented for tuples. You can still create
// an unsized tuple by transmuting a trait object.
fn any<T>() -> T { unreachable!() }
fn main() {
let t: &(u8, fmt::Debug) = any();
println!("{:?}", &t.1);
}
Actual Results
Before #32939, this caused an LLVM error
Stored value type does not match pointer operand type!
store i8 %17, void (i8*)*** %18
void (i8*)**LLVM ERROR: Broken function found, compilation aborted!
Afterwards, this causes an ICE (the rustc size is the correct one):
error: internal compiler error: ../src/librustc_trans/type_of.rs:142: size differs (rustc: 1, llvm: 24) for type `(u8, std::fmt::Debug + 'static)` / Univariant {
variant: Struct {
align: Align {
raw: 48
},
packed: false,
sized: false,
offset_after_field: [
Size {
raw: 1
},
Size {
raw: 1
}
]
},
non_zero: false
}
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.