summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/alias/object-fail.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/traits/alias/object-fail.rs')
-rw-r--r--tests/ui/traits/alias/object-fail.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/traits/alias/object-fail.rs b/tests/ui/traits/alias/object-fail.rs
new file mode 100644
index 000000000..5c753ff20
--- /dev/null
+++ b/tests/ui/traits/alias/object-fail.rs
@@ -0,0 +1,11 @@
+#![feature(trait_alias)]
+
+trait EqAlias = Eq;
+trait IteratorAlias = Iterator;
+
+fn main() {
+ let _: &dyn EqAlias = &123;
+ //~^ ERROR the trait `Eq` cannot be made into an object [E0038]
+ let _: &dyn IteratorAlias = &vec![123].into_iter();
+ //~^ ERROR must be specified
+}