summaryrefslogtreecommitdiffstats
path: root/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.rs')
-rw-r--r--src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.rs b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.rs
new file mode 100644
index 000000000..b1f124c7e
--- /dev/null
+++ b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.rs
@@ -0,0 +1,14 @@
+// Check that we validate associated type bounds for trait objects
+
+trait X {
+ type Y: Clone;
+}
+
+fn f<T: X + ?Sized>() {
+ None::<T::Y>.clone();
+}
+
+fn main() {
+ f::<dyn X<Y = str>>();
+ //~^ ERROR the trait bound `str: Clone` is not satisfied
+}