mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Rollup merge of #39306 - GuillaumeGomez:newtype_help, r=eddyb
Add note for E0117 Fixes #39249. I just applied the suggestion of @durka since I don't see anything else to add.
This commit is contained in:
commit
13e3b36f68
@ -263,6 +263,7 @@ impl<'cx, 'tcx, 'v> ItemLikeVisitor<'v> for OrphanChecker<'cx, 'tcx> {
|
||||
.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;
|
||||
}
|
||||
|
@ -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() {
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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() {
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user