diff options
| author | bors <bors@rust-lang.org> | 2024-10-18 11:31:05 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-10-18 11:31:05 +0000 |
| commit | a109190d7060236e655fc75533373fa274ec5343 (patch) | |
| tree | 3a6a30baf6649f3a6190aa7d25eb8b1a62473e34 /tests | |
| parent | dae1be90eeb20d1d5b7b30d3fc4f2a119cee638b (diff) | |
| parent | 4b5d1894db0f79fe46b3d4e8cba91624c5d01790 (diff) | |
| download | rust-a109190d7060236e655fc75533373fa274ec5343.tar.gz rust-a109190d7060236e655fc75533373fa274ec5343.zip | |
Auto merge of #13561 - flip1995:rustup, r=flip1995
Rustup r? `@ghost` changelog: none
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui-toml/unwrap_used/unwrap_used.fixed | 1 | ||||
| -rw-r--r-- | tests/ui-toml/unwrap_used/unwrap_used.rs | 1 | ||||
| -rw-r--r-- | tests/ui-toml/unwrap_used/unwrap_used.stderr | 2 | ||||
| -rw-r--r-- | tests/ui/crashes/ice-12284.rs | 10 | ||||
| -rw-r--r-- | tests/ui/doc/doc-fixable.fixed | 2 | ||||
| -rw-r--r-- | tests/ui/doc/doc-fixable.rs | 2 | ||||
| -rw-r--r-- | tests/ui/get_unwrap.fixed | 1 | ||||
| -rw-r--r-- | tests/ui/get_unwrap.rs | 1 | ||||
| -rw-r--r-- | tests/ui/get_unwrap.stderr | 8 | ||||
| -rw-r--r-- | tests/ui/transmute_float_to_int.fixed | 4 | ||||
| -rw-r--r-- | tests/ui/transmute_float_to_int.rs | 4 | ||||
| -rw-r--r-- | tests/ui/transmutes_expressible_as_ptr_casts.fixed | 12 | ||||
| -rw-r--r-- | tests/ui/transmutes_expressible_as_ptr_casts.rs | 12 |
13 files changed, 33 insertions, 27 deletions
diff --git a/tests/ui-toml/unwrap_used/unwrap_used.fixed b/tests/ui-toml/unwrap_used/unwrap_used.fixed index baf939af24e..cdb8fa0454c 100644 --- a/tests/ui-toml/unwrap_used/unwrap_used.fixed +++ b/tests/ui-toml/unwrap_used/unwrap_used.fixed @@ -86,6 +86,7 @@ mod issue9612 { util(); } + #[allow(unconditional_panic)] fn util() { let _a: u8 = 4.try_into().unwrap(); let _a: u8 = 5.try_into().expect(""); diff --git a/tests/ui-toml/unwrap_used/unwrap_used.rs b/tests/ui-toml/unwrap_used/unwrap_used.rs index e300ba18c33..e53d53db5f7 100644 --- a/tests/ui-toml/unwrap_used/unwrap_used.rs +++ b/tests/ui-toml/unwrap_used/unwrap_used.rs @@ -86,6 +86,7 @@ mod issue9612 { util(); } + #[allow(unconditional_panic)] fn util() { let _a: u8 = 4.try_into().unwrap(); let _a: u8 = 5.try_into().expect(""); diff --git a/tests/ui-toml/unwrap_used/unwrap_used.stderr b/tests/ui-toml/unwrap_used/unwrap_used.stderr index 320578bfabc..b58ce9b8af3 100644 --- a/tests/ui-toml/unwrap_used/unwrap_used.stderr +++ b/tests/ui-toml/unwrap_used/unwrap_used.stderr @@ -274,7 +274,7 @@ LL | let _ = &boxed_slice[1]; | ~~~~~~~~~~~~~~~ error: called `.get().unwrap()` on a slice - --> tests/ui-toml/unwrap_used/unwrap_used.rs:93:17 + --> tests/ui-toml/unwrap_used/unwrap_used.rs:94:17 | LL | let _ = Box::new([0]).get(1).unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/crashes/ice-12284.rs b/tests/ui/crashes/ice-12284.rs deleted file mode 100644 index 8d1dbface8e..00000000000 --- a/tests/ui/crashes/ice-12284.rs +++ /dev/null @@ -1,10 +0,0 @@ -#![allow(incomplete_features)] -#![feature(unnamed_fields)] - -#[repr(C)] -struct Foo { - _: struct { - }, -} - -fn main() {} diff --git a/tests/ui/doc/doc-fixable.fixed b/tests/ui/doc/doc-fixable.fixed index edfffe8fcfe..355f2bc7736 100644 --- a/tests/ui/doc/doc-fixable.fixed +++ b/tests/ui/doc/doc-fixable.fixed @@ -3,7 +3,7 @@ #![allow(dead_code, incomplete_features)] #![warn(clippy::doc_markdown)] -#![feature(custom_inner_attributes, generic_const_exprs, const_option)] +#![feature(custom_inner_attributes, generic_const_exprs)] #![rustfmt::skip] /// The `foo_bar` function does _nothing_. See also `foo::bar`. (note the dot there) diff --git a/tests/ui/doc/doc-fixable.rs b/tests/ui/doc/doc-fixable.rs index 3c0f6913e32..9ced2677622 100644 --- a/tests/ui/doc/doc-fixable.rs +++ b/tests/ui/doc/doc-fixable.rs @@ -3,7 +3,7 @@ #![allow(dead_code, incomplete_features)] #![warn(clippy::doc_markdown)] -#![feature(custom_inner_attributes, generic_const_exprs, const_option)] +#![feature(custom_inner_attributes, generic_const_exprs)] #![rustfmt::skip] /// The foo_bar function does _nothing_. See also foo::bar. (note the dot there) diff --git a/tests/ui/get_unwrap.fixed b/tests/ui/get_unwrap.fixed index 62beb195939..2dd3c30a4e2 100644 --- a/tests/ui/get_unwrap.fixed +++ b/tests/ui/get_unwrap.fixed @@ -70,6 +70,7 @@ fn main() { mod issue9909 { #![allow(clippy::identity_op, clippy::unwrap_used, dead_code)] + #[allow(unconditional_panic)] fn reduced() { let f = &[1, 2, 3]; diff --git a/tests/ui/get_unwrap.rs b/tests/ui/get_unwrap.rs index 1e09ff5c67e..94226564cac 100644 --- a/tests/ui/get_unwrap.rs +++ b/tests/ui/get_unwrap.rs @@ -70,6 +70,7 @@ fn main() { mod issue9909 { #![allow(clippy::identity_op, clippy::unwrap_used, dead_code)] + #[allow(unconditional_panic)] fn reduced() { let f = &[1, 2, 3]; diff --git a/tests/ui/get_unwrap.stderr b/tests/ui/get_unwrap.stderr index 0f8b279da1e..8eacb249c60 100644 --- a/tests/ui/get_unwrap.stderr +++ b/tests/ui/get_unwrap.stderr @@ -266,7 +266,7 @@ LL | let _ = some_vec.get_mut(0..1).unwrap().to_vec(); = help: consider using `expect()` to provide a better panic message error: called `.get().unwrap()` on a slice - --> tests/ui/get_unwrap.rs:77:24 + --> tests/ui/get_unwrap.rs:78:24 | LL | let _x: &i32 = f.get(1 + 2).unwrap(); | ^^^^^^^^^^^^^^^^^^^^^ @@ -277,7 +277,7 @@ LL | let _x: &i32 = &f[1 + 2]; | ~~~~~~~~~ error: called `.get().unwrap()` on a slice - --> tests/ui/get_unwrap.rs:80:18 + --> tests/ui/get_unwrap.rs:81:18 | LL | let _x = f.get(1 + 2).unwrap().to_string(); | ^^^^^^^^^^^^^^^^^^^^^ @@ -288,7 +288,7 @@ LL | let _x = f[1 + 2].to_string(); | ~~~~~~~~ error: called `.get().unwrap()` on a slice - --> tests/ui/get_unwrap.rs:83:18 + --> tests/ui/get_unwrap.rs:84:18 | LL | let _x = f.get(1 + 2).unwrap().abs(); | ^^^^^^^^^^^^^^^^^^^^^ @@ -299,7 +299,7 @@ LL | let _x = f[1 + 2].abs(); | ~~~~~~~~ error: called `.get_mut().unwrap()` on a slice - --> tests/ui/get_unwrap.rs:100:33 + --> tests/ui/get_unwrap.rs:101:33 | LL | let b = rest.get_mut(linidx(j, k) - linidx(i, k) - 1).unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/transmute_float_to_int.fixed b/tests/ui/transmute_float_to_int.fixed index 83814ca43b9..075a198918a 100644 --- a/tests/ui/transmute_float_to_int.fixed +++ b/tests/ui/transmute_float_to_int.fixed @@ -1,7 +1,7 @@ #![warn(clippy::transmute_float_to_int)] #![allow(clippy::missing_transmute_annotations)] -#![feature(f128, f128_const)] -#![feature(f16, f16_const)] +#![feature(f128)] +#![feature(f16)] fn float_to_int() { let _: u32 = unsafe { 1f32.to_bits() }; diff --git a/tests/ui/transmute_float_to_int.rs b/tests/ui/transmute_float_to_int.rs index 64d6e917203..12541b2f7cf 100644 --- a/tests/ui/transmute_float_to_int.rs +++ b/tests/ui/transmute_float_to_int.rs @@ -1,7 +1,7 @@ #![warn(clippy::transmute_float_to_int)] #![allow(clippy::missing_transmute_annotations)] -#![feature(f128, f128_const)] -#![feature(f16, f16_const)] +#![feature(f128)] +#![feature(f16)] fn float_to_int() { let _: u32 = unsafe { std::mem::transmute(1f32) }; diff --git a/tests/ui/transmutes_expressible_as_ptr_casts.fixed b/tests/ui/transmutes_expressible_as_ptr_casts.fixed index e95054a7ccb..a4a3ca82e76 100644 --- a/tests/ui/transmutes_expressible_as_ptr_casts.fixed +++ b/tests/ui/transmutes_expressible_as_ptr_casts.fixed @@ -84,8 +84,14 @@ fn issue_10449() { } // Pointers cannot be cast to integers in const contexts +#[allow( + ptr_to_integer_transmute_in_consts, + reason = "This is tested in the compiler test suite" +)] const fn issue_12402<P>(ptr: *const P) { - unsafe { transmute::<*const i32, usize>(&42i32) }; - unsafe { transmute::<fn(*const P), usize>(issue_12402) }; - let _ = unsafe { transmute::<_, usize>(ptr) }; + // This test exists even though the compiler lints against it + // to test that clippy's transmute lints do not trigger on this. + unsafe { std::mem::transmute::<*const i32, usize>(&42i32) }; + unsafe { std::mem::transmute::<fn(*const P), usize>(issue_12402) }; + let _ = unsafe { std::mem::transmute::<_, usize>(ptr) }; } diff --git a/tests/ui/transmutes_expressible_as_ptr_casts.rs b/tests/ui/transmutes_expressible_as_ptr_casts.rs index e5fcdef7a1c..6aa8e384e26 100644 --- a/tests/ui/transmutes_expressible_as_ptr_casts.rs +++ b/tests/ui/transmutes_expressible_as_ptr_casts.rs @@ -84,8 +84,14 @@ fn issue_10449() { } // Pointers cannot be cast to integers in const contexts +#[allow( + ptr_to_integer_transmute_in_consts, + reason = "This is tested in the compiler test suite" +)] const fn issue_12402<P>(ptr: *const P) { - unsafe { transmute::<*const i32, usize>(&42i32) }; - unsafe { transmute::<fn(*const P), usize>(issue_12402) }; - let _ = unsafe { transmute::<_, usize>(ptr) }; + // This test exists even though the compiler lints against it + // to test that clippy's transmute lints do not trigger on this. + unsafe { std::mem::transmute::<*const i32, usize>(&42i32) }; + unsafe { std::mem::transmute::<fn(*const P), usize>(issue_12402) }; + let _ = unsafe { std::mem::transmute::<_, usize>(ptr) }; } |
