]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/associated-types/defaults-unsound-62211-2.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / associated-types / defaults-unsound-62211-2.rs
index 5518cda37087cd44aeb415d3479b77ccae4a99a0..c13ec776afe2bd15b79f6267900770e1f8556d29 100644 (file)
 
 use std::{
     fmt::Display,
-    ops::{AddAssign, Deref}
+    ops::{AddAssign, Deref},
 };
 
-
 trait UncheckedCopy: Sized {
     // This Output is said to be Copy. Yet we default to Self
     // and it's accepted, not knowing if Self ineed is Copy
-    type Output: Copy
+    type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
     //~^ ERROR the trait bound `Self: Copy` is not satisfied
-    + Deref<Target = str>
-    //~^ ERROR the trait bound `Self: Deref` is not satisfied
-    + AddAssign<&'static str>
-    //~^ ERROR cannot add-assign `&'static str` to `Self`
-    + From<Self>
-    + Display = Self;
-    //~^ ERROR `Self` doesn't implement `std::fmt::Display`
+    //~| ERROR the trait bound `Self: Deref` is not satisfied
+    //~| ERROR cannot add-assign `&'static str` to `Self`
+    //~| ERROR `Self` doesn't implement `std::fmt::Display`
 
     // We said the Output type was Copy, so we can Copy it freely!
     fn unchecked_copy(other: &Self::Output) -> Self::Output {
@@ -39,10 +34,6 @@ trait UncheckedCopy: Sized {
 }
 
 impl<T> UncheckedCopy for T {}
-//~^ ERROR `T` doesn't implement `std::fmt::Display`
-//~| ERROR the trait bound `T: Deref` is not satisfied
-//~| ERROR cannot add-assign `&'static str` to `T`
-//~| ERROR the trait bound `T: Copy` is not satisfied
 
 fn bug<T: UncheckedCopy>(origin: T) {
     let origin = T::make_origin(origin);