2024-08-26 12:51:16 +00:00
|
|
|
//@check-pass
|
2019-09-18 20:31:25 +00:00
|
|
|
use std::cell::Cell;
|
|
|
|
|
2024-08-26 12:51:16 +00:00
|
|
|
const A: () = { let x = Cell::new(2); &raw const x; };
|
2019-09-18 20:31:25 +00:00
|
|
|
|
2024-08-26 12:51:16 +00:00
|
|
|
static B: () = { let x = Cell::new(2); &raw const x; };
|
2019-09-18 20:31:25 +00:00
|
|
|
|
2024-08-26 12:51:16 +00:00
|
|
|
static mut C: () = { let x = Cell::new(2); &raw const x; };
|
2019-09-18 20:31:25 +00:00
|
|
|
|
|
|
|
const fn foo() {
|
|
|
|
let x = Cell::new(0);
|
2024-08-26 12:51:16 +00:00
|
|
|
let y = &raw const x;
|
2019-09-18 20:31:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|