about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-07-16 19:53:59 +0200
committerGitHub <noreply@github.com>2021-07-16 19:53:59 +0200
commit8273567a710df78dac143c2500a69ecc37fe5468 (patch)
treed928fec67f99f91ea63a25ffbde7ab2e1c63eee7 /src/test
parent2119976c492894b72287f08865c71d63cff8d471 (diff)
parent587e8fd11267911599322878fb37c8d185738c9b (diff)
downloadrust-8273567a710df78dac143c2500a69ecc37fe5468.tar.gz
rust-8273567a710df78dac143c2500a69ecc37fe5468.zip
Rollup merge of #87107 - oli-obk:tait_double, r=nikomatsakis
Loop over all opaque types instead of looking at just the first one with the same DefId

This exposed a bug in VecMap and is needed for https://github.com/rust-lang/rust/pull/86410 anyway

r? ``@spastorino``

cc ``@nikomatsakis``
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-85113.rs1
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-85113.stderr14
2 files changed, 14 insertions, 1 deletions
diff --git a/src/test/ui/type-alias-impl-trait/issue-85113.rs b/src/test/ui/type-alias-impl-trait/issue-85113.rs
index b09833f3ed0..0c37399df8d 100644
--- a/src/test/ui/type-alias-impl-trait/issue-85113.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-85113.rs
@@ -12,6 +12,7 @@ trait Output<'a> {}
 impl<'a> Output<'a> for &'a str {}
 
 fn cool_fn<'a>(arg: &'a str) -> OpaqueOutputImpl<'a> {
+    //~^ ERROR: concrete type differs from previous defining opaque type use
     let out: OpaqueOutputImpl<'a> = arg;
     arg
 }
diff --git a/src/test/ui/type-alias-impl-trait/issue-85113.stderr b/src/test/ui/type-alias-impl-trait/issue-85113.stderr
index 361d66866ef..233c996340d 100644
--- a/src/test/ui/type-alias-impl-trait/issue-85113.stderr
+++ b/src/test/ui/type-alias-impl-trait/issue-85113.stderr
@@ -10,6 +10,18 @@ note: hidden type `&'<empty> str` captures lifetime smaller than the function bo
 LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
    |                             ^^^^^^^^^^^^^^^^^^^^
 
+error: concrete type differs from previous defining opaque type use
+  --> $DIR/issue-85113.rs:14:1
+   |
+LL | fn cool_fn<'a>(arg: &'a str) -> OpaqueOutputImpl<'a> {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&'<empty> str`, got `&'a str`
+   |
+note: previous use here
+  --> $DIR/issue-85113.rs:14:1
+   |
+LL | fn cool_fn<'a>(arg: &'a str) -> OpaqueOutputImpl<'a> {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
 error[E0477]: the type `&'<empty> str` does not fulfill the required lifetime
   --> $DIR/issue-85113.rs:5:29
    |
@@ -42,7 +54,7 @@ LL | type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
    = note: expected `Output<'a>`
               found `Output<'_>`
 
-error: aborting due to 3 previous errors
+error: aborting due to 4 previous errors
 
 Some errors have detailed explanations: E0477, E0495, E0700.
 For more information about an error, try `rustc --explain E0477`.