]> git.lizzy.rs Git - rust.git/blob - tests/pass/box.stderr
tweak int2ptr diagnostics
[rust.git] / tests / pass / box.stderr
1 warning: integer-to-pointer cast
2   --> $DIR/box.rs:LL:CC
3    |
4 LL |         let r2 = ((r as usize) + 0) as *mut i32;
5    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ integer-to-pointer cast
6    |
7    = help: This program is using integer-to-pointer casts or (equivalently) `ptr::from_exposed_addr`,
8    = help: which means that Miri might miss pointer bugs in this program.
9    = help: See https://doc.rust-lang.org/nightly/std/ptr/fn.from_exposed_addr.html for more details on that operation.
10    = help: To ensure that Miri does not miss bugs in your program, use Strict Provenance APIs (https://doc.rust-lang.org/nightly/std/ptr/index.html#strict-provenance, https://crates.io/crates/sptr) instead.
11    = help: You can then pass the `-Zmiri-strict-provenance` flag to Miri, to ensure you are not relying on `from_exposed_addr` semantics.
12    = help: Alternatively, the `-Zmiri-permissive-provenance` flag disables this warning.
13            
14    = note: inside `into_raw` at $DIR/box.rs:LL:CC
15 note: inside `main` at $DIR/box.rs:LL:CC
16   --> $DIR/box.rs:LL:CC
17    |
18 LL |     into_raw();
19    |     ^^^^^^^^^^
20
21 warning: integer-to-pointer cast
22   --> $DIR/box.rs:LL:CC
23    |
24 LL |         let r = ((u.as_ptr() as usize) + 0) as *mut i32;
25    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ integer-to-pointer cast
26    |
27    = note: inside `into_unique` at $DIR/box.rs:LL:CC
28 note: inside `main` at $DIR/box.rs:LL:CC
29   --> $DIR/box.rs:LL:CC
30    |
31 LL |     into_unique();
32    |     ^^^^^^^^^^^^^
33