rust/tests/ui/consts/std/cell.stderr

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

27 lines
797 B
Plaintext
Raw Normal View History

error: encountered dangling pointer in final value of static
2024-08-26 12:51:16 +00:00
--> $DIR/cell.rs:4:1
|
LL | static FOO: Wrap<*mut u32> = Wrap(Cell::new(42).as_ptr());
2022-02-13 15:27:59 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: encountered dangling pointer in final value of constant
2024-08-26 12:51:16 +00:00
--> $DIR/cell.rs:6:1
|
LL | const FOO_CONST: Wrap<*mut u32> = Wrap(Cell::new(42).as_ptr());
2022-02-13 15:27:59 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: encountered dangling pointer in final value of constant
2024-08-26 12:51:16 +00:00
--> $DIR/cell.rs:20:1
|
LL | const FOO4_CONST: Wrap<*mut u32> = Wrap(FOO3_CONST.0.as_ptr());
2022-02-13 15:27:59 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: encountered dangling pointer in final value of constant
2024-08-26 12:51:16 +00:00
--> $DIR/cell.rs:25:1
|
LL | const FOO2: *mut u32 = Cell::new(42).as_ptr();
2022-02-13 15:27:59 +00:00
| ^^^^^^^^^^^^^^^^^^^^
error: aborting due to 4 previous errors