about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorjackh726 <jack.huey@umassmed.edu>2021-10-08 12:09:34 -0400
committerjackh726 <jack.huey@umassmed.edu>2021-10-16 19:04:39 -0400
commita8c44d344b4b416f119c0b24bb3cb3899b2f5ab1 (patch)
treefc73b1c5a23c8895eca84d21e5cc8cc43def49e8 /src/test
parent0bc340f7564a7a046b3acaa69d6aa1653ed27d66 (diff)
Some cleanup
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/generic-associated-types/self-outlives-lint.rs55
-rw-r--r--src/test/ui/generic-associated-types/self-outlives-lint.stderr56
2 files changed, 111 insertions, 0 deletions
diff --git a/src/test/ui/generic-associated-types/self-outlives-lint.rs b/src/test/ui/generic-associated-types/self-outlives-lint.rs
index 43870a88479..92ac1a4249e 100644
--- a/src/test/ui/generic-associated-types/self-outlives-lint.rs
+++ b/src/test/ui/generic-associated-types/self-outlives-lint.rs
@@ -4,6 +4,7 @@
 
 trait Iterable {
     type Item<'x>;
+    //~^ Missing bound
     fn iter<'a>(&'a self) -> Self::Item<'a>;
 }
 
@@ -18,6 +19,7 @@ impl<T> Iterable for T {
 
 trait Deserializer<T> {
     type Out<'x>;
+    //~^ Missing bound
     fn deserialize<'a>(&self, input: &'a T) -> Self::Out<'a>;
 }
 
@@ -30,12 +32,65 @@ impl<T> Deserializer<T> for () {
 
 trait Deserializer2<T> {
     type Out<'x>;
+    //~^ Missing bound
     fn deserialize2<'a, 'b: 'a>(&self, input: &'a T, input2: &'b T) -> Self::Out<'a>;
 }
 
 trait Deserializer3<T, U> {
     type Out<'x, 'y>;
+    //~^ Missing bound
+    //~^^ Missing bound
     fn deserialize2<'a, 'b>(&self, input: &'a T, input2: &'b U) -> Self::Out<'a, 'b>;
 }
 
+trait Deserializer4 {
+    type Out<'x>;
+    //~^ Missing bound
+    fn deserialize<'a, T>(&self, input: &'a T) -> Self::Out<'a>;
+}
+
+struct Wrap<T>(T);
+
+trait Des {
+    type Out<'x, D>;
+    //~^ Missing bound
+    fn des<'z, T>(&self, data: &'z Wrap<T>) -> Self::Out<'z, Wrap<T>>;
+}
+/*
+impl Des for () {
+    type Out<'x, D> = &'x D;
+    fn des<'a, T>(&self, data: &'a Wrap<T>) -> Self::Out<'a, Wrap<T>> {
+        data
+    }
+}
+*/
+
+trait Des2 {
+    type Out<'x, D>;
+    //~^ Missing bound
+    fn des<'z, T>(&self, data: &'z Wrap<T>) -> Self::Out<'z, T>;
+}
+/*
+impl Des2 for () {
+    type Out<'x, D> = &'x D;
+    fn des<'a, T>(&self, data: &'a Wrap<T>) -> Self::Out<'a, T> {
+        data
+    }
+}
+*/
+
+trait Des3 {
+    type Out<'x, D>;
+    //~^ Missing bound
+    fn des<'z, T>(&self, data: &'z T) -> Self::Out<'z, T>;
+}
+/*
+impl Des3 for () {
+    type Out<'x, D> = &'x D;
+    fn des<'a, T>(&self, data: &'a T) -> Self::Out<'a, T> {
+          data
+    }
+}
+*/
+  
 fn main() {}
diff --git a/src/test/ui/generic-associated-types/self-outlives-lint.stderr b/src/test/ui/generic-associated-types/self-outlives-lint.stderr
new file mode 100644
index 00000000000..3fb41335495
--- /dev/null
+++ b/src/test/ui/generic-associated-types/self-outlives-lint.stderr
@@ -0,0 +1,56 @@
+error: Missing bound: Self: 'x
+  --> $DIR/self-outlives-lint.rs:6:14
+   |
+LL |     type Item<'x>;
+   |              ^^^^
+
+error: Missing bound: T: 'x
+  --> $DIR/self-outlives-lint.rs:21:13
+   |
+LL |     type Out<'x>;
+   |             ^^^^
+
+error: Missing bound: T: 'x
+  --> $DIR/self-outlives-lint.rs:34:13
+   |
+LL |     type Out<'x>;
+   |             ^^^^
+
+error: Missing bound: T: 'x
+  --> $DIR/self-outlives-lint.rs:40:13
+   |
+LL |     type Out<'x, 'y>;
+   |             ^^^^^^^^
+
+error: Missing bound: U: 'y
+  --> $DIR/self-outlives-lint.rs:40:13
+   |
+LL |     type Out<'x, 'y>;
+   |             ^^^^^^^^
+
+error: Missing bound: T: 'x
+  --> $DIR/self-outlives-lint.rs:47:13
+   |
+LL |     type Out<'x>;
+   |             ^^^^
+
+error: Missing bound: T: 'x
+  --> $DIR/self-outlives-lint.rs:55:13
+   |
+LL |     type Out<'x, D>;
+   |             ^^^^^^^
+
+error: Missing bound: T: 'x
+  --> $DIR/self-outlives-lint.rs:69:13
+   |
+LL |     type Out<'x, D>;
+   |             ^^^^^^^
+
+error: Missing bound: T: 'x
+  --> $DIR/self-outlives-lint.rs:83:13
+   |
+LL |     type Out<'x, D>;
+   |             ^^^^^^^
+
+error: aborting due to 9 previous errors
+