diff options
| author | r0cky <mu001999@outlook.com> | 2024-05-23 09:06:43 +0800 |
|---|---|---|
| committer | r0cky <mu001999@outlook.com> | 2024-05-23 09:07:59 +0800 |
| commit | 96968350e17efdbb9958dbeaec4982d8cca0019d (patch) | |
| tree | ea451a306d6e0743b057f842814c796f635d220c /tests/ui/rust-2021 | |
| parent | 9cdfe285ca724c801dc9f78d22b24ea69b787f26 (diff) | |
| download | rust-96968350e17efdbb9958dbeaec4982d8cca0019d.tar.gz rust-96968350e17efdbb9958dbeaec4982d8cca0019d.zip | |
Detect unused structs which implement private traits
Diffstat (limited to 'tests/ui/rust-2021')
| -rw-r--r-- | tests/ui/rust-2021/inherent-dyn-collision.fixed | 1 | ||||
| -rw-r--r-- | tests/ui/rust-2021/inherent-dyn-collision.rs | 1 | ||||
| -rw-r--r-- | tests/ui/rust-2021/inherent-dyn-collision.stderr | 2 |
3 files changed, 3 insertions, 1 deletions
diff --git a/tests/ui/rust-2021/inherent-dyn-collision.fixed b/tests/ui/rust-2021/inherent-dyn-collision.fixed index f5702613af0..8fe1bf811db 100644 --- a/tests/ui/rust-2021/inherent-dyn-collision.fixed +++ b/tests/ui/rust-2021/inherent-dyn-collision.fixed @@ -25,6 +25,7 @@ mod inner { // having a struct of the same name as the trait in-scope, while *also* // implementing the trait for that struct but **without** importing the // trait itself into scope + #[allow(dead_code)] struct TryIntoU32; impl super::TryIntoU32 for TryIntoU32 { diff --git a/tests/ui/rust-2021/inherent-dyn-collision.rs b/tests/ui/rust-2021/inherent-dyn-collision.rs index 0bcb34e5708..47c84462419 100644 --- a/tests/ui/rust-2021/inherent-dyn-collision.rs +++ b/tests/ui/rust-2021/inherent-dyn-collision.rs @@ -25,6 +25,7 @@ mod inner { // having a struct of the same name as the trait in-scope, while *also* // implementing the trait for that struct but **without** importing the // trait itself into scope + #[allow(dead_code)] struct TryIntoU32; impl super::TryIntoU32 for TryIntoU32 { diff --git a/tests/ui/rust-2021/inherent-dyn-collision.stderr b/tests/ui/rust-2021/inherent-dyn-collision.stderr index f5905574ac3..d9e720dd9af 100644 --- a/tests/ui/rust-2021/inherent-dyn-collision.stderr +++ b/tests/ui/rust-2021/inherent-dyn-collision.stderr @@ -1,5 +1,5 @@ warning: trait method `try_into` will become ambiguous in Rust 2021 - --> $DIR/inherent-dyn-collision.rs:41:9 + --> $DIR/inherent-dyn-collision.rs:42:9 | LL | get_dyn_trait().try_into().unwrap() | ^^^^^^^^^^^^^^^ help: disambiguate the method call: `(&*get_dyn_trait())` |
