about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-11-14 01:06:05 +0000
committerbors <bors@rust-lang.org>2021-11-14 01:06:05 +0000
commit589ad6a5b7328867d08cbd16863e7f49e720f4d7 (patch)
tree93eac15d9196c6546d051baaf46c52d2fb4e5ff8 /src/test/ui
parentb416e3892d9526709f3a248f5ed3a43a970f795e (diff)
parentc677a8da86e8bc5fb2a2c0fec54e0e71c2caca97 (diff)
downloadrust-589ad6a5b7328867d08cbd16863e7f49e720f4d7.tar.gz
rust-589ad6a5b7328867d08cbd16863e7f49e720f4d7.zip
Auto merge of #90883 - matthiaskrgr:rollup-iu9k5pe, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #90771 (Fix trait object error code)
 - #90840 (relate lifetime in `TypeOutlives` bounds on drop impls)
 - #90853 (rustdoc: Use an empty Vec instead of Option<Vec>)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/dropck/relate_lt_in_type_outlives_bound.rs13
-rw-r--r--src/test/ui/dropck/relate_lt_in_type_outlives_bound.stderr17
-rw-r--r--src/test/ui/editions/dyn-trait-sugg-2021.stderr4
3 files changed, 32 insertions, 2 deletions
diff --git a/src/test/ui/dropck/relate_lt_in_type_outlives_bound.rs b/src/test/ui/dropck/relate_lt_in_type_outlives_bound.rs
new file mode 100644
index 00000000000..42530d31730
--- /dev/null
+++ b/src/test/ui/dropck/relate_lt_in_type_outlives_bound.rs
@@ -0,0 +1,13 @@
+struct Wrapper<'a, T>(&'a T)
+where
+    T: 'a;
+
+impl<'a, T> Drop for Wrapper<'a, T>
+where
+    T: 'static,
+    //~^ error: `Drop` impl requires `T: 'static` but the struct it is implemented for does not
+{
+    fn drop(&mut self) {}
+}
+
+fn main() {}
diff --git a/src/test/ui/dropck/relate_lt_in_type_outlives_bound.stderr b/src/test/ui/dropck/relate_lt_in_type_outlives_bound.stderr
new file mode 100644
index 00000000000..5176684e153
--- /dev/null
+++ b/src/test/ui/dropck/relate_lt_in_type_outlives_bound.stderr
@@ -0,0 +1,17 @@
+error[E0367]: `Drop` impl requires `T: 'static` but the struct it is implemented for does not
+  --> $DIR/relate_lt_in_type_outlives_bound.rs:7:8
+   |
+LL |     T: 'static,
+   |        ^^^^^^^
+   |
+note: the implementor must specify the same requirement
+  --> $DIR/relate_lt_in_type_outlives_bound.rs:1:1
+   |
+LL | / struct Wrapper<'a, T>(&'a T)
+LL | | where
+LL | |     T: 'a;
+   | |__________^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0367`.
diff --git a/src/test/ui/editions/dyn-trait-sugg-2021.stderr b/src/test/ui/editions/dyn-trait-sugg-2021.stderr
index f6e9fa96a15..a7119b073ab 100644
--- a/src/test/ui/editions/dyn-trait-sugg-2021.stderr
+++ b/src/test/ui/editions/dyn-trait-sugg-2021.stderr
@@ -1,4 +1,4 @@
-error[E0783]: trait objects without an explicit `dyn` are deprecated
+error[E0782]: trait objects without an explicit `dyn` are deprecated
   --> $DIR/dyn-trait-sugg-2021.rs:10:5
    |
 LL |     Foo::hi(123);
@@ -6,4 +6,4 @@ LL |     Foo::hi(123);
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0783`.
+For more information about this error, try `rustc --explain E0782`.