summaryrefslogtreecommitdiffstats
path: root/src/test/ui/associated-types/hr-associated-type-bound-2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/associated-types/hr-associated-type-bound-2.rs')
-rw-r--r--src/test/ui/associated-types/hr-associated-type-bound-2.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/associated-types/hr-associated-type-bound-2.rs b/src/test/ui/associated-types/hr-associated-type-bound-2.rs
new file mode 100644
index 000000000..a89f61a81
--- /dev/null
+++ b/src/test/ui/associated-types/hr-associated-type-bound-2.rs
@@ -0,0 +1,20 @@
+trait X<'a>
+where
+ for<'b> <Self as X<'b>>::U: Clone,
+{
+ type U: ?Sized;
+ fn f(&self, x: &Self::U) {
+ <Self::U>::clone(x);
+ }
+}
+
+impl X<'_> for u32 //~ overflow evaluating the requirement `for<'b> u32: X<'b>`
+where
+ for<'b> <Self as X<'b>>::U: Clone,
+{
+ type U = str;
+}
+
+fn main() {
+ 1u32.f("abc");
+}