summaryrefslogtreecommitdiffstats
path: root/src/test/ui/incoherent-inherent-impls/no-attr-empty-impl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/incoherent-inherent-impls/no-attr-empty-impl.rs')
-rw-r--r--src/test/ui/incoherent-inherent-impls/no-attr-empty-impl.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/incoherent-inherent-impls/no-attr-empty-impl.rs b/src/test/ui/incoherent-inherent-impls/no-attr-empty-impl.rs
new file mode 100644
index 000000000..62c249e58
--- /dev/null
+++ b/src/test/ui/incoherent-inherent-impls/no-attr-empty-impl.rs
@@ -0,0 +1,18 @@
+// aux-build:extern-crate.rs
+extern crate extern_crate;
+
+impl extern_crate::StructWithAttr {}
+//~^ ERROR cannot define inherent `impl` for a type outside of the crate
+
+impl extern_crate::StructNoAttr {}
+//~^ ERROR cannot define inherent `impl` for a type outside of the crate
+
+impl extern_crate::EnumWithAttr {}
+//~^ ERROR cannot define inherent `impl` for a type outside of the crate
+
+impl extern_crate::EnumNoAttr {}
+//~^ ERROR cannot define inherent `impl` for a type outside of the crate
+
+impl f32 {} //~ ERROR cannot define inherent `impl` for primitive types
+
+fn main() {}