summaryrefslogtreecommitdiffstats
path: root/src/test/ui/object-safety/object-safety-supertrait-mentions-GAT.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/object-safety/object-safety-supertrait-mentions-GAT.rs')
-rw-r--r--src/test/ui/object-safety/object-safety-supertrait-mentions-GAT.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/object-safety/object-safety-supertrait-mentions-GAT.rs b/src/test/ui/object-safety/object-safety-supertrait-mentions-GAT.rs
new file mode 100644
index 000000000..14e00d2ef
--- /dev/null
+++ b/src/test/ui/object-safety/object-safety-supertrait-mentions-GAT.rs
@@ -0,0 +1,15 @@
+//~ ERROR the parameter type `Self` may not live long enough
+
+trait GatTrait {
+ type Gat<'a>
+ where
+ Self: 'a;
+}
+
+trait SuperTrait<T>: for<'a> GatTrait<Gat<'a> = T> {
+ fn c(&self) -> dyn SuperTrait<T>;
+ //~^ ERROR associated item referring to unboxed trait object for its own trait
+ //~| ERROR the trait `SuperTrait` cannot be made into an object
+}
+
+fn main() {}