]> git.lizzy.rs Git - rust.git/blob - tests/ui/ptr_offset_with_cast.stderr
New lint: Suggest `ptr.add([usize])` over `ptr.offset([usize] as isize)`.
[rust.git] / tests / ui / ptr_offset_with_cast.stderr
1 error: use of `offset` with a `usize` casted to an `isize`
2   --> $DIR/ptr_offset_with_cast.rs:10:9
3    |
4 10 |         ptr.offset(offset_usize as isize);
5    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ptr.add(offset_usize)`
6    |
7    = note: `-D ptr-offset-with-cast` implied by `-D warnings`
8
9 error: aborting due to previous error
10