|
| 1 | +warning: integer-to-pointer cast |
| 2 | + --> $DIR/ptr_int_casts.rs:LL:CC |
| 3 | + | |
| 4 | +LL | assert_eq!(1 as *const i32 as usize, 1); |
| 5 | + | ^^^^^^^^^^^^^^^ integer-to-pointer cast |
| 6 | + | |
| 7 | + = help: this program is using integer-to-pointer casts or (equivalently) `ptr::with_exposed_provenance`, which means that Miri might miss pointer bugs in this program |
| 8 | + = help: see https://doc.rust-lang.org/nightly/std/ptr/fn.with_exposed_provenance.html for more details on that operation |
| 9 | + = 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 |
| 10 | + = help: you can then set `MIRIFLAGS=-Zmiri-strict-provenance` to ensure you are not relying on `with_exposed_provenance` semantics |
| 11 | + = help: Tree Borrows does not support integer-to-pointer casts, so the program is likely to go wrong when this pointer gets used |
| 12 | + = note: BACKTRACE: |
| 13 | + = note: inside `ptr_int_casts` at $DIR/ptr_int_casts.rs:LL:CC |
| 14 | +note: inside `main` |
| 15 | + --> $DIR/ptr_int_casts.rs:LL:CC |
| 16 | + | |
| 17 | +LL | ptr_int_casts(); |
| 18 | + | ^^^^^^^^^^^^^^^ |
| 19 | + |
| 20 | +warning: integer-to-pointer cast |
| 21 | + --> $DIR/ptr_int_casts.rs:LL:CC |
| 22 | + | |
| 23 | +LL | assert_eq!((1 as *const i32).wrapping_offset(4) as usize, 1 + 4 * 4); |
| 24 | + | ^^^^^^^^^^^^^^^^^ integer-to-pointer cast |
| 25 | + | |
| 26 | + = note: BACKTRACE: |
| 27 | + = note: inside `ptr_int_casts` at $DIR/ptr_int_casts.rs:LL:CC |
| 28 | +note: inside `main` |
| 29 | + --> $DIR/ptr_int_casts.rs:LL:CC |
| 30 | + | |
| 31 | +LL | ptr_int_casts(); |
| 32 | + | ^^^^^^^^^^^^^^^ |
| 33 | + |
| 34 | +warning: integer-to-pointer cast |
| 35 | + --> $DIR/ptr_int_casts.rs:LL:CC |
| 36 | + | |
| 37 | +LL | *val = (1 as *const u8).wrapping_offset(-4); |
| 38 | + | ^^^^^^^^^^^^^^^^ integer-to-pointer cast |
| 39 | + | |
| 40 | + = note: BACKTRACE: |
| 41 | + = note: inside `ptr_int_casts` at $DIR/ptr_int_casts.rs:LL:CC |
| 42 | +note: inside `main` |
| 43 | + --> $DIR/ptr_int_casts.rs:LL:CC |
| 44 | + | |
| 45 | +LL | ptr_int_casts(); |
| 46 | + | ^^^^^^^^^^^^^^^ |
| 47 | + |
| 48 | +warning: integer-to-pointer cast |
| 49 | + --> $DIR/ptr_int_casts.rs:LL:CC |
| 50 | + | |
| 51 | +LL | let y = y as *const _; |
| 52 | + | ^^^^^^^^^^^^^ integer-to-pointer cast |
| 53 | + | |
| 54 | + = note: BACKTRACE: |
| 55 | + = note: inside `ptr_int_casts` at $DIR/ptr_int_casts.rs:LL:CC |
| 56 | +note: inside `main` |
| 57 | + --> $DIR/ptr_int_casts.rs:LL:CC |
| 58 | + | |
| 59 | +LL | ptr_int_casts(); |
| 60 | + | ^^^^^^^^^^^^^^^ |
| 61 | + |
| 62 | +warning: integer-to-pointer cast |
| 63 | + --> $DIR/ptr_int_casts.rs:LL:CC |
| 64 | + | |
| 65 | +LL | let x: fn() -> i32 = unsafe { mem::transmute(y as *mut u8) }; |
| 66 | + | ^^^^^^^^^^^^ integer-to-pointer cast |
| 67 | + | |
| 68 | + = note: BACKTRACE: |
| 69 | + = note: inside `ptr_int_casts` at $DIR/ptr_int_casts.rs:LL:CC |
| 70 | +note: inside `main` |
| 71 | + --> $DIR/ptr_int_casts.rs:LL:CC |
| 72 | + | |
| 73 | +LL | ptr_int_casts(); |
| 74 | + | ^^^^^^^^^^^^^^^ |
| 75 | + |
| 76 | +warning: integer-to-pointer cast |
| 77 | + --> $DIR/ptr_int_casts.rs:LL:CC |
| 78 | + | |
| 79 | +LL | assert_eq!((-1i32) as usize as *const i32 as usize, (-1i32) as usize); |
| 80 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ integer-to-pointer cast |
| 81 | + | |
| 82 | + = note: BACKTRACE: |
| 83 | + = note: inside `ptr_int_casts` at $DIR/ptr_int_casts.rs:LL:CC |
| 84 | +note: inside `main` |
| 85 | + --> $DIR/ptr_int_casts.rs:LL:CC |
| 86 | + | |
| 87 | +LL | ptr_int_casts(); |
| 88 | + | ^^^^^^^^^^^^^^^ |
| 89 | + |
0 commit comments