rust/tests/crashes/126666.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
330 B
Rust
Raw Normal View History

2024-06-23 18:14:44 +02:00
//@ known-bug: rust-lang/rust#126666
#![feature(const_mut_refs)]
#![feature(const_refs_to_static)]
#![feature(object_safe_for_dispatch)]
struct Meh {
x: &'static dyn UnsafeCell,
}
const MUH: Meh = Meh {
x: &mut *(&READONLY as *const _ as *mut _),
};
static READONLY: i32 = 0;
trait UnsafeCell<'a> {}
pub fn main() {}