summaryrefslogtreecommitdiffstats
path: root/src/test/ui/traits/impl-can-not-have-untraitful-items.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/traits/impl-can-not-have-untraitful-items.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/traits/impl-can-not-have-untraitful-items.rs b/src/test/ui/traits/impl-can-not-have-untraitful-items.rs
new file mode 100644
index 000000000..0c885447b
--- /dev/null
+++ b/src/test/ui/traits/impl-can-not-have-untraitful-items.rs
@@ -0,0 +1,9 @@
+trait A { }
+
+impl A for isize {
+ const BAR: () = (); //~ ERROR const `BAR` is not a member of trait `A`
+ type Baz = (); //~ ERROR type `Baz` is not a member of trait `A`
+ fn foo(&self) { } //~ ERROR method `foo` is not a member of trait `A`
+}
+
+fn main() { }