blob: 6373333259144348942ad6d7de9e1856c8856cba [file] [log] [blame]
use std::cell::UnsafeCell;
const A: UnsafeCell<usize> = UnsafeCell::new(1);
const B: &'static UnsafeCell<usize> = &A;
//~^ ERROR: interior mutable shared borrows of temporaries
struct C { a: UnsafeCell<usize> }
const D: C = C { a: UnsafeCell::new(1) };
const E: &'static UnsafeCell<usize> = &D.a;
//~^ ERROR: interior mutable shared borrows of temporaries
const F: &'static C = &D;
//~^ ERROR: interior mutable shared borrows of temporaries
fn main() {}