Skip to content

Commit 8a5b75a

Browse files
Update ui tests
1 parent f9fdb10 commit 8a5b75a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+244
-192
lines changed

tests/ui/author/issue_3849.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![allow(dead_code)]
22
#![allow(clippy::zero_ptr)]
33
#![allow(clippy::transmute_ptr_to_ref)]
4-
#![allow(clippy::transmuting_null)]
4+
#![allow(clippy::transmuting_null, clippy::missing_transmute_annotations)]
55

66
pub const ZPTR: *const usize = 0 as *const _;
77

tests/ui/blocks_in_conditions.fixed

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#![warn(clippy::blocks_in_conditions)]
2-
#![allow(unused, clippy::let_and_return, clippy::needless_if)]
2+
#![allow(
3+
unused,
4+
clippy::let_and_return,
5+
clippy::needless_if,
6+
clippy::missing_transmute_annotations
7+
)]
38
#![warn(clippy::nonminimal_bool)]
49

510
macro_rules! blocky {

tests/ui/blocks_in_conditions.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#![warn(clippy::blocks_in_conditions)]
2-
#![allow(unused, clippy::let_and_return, clippy::needless_if)]
2+
#![allow(
3+
unused,
4+
clippy::let_and_return,
5+
clippy::needless_if,
6+
clippy::missing_transmute_annotations
7+
)]
38
#![warn(clippy::nonminimal_bool)]
49

510
macro_rules! blocky {

tests/ui/blocks_in_conditions.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: in an `if` condition, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`
2-
--> $DIR/blocks_in_conditions.rs:23:5
2+
--> $DIR/blocks_in_conditions.rs:28:5
33
|
44
LL | / if {
55
LL | |
@@ -20,13 +20,13 @@ LL ~ }; if res {
2020
|
2121

2222
error: omit braces around single expression condition
23-
--> $DIR/blocks_in_conditions.rs:35:8
23+
--> $DIR/blocks_in_conditions.rs:40:8
2424
|
2525
LL | if { true } { 6 } else { 10 }
2626
| ^^^^^^^^ help: try: `true`
2727

2828
error: this boolean expression can be simplified
29-
--> $DIR/blocks_in_conditions.rs:41:8
29+
--> $DIR/blocks_in_conditions.rs:46:8
3030
|
3131
LL | if true && x == 3 { 6 } else { 10 }
3232
| ^^^^^^^^^^^^^^ help: try: `x == 3`
@@ -35,7 +35,7 @@ LL | if true && x == 3 { 6 } else { 10 }
3535
= help: to override `-D warnings` add `#[allow(clippy::nonminimal_bool)]`
3636

3737
error: in a `match` scrutinee, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a `let`
38-
--> $DIR/blocks_in_conditions.rs:68:5
38+
--> $DIR/blocks_in_conditions.rs:73:5
3939
|
4040
LL | / match {
4141
LL | |

tests/ui/crashes/ice-1782.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![allow(dead_code, unused_variables)]
2-
#![allow(clippy::unnecessary_cast)]
2+
#![allow(clippy::unnecessary_cast, clippy::missing_transmute_annotations)]
33

44
/// Should not trigger an ICE in `SpanlessEq` / `consts::constant`
55
///

tests/ui/crashes/ice-4968.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Test for https://github.com/rust-lang/rust-clippy/issues/4968
22

33
#![warn(clippy::unsound_collection_transmute)]
4-
#![allow(clippy::transmute_undefined_repr)]
4+
#![allow(clippy::transmute_undefined_repr, clippy::missing_transmute_annotations)]
55

66
trait Trait {
77
type Assoc;

tests/ui/eager_transmute.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![feature(rustc_attrs)]
22
#![warn(clippy::eager_transmute)]
3-
#![allow(clippy::transmute_int_to_non_zero)]
3+
#![allow(clippy::transmute_int_to_non_zero, clippy::missing_transmute_annotations)]
44

55
use std::num::NonZeroU8;
66

tests/ui/eager_transmute.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![feature(rustc_attrs)]
22
#![warn(clippy::eager_transmute)]
3-
#![allow(clippy::transmute_int_to_non_zero)]
3+
#![allow(clippy::transmute_int_to_non_zero, clippy::missing_transmute_annotations)]
44

55
use std::num::NonZeroU8;
66

tests/ui/missing_const_for_fn/could_be_const.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![warn(clippy::missing_const_for_fn)]
2-
#![allow(incomplete_features, clippy::let_and_return)]
2+
#![allow(incomplete_features, clippy::let_and_return, clippy::missing_transmute_annotations)]
33
#![feature(const_mut_refs)]
44
#![feature(const_trait_impl)]
55

tests/ui/missing_transmute_annotations.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![warn(clippy::missing_transmute_annotation)]
1+
#![warn(clippy::missing_transmute_annotations)]
22

33
macro_rules! bad_transmute {
44
($e:expr) => {

tests/ui/missing_transmute_annotations.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ error: transmute used without annotations
44
LL | let x: i32 = std::mem::transmute([1u16, 2u16]);
55
| ^^^^^^^^^ help: consider adding missing annotations: `transmute::<[u16; 2], i32>`
66
|
7-
= note: `-D clippy::missing-transmute-annotation` implied by `-D warnings`
8-
= help: to override `-D warnings` add `#[allow(clippy::missing_transmute_annotation)]`
7+
= note: `-D clippy::missing-transmute-annotations` implied by `-D warnings`
8+
= help: to override `-D warnings` add `#[allow(clippy::missing_transmute_annotations)]`
99

1010
error: transmute used without annotations
1111
--> $DIR/missing_transmute_annotations.rs:13:32

tests/ui/ptr_cast_constness.fixed

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
//@aux-build:proc_macros.rs
22

33
#![warn(clippy::ptr_cast_constness)]
4-
#![allow(clippy::transmute_ptr_to_ref, clippy::unnecessary_cast, unused)]
4+
#![allow(
5+
clippy::transmute_ptr_to_ref,
6+
clippy::unnecessary_cast,
7+
unused,
8+
clippy::missing_transmute_annotations
9+
)]
510

611
extern crate proc_macros;
712
use proc_macros::{external, inline_macros};

tests/ui/ptr_cast_constness.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
//@aux-build:proc_macros.rs
22

33
#![warn(clippy::ptr_cast_constness)]
4-
#![allow(clippy::transmute_ptr_to_ref, clippy::unnecessary_cast, unused)]
4+
#![allow(
5+
clippy::transmute_ptr_to_ref,
6+
clippy::unnecessary_cast,
7+
unused,
8+
clippy::missing_transmute_annotations
9+
)]
510

611
extern crate proc_macros;
712
use proc_macros::{external, inline_macros};

tests/ui/ptr_cast_constness.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: `as` casting between raw pointers while changing only its constness
2-
--> $DIR/ptr_cast_constness.rs:10:41
2+
--> $DIR/ptr_cast_constness.rs:15:41
33
|
44
LL | let _: &mut T = std::mem::transmute(p as *mut T);
55
| ^^^^^^^^^^^ help: try `pointer::cast_mut`, a safer alternative: `p.cast_mut()`
@@ -8,37 +8,37 @@ LL | let _: &mut T = std::mem::transmute(p as *mut T);
88
= help: to override `-D warnings` add `#[allow(clippy::ptr_cast_constness)]`
99

1010
error: `as` casting between raw pointers while changing only its constness
11-
--> $DIR/ptr_cast_constness.rs:11:19
11+
--> $DIR/ptr_cast_constness.rs:16:19
1212
|
1313
LL | let _ = &mut *(p as *mut T);
1414
| ^^^^^^^^^^^^^ help: try `pointer::cast_mut`, a safer alternative: `p.cast_mut()`
1515

1616
error: `as` casting between raw pointers while changing only its constness
17-
--> $DIR/ptr_cast_constness.rs:26:17
17+
--> $DIR/ptr_cast_constness.rs:31:17
1818
|
1919
LL | let _ = *ptr_ptr as *mut u32;
2020
| ^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast_mut`, a safer alternative: `(*ptr_ptr).cast_mut()`
2121

2222
error: `as` casting between raw pointers while changing only its constness
23-
--> $DIR/ptr_cast_constness.rs:29:13
23+
--> $DIR/ptr_cast_constness.rs:34:13
2424
|
2525
LL | let _ = ptr as *mut u32;
2626
| ^^^^^^^^^^^^^^^ help: try `pointer::cast_mut`, a safer alternative: `ptr.cast_mut()`
2727

2828
error: `as` casting between raw pointers while changing only its constness
29-
--> $DIR/ptr_cast_constness.rs:30:13
29+
--> $DIR/ptr_cast_constness.rs:35:13
3030
|
3131
LL | let _ = mut_ptr as *const u32;
3232
| ^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast_const`, a safer alternative: `mut_ptr.cast_const()`
3333

3434
error: `as` casting between raw pointers while changing only its constness
35-
--> $DIR/ptr_cast_constness.rs:59:13
35+
--> $DIR/ptr_cast_constness.rs:64:13
3636
|
3737
LL | let _ = ptr as *mut u32;
3838
| ^^^^^^^^^^^^^^^ help: try `pointer::cast_mut`, a safer alternative: `ptr.cast_mut()`
3939

4040
error: `as` casting between raw pointers while changing only its constness
41-
--> $DIR/ptr_cast_constness.rs:60:13
41+
--> $DIR/ptr_cast_constness.rs:65:13
4242
|
4343
LL | let _ = mut_ptr as *const u32;
4444
| ^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast_const`, a safer alternative: `mut_ptr.cast_const()`

tests/ui/transmute.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
#![allow(dead_code, clippy::borrow_as_ptr, clippy::needless_lifetimes)]
1+
#![allow(
2+
dead_code,
3+
clippy::borrow_as_ptr,
4+
clippy::needless_lifetimes,
5+
clippy::missing_transmute_annotations
6+
)]
27
//@no-rustfix
38
extern crate core;
49

0 commit comments

Comments
 (0)