about summary refs log tree commit diff
path: root/src/test/ui/impl-trait/issues
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-02-16 15:48:46 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-03-28 16:53:47 +0000
commit86e1860495403ee0154608e51fe4b4d81203e15f (patch)
tree12885084d27cbabcb24161ecc668b3da507f89e7 /src/test/ui/impl-trait/issues
parent3136bfef9319a40c95efc38409ad3e57d40882dd (diff)
downloadrust-86e1860495403ee0154608e51fe4b4d81203e15f.tar.gz
rust-86e1860495403ee0154608e51fe4b4d81203e15f.zip
Revert to inference variable based hidden type computation for RPIT
Diffstat (limited to 'src/test/ui/impl-trait/issues')
-rw-r--r--src/test/ui/impl-trait/issues/issue-70877.rs2
-rw-r--r--src/test/ui/impl-trait/issues/issue-70877.stderr11
-rw-r--r--src/test/ui/impl-trait/issues/issue-88236-2.rs4
-rw-r--r--src/test/ui/impl-trait/issues/issue-88236-2.stderr15
4 files changed, 20 insertions, 12 deletions
diff --git a/src/test/ui/impl-trait/issues/issue-70877.rs b/src/test/ui/impl-trait/issues/issue-70877.rs
index 1a86fa00ed1..9cbe33aef5b 100644
--- a/src/test/ui/impl-trait/issues/issue-70877.rs
+++ b/src/test/ui/impl-trait/issues/issue-70877.rs
@@ -28,7 +28,7 @@ fn ham() -> Foo {
 fn oof() -> impl std::fmt::Debug {
     let mut bar = ham();
     let func = bar.next().unwrap();
-    return func(&"oof"); //~ ERROR opaque type's hidden type cannot be another opaque type
+    return func(&"oof"); //~^^^ ERROR opaque type's hidden type cannot be another opaque type
 }
 
 fn main() {
diff --git a/src/test/ui/impl-trait/issues/issue-70877.stderr b/src/test/ui/impl-trait/issues/issue-70877.stderr
index 7cbd58bdabf..2610a198186 100644
--- a/src/test/ui/impl-trait/issues/issue-70877.stderr
+++ b/src/test/ui/impl-trait/issues/issue-70877.stderr
@@ -13,10 +13,15 @@ LL |         Some(Box::new(quux))
               found enum `Option<Box<for<'r> fn(&'r (dyn ToString + 'r)) -> FooRet {quux}>>`
 
 error: opaque type's hidden type cannot be another opaque type from the same scope
-  --> $DIR/issue-70877.rs:31:12
+  --> $DIR/issue-70877.rs:28:34
    |
-LL |     return func(&"oof");
-   |            ^^^^^^^^^^^^ one of the two opaque types used here has to be outside its defining scope
+LL |   fn oof() -> impl std::fmt::Debug {
+   |  __________________________________^
+LL | |     let mut bar = ham();
+LL | |     let func = bar.next().unwrap();
+LL | |     return func(&"oof");
+LL | | }
+   | |_^ one of the two opaque types used here has to be outside its defining scope
    |
 note: opaque type whose hidden type is being assigned
   --> $DIR/issue-70877.rs:28:13
diff --git a/src/test/ui/impl-trait/issues/issue-88236-2.rs b/src/test/ui/impl-trait/issues/issue-88236-2.rs
index f89ab7fbd36..af26a1f54c4 100644
--- a/src/test/ui/impl-trait/issues/issue-88236-2.rs
+++ b/src/test/ui/impl-trait/issues/issue-88236-2.rs
@@ -14,10 +14,10 @@ impl<'a> Hrtb<'a> for &'a () {
 
 fn make_impl() -> impl for<'a> Hrtb<'a, Assoc = impl Send + 'a> {}
 fn make_weird_impl<'b>(x: &'b ()) -> impl for<'a> Hrtb<'a, Assoc = impl Send + 'a> {
-    &() //~ ERROR implementation of `Hrtb` is not general enough
+    &() //~^ ERROR implementation of `Hrtb` is not general enough
 }
 fn make_bad_impl<'b>(x: &'b ()) -> impl for<'a> Hrtb<'a, Assoc = impl Send + 'a> {
-    x //~ ERROR implementation of `Hrtb` is not general enough
+    x //~^ ERROR implementation of `Hrtb` is not general enough
 }
 
 fn main() {}
diff --git a/src/test/ui/impl-trait/issues/issue-88236-2.stderr b/src/test/ui/impl-trait/issues/issue-88236-2.stderr
index 95c4a528036..45fadcab3f2 100644
--- a/src/test/ui/impl-trait/issues/issue-88236-2.stderr
+++ b/src/test/ui/impl-trait/issues/issue-88236-2.stderr
@@ -1,17 +1,20 @@
 error: implementation of `Hrtb` is not general enough
-  --> $DIR/issue-88236-2.rs:17:5
+  --> $DIR/issue-88236-2.rs:16:38
    |
-LL |     &()
-   |     ^^^ implementation of `Hrtb` is not general enough
+LL | fn make_weird_impl<'b>(x: &'b ()) -> impl for<'a> Hrtb<'a, Assoc = impl Send + 'a> {
+   |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Hrtb` is not general enough
    |
    = note: `Hrtb<'0>` would have to be implemented for the type `&()`, for any lifetime `'0`...
    = note: ...but `Hrtb<'1>` is actually implemented for the type `&'1 ()`, for some specific lifetime `'1`
 
 error: implementation of `Hrtb` is not general enough
-  --> $DIR/issue-88236-2.rs:20:5
+  --> $DIR/issue-88236-2.rs:19:82
    |
-LL |     x
-   |     ^ implementation of `Hrtb` is not general enough
+LL |   fn make_bad_impl<'b>(x: &'b ()) -> impl for<'a> Hrtb<'a, Assoc = impl Send + 'a> {
+   |  __________________________________________________________________________________^
+LL | |     x
+LL | | }
+   | |_^ implementation of `Hrtb` is not general enough
    |
    = note: `&()` must implement `Hrtb<'0>`, for any lifetime `'0`...
    = note: ...but `Hrtb<'_>` is actually implemented for the type `&()`