You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Broken LLVM function when pushing dyn* item to Vec. #102141
#![feature(dyn_star)]#![allow(incomplete_features)]use core::fmt::Debug;fnmain(){letmut v = vec![];let i = 42_u8asdyn*Debug;
v.push(i);}
Result:
Call parameter type does not match function signature!
i8 42
i64 invoke void @"_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h57979dab0e1643c2E"(ptr align 8 %3, i8 42, ptr align 8 @6)
to label %14 unwind label %8, !dbg !2675
in function _ZN10playground4main17h68903ee09fbec9bcE
LLVM ERROR: Broken function found, compilation aborted!
error: Undefined Behavior: scalar size mismatch: expected 8 bytes but got 1 bytes instead
--> src/main.rs:8:13
|
8 | let i = 42_u8 as dyn* Debug;
| ^^^^^^^^^^^^^^^^^^^ scalar size mismatch: expected 8 bytes but got 1 bytes instead
|
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
= note: BACKTRACE:
= note: inside `main` at src/main.rs:8:13
Activity
matthiaskrgr commentedon Sep 22, 2022
Miri actually reports this as a bug :)
compiler-errors commentedon Sep 22, 2022
FYI: We currently have 0 checks that
dyn*actually fit their size requirement currently.Rollup merge of rust-lang#104338 - compiler-errors:pointer-sized, r=e…
Rollup merge of rust-lang#104338 - compiler-errors:pointer-sized, r=e…
Rollup merge of rust-lang#104338 - compiler-errors:pointer-sized, r=e…
Rollup merge of rust-lang#104338 - compiler-errors:pointer-sized, r=e…