diff options
Diffstat (limited to 'tests/ui/incoherent-inherent-impls/needs-has-incoherent-impls.rs')
-rw-r--r-- | tests/ui/incoherent-inherent-impls/needs-has-incoherent-impls.rs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/ui/incoherent-inherent-impls/needs-has-incoherent-impls.rs b/tests/ui/incoherent-inherent-impls/needs-has-incoherent-impls.rs new file mode 100644 index 000000000..0f7282bec --- /dev/null +++ b/tests/ui/incoherent-inherent-impls/needs-has-incoherent-impls.rs @@ -0,0 +1,40 @@ +// aux-build:extern-crate.rs +#![feature(rustc_attrs)] +extern crate extern_crate; + +impl extern_crate::StructWithAttr { + //~^ ERROR cannot define inherent `impl` for a type outside of the crate + fn foo() {} +} +impl extern_crate::StructWithAttr { + #[rustc_allow_incoherent_impl] + fn bar() {} +} +impl extern_crate::StructNoAttr { + //~^ ERROR cannot define inherent `impl` for a type outside of the crate + fn foo() {} +} +impl extern_crate::StructNoAttr { + //~^ ERROR cannot define inherent `impl` for a type outside of the crate + #[rustc_allow_incoherent_impl] + fn bar() {} +} +impl extern_crate::EnumWithAttr { + //~^ ERROR cannot define inherent `impl` for a type outside of the crate + fn foo() {} +} +impl extern_crate::EnumWithAttr { + #[rustc_allow_incoherent_impl] + fn bar() {} +} +impl extern_crate::EnumNoAttr { + //~^ ERROR cannot define inherent `impl` for a type outside of the crate + fn foo() {} +} +impl extern_crate::EnumNoAttr { + //~^ ERROR cannot define inherent `impl` for a type outside of the crate + #[rustc_allow_incoherent_impl] + fn bar() {} +} + +fn main() {} |