-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the MSRV and add the tests for MSRV
- Loading branch information
Showing
4 changed files
with
60 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2968,4 +2968,6 @@ impl<'tcx> LateLintPass<'tcx> for PtrAsPtr { | |
} | ||
} | ||
} | ||
|
||
extract_msrv_attr!(LateContext); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,46 @@ | ||
error: `as` casting between raw pointers without changing its mutability | ||
--> $DIR/ptr_as_ptr.rs:9:13 | ||
--> $DIR/ptr_as_ptr.rs:10:13 | ||
| | ||
LL | let _ = ptr as *const i32; | ||
| ^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `ptr.cast::<i32>()` | ||
| | ||
= note: `-D clippy::ptr-as-ptr` implied by `-D warnings` | ||
|
||
error: `as` casting between raw pointers without changing its mutability | ||
--> $DIR/ptr_as_ptr.rs:10:13 | ||
--> $DIR/ptr_as_ptr.rs:11:13 | ||
| | ||
LL | let _ = mut_ptr as *mut i32; | ||
| ^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `mut_ptr.cast::<i32>()` | ||
|
||
error: `as` casting between raw pointers without changing its mutability | ||
--> $DIR/ptr_as_ptr.rs:15:17 | ||
--> $DIR/ptr_as_ptr.rs:16:17 | ||
| | ||
LL | let _ = *ptr_ptr as *const i32; | ||
| ^^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `(*ptr_ptr).cast::<i32>()` | ||
|
||
error: `as` casting between raw pointers without changing its mutability | ||
--> $DIR/ptr_as_ptr.rs:28:25 | ||
--> $DIR/ptr_as_ptr.rs:29:25 | ||
| | ||
LL | let _: *const i32 = ptr as *const _; | ||
| ^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `ptr.cast()` | ||
|
||
error: `as` casting between raw pointers without changing its mutability | ||
--> $DIR/ptr_as_ptr.rs:29:23 | ||
--> $DIR/ptr_as_ptr.rs:30:23 | ||
| | ||
LL | let _: *mut i32 = mut_ptr as _; | ||
| ^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `mut_ptr.cast()` | ||
|
||
error: aborting due to 5 previous errors | ||
error: `as` casting between raw pointers without changing its mutability | ||
--> $DIR/ptr_as_ptr.rs:48:13 | ||
| | ||
LL | let _ = ptr as *const i32; | ||
| ^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `ptr.cast::<i32>()` | ||
|
||
error: `as` casting between raw pointers without changing its mutability | ||
--> $DIR/ptr_as_ptr.rs:49:13 | ||
| | ||
LL | let _ = mut_ptr as *mut i32; | ||
| ^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `mut_ptr.cast::<i32>()` | ||
|
||
error: aborting due to 7 previous errors | ||
|