]> git.lizzy.rs Git - rust.git/commitdiff
Add note for E0117
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Wed, 25 Jan 2017 22:28:59 +0000 (23:28 +0100)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Thu, 26 Jan 2017 11:09:31 +0000 (12:09 +0100)
src/librustc_typeck/coherence/orphan.rs
src/test/compile-fail/E0117.rs
src/test/compile-fail/E0206.rs
src/test/compile-fail/coherence-impls-copy.rs

index 2b5a4515cd0d8d63c576253a3f3e9ad57e87d10d..c54f467a4c41f842aab9ee760b9cd465a6dd7023 100644 (file)
@@ -263,6 +263,7 @@ fn visit_item(&mut self, item: &hir::Item) {
                             .span_label(item.span, &format!("impl doesn't use types inside crate"))
                             .note(&format!("the impl does not reference any types defined in \
                                             this crate"))
+                            .note("define and implement a trait or new type instead")
                             .emit();
                         return;
                     }
index e9375e673253fb863edb4135df4256446645d4ec..4ba9c3382f35d4792219ac0f5b54f559eefcaf6d 100644 (file)
@@ -11,6 +11,7 @@
 impl Drop for u32 {} //~ ERROR E0117
 //~^ NOTE impl doesn't use types inside crate
 //~| NOTE the impl does not reference any types defined in this crate
+//~| NOTE define and implement a trait or new type instead
 
 fn main() {
 }
index 888e42ed3a18cea72870207b7b9cbc459fea7417..1131e8e1b01cae69a1c19043442f149ce935e3c7 100644 (file)
@@ -16,6 +16,7 @@ impl Copy for Foo { }
 //~| ERROR only traits defined in the current crate can be implemented for arbitrary types
 //~| NOTE impl doesn't use types inside crate
 //~| NOTE the impl does not reference any types defined in this crate
+//~| NOTE define and implement a trait or new type instead
 
 #[derive(Copy, Clone)]
 struct Bar;
index f686a146042cee4351a2c1874605d7a3ab7e000a..fe121a3bc48ffbaac5a6f07e5b7eedbed60f4bb3 100644 (file)
@@ -37,6 +37,7 @@ impl Copy for (MyType, MyType) {}
 //~| ERROR only traits defined in the current crate can be implemented for arbitrary types
 //~| NOTE impl doesn't use types inside crate
 //~| NOTE the impl does not reference any types defined in this crate
+//~| NOTE define and implement a trait or new type instead
 
 impl Copy for &'static NotSync {}
 //~^ ERROR the trait `Copy` may not be implemented for this type
@@ -46,8 +47,9 @@ impl Copy for [MyType] {}
 //~^ ERROR the trait `Copy` may not be implemented for this type
 //~| NOTE type is not a structure or enumeration
 //~| ERROR only traits defined in the current crate can be implemented for arbitrary types
-//~| NOTE impl doesn't use types inside crate
 //~| NOTE the impl does not reference any types defined in this crate
+//~| NOTE define and implement a trait or new type instead
+//~| NOTE impl doesn't use types inside crate
 
 impl Copy for &'static [NotSync] {}
 //~^ ERROR the trait `Copy` may not be implemented for this type
@@ -55,6 +57,7 @@ impl Copy for &'static [NotSync] {}
 //~| ERROR only traits defined in the current crate can be implemented for arbitrary types
 //~| NOTE impl doesn't use types inside crate
 //~| NOTE the impl does not reference any types defined in this crate
+//~| NOTE define and implement a trait or new type instead
 
 fn main() {
 }