Skip to content

Commit b868cbb

Browse files
committed
Rebase successful?
1 parent 47cf90a commit b868cbb

File tree

3 files changed

+17
-167
lines changed

3 files changed

+17
-167
lines changed

tests/ui/allow_attributes_false_positive.rs

-15
This file was deleted.

tests/ui/fn_null_check.stderr

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
1-
error: function pointer assumed to be nullable, even though it isn't
1+
error: lint `clippy::fn_null_check` has been renamed to `incorrect_fn_null_checks`
2+
--> $DIR/fn_null_check.rs:2:9
3+
|
4+
LL | #![warn(clippy::fn_null_check)]
5+
| ^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `incorrect_fn_null_checks`
6+
|
7+
= note: `-D renamed-and-removed-lints` implied by `-D warnings`
8+
9+
error: function pointers are not nullable, so checking them for null will always return false
210
--> $DIR/fn_null_check.rs:14:8
311
|
412
LL | if (fn_ptr as *mut ()).is_null() {}
513
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
614
|
7-
= help: try wrapping your function pointer type in `Option<T>` instead, and using `is_none` to check for null pointer value
8-
= note: `-D clippy::fn-null-check` implied by `-D warnings`
15+
= help: wrap the function pointer inside an `Option` and use `Option::is_none` to check for null pointer value
16+
= note: `-D incorrect-fn-null-checks` implied by `-D warnings`
917

10-
error: function pointer assumed to be nullable, even though it isn't
18+
error: function pointers are not nullable, so checking them for null will always return false
1119
--> $DIR/fn_null_check.rs:15:8
1220
|
1321
LL | if (fn_ptr as *const u8).is_null() {}
1422
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1523
|
16-
= help: try wrapping your function pointer type in `Option<T>` instead, and using `is_none` to check for null pointer value
24+
= help: wrap the function pointer inside an `Option` and use `Option::is_none` to check for null pointer value
1725

18-
error: function pointer assumed to be nullable, even though it isn't
26+
error: function pointers are not nullable, so checking them for null will always return false
1927
--> $DIR/fn_null_check.rs:16:8
2028
|
2129
LL | if (fn_ptr as *const ()) == std::ptr::null() {}
2230
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2331
|
24-
= help: try wrapping your function pointer type in `Option<T>` instead, and using `is_none` to check for null pointer value
32+
= help: wrap the function pointer inside an `Option` and use `Option::is_none` to check for null pointer value
2533

26-
error: function pointer assumed to be nullable, even though it isn't
34+
error: function pointers are not nullable, so checking them for null will always return false
2735
--> $DIR/fn_null_check.rs:17:8
2836
|
2937
LL | if (fn_ptr as *const ()) == (0 as *const ()) {}
3038
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3139
|
32-
= help: try wrapping your function pointer type in `Option<T>` instead, and using `is_none` to check for null pointer value
33-
34-
error: function pointer assumed to be nullable, even though it isn't
35-
--> $DIR/fn_null_check.rs:18:8
36-
|
37-
LL | if (fn_ptr as *const ()) == ZPTR {}
38-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39-
|
40-
= help: try wrapping your function pointer type in `Option<T>` instead, and using `is_none` to check for null pointer value
40+
= help: wrap the function pointer inside an `Option` and use `Option::is_none` to check for null pointer value
4141

4242
error: aborting due to 5 previous errors
4343

tests/ui/integer_arithmetic.rs

-135
This file was deleted.

0 commit comments

Comments
 (0)