diff options
| author | Ben Kimock <kimockb@gmail.com> | 2024-07-24 19:12:50 -0400 |
|---|---|---|
| committer | Ben Kimock <kimockb@gmail.com> | 2024-07-25 15:14:42 -0400 |
| commit | a7d57aa7c8f42dda6d33e0ac349cf834eaf041b8 (patch) | |
| tree | 2ec95ebff75de2ac0d843ac244c12ab660baa0b2 /tests/ui/lang-items | |
| parent | 92c6c03805408a1a261b98013304e9bbf59ee428 (diff) | |
| download | rust-a7d57aa7c8f42dda6d33e0ac349cf834eaf041b8.tar.gz rust-a7d57aa7c8f42dda6d33e0ac349cf834eaf041b8.zip | |
Let InstCombine remove Clone shims inside Clone shims
Co-authored-by: scottmcm <scottmcm@users.noreply.github.com>
Diffstat (limited to 'tests/ui/lang-items')
| -rw-r--r-- | tests/ui/lang-items/missing-clone-for-suggestion.rs | 20 | ||||
| -rw-r--r-- | tests/ui/lang-items/missing-clone-for-suggestion.stderr | 21 |
2 files changed, 0 insertions, 41 deletions
diff --git a/tests/ui/lang-items/missing-clone-for-suggestion.rs b/tests/ui/lang-items/missing-clone-for-suggestion.rs deleted file mode 100644 index e8290c0098a..00000000000 --- a/tests/ui/lang-items/missing-clone-for-suggestion.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Avoid panicking if the Clone trait is not found while building error suggestions -// See #104870 - -#![feature(no_core, lang_items)] -#![no_core] - -#[lang = "sized"] -trait Sized {} - -#[lang = "copy"] -trait Copy {} - -fn g<T>(x: T) {} - -fn f(x: *mut u8) { - g(x); - g(x); //~ ERROR use of moved value: `x` -} - -fn main() {} diff --git a/tests/ui/lang-items/missing-clone-for-suggestion.stderr b/tests/ui/lang-items/missing-clone-for-suggestion.stderr deleted file mode 100644 index 0187f965b5c..00000000000 --- a/tests/ui/lang-items/missing-clone-for-suggestion.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0382]: use of moved value: `x` - --> $DIR/missing-clone-for-suggestion.rs:17:7 - | -LL | fn f(x: *mut u8) { - | - move occurs because `x` has type `*mut u8`, which does not implement the `Copy` trait -LL | g(x); - | - value moved here -LL | g(x); - | ^ value used here after move - | -note: consider changing this parameter type in function `g` to borrow instead if owning the value isn't necessary - --> $DIR/missing-clone-for-suggestion.rs:13:12 - | -LL | fn g<T>(x: T) {} - | - ^ this parameter takes ownership of the value - | | - | in this function - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0382`. |
