about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-04-13 09:22:24 +0000
committerbors <bors@rust-lang.org>2023-04-13 09:22:24 +0000
commitfab99073b01539ce2664366011c7f3e378e52b7e (patch)
tree7530fca909abbf5fb61655c627bd66e20f083fbc /tests
parentd37e2f74afd131cda7b08520d37426bfbb622b5c (diff)
parentb14730f667a1fb1bd248d00177a36e5a84691d99 (diff)
downloadrust-fab99073b01539ce2664366011c7f3e378e52b7e.tar.gz
rust-fab99073b01539ce2664366011c7f3e378e52b7e.zip
Auto merge of #110275 - matthiaskrgr:rollup-8ntb3o5, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #110072 (Stabilize IsTerminal)
 - #110195 (Erase lifetimes above `ty::INNERMOST` when probing ambiguous types)
 - #110218 (Remove `ToRegionVid`)
 - #110220 (cleanup our region error API)
 - #110234 (Fix btree `CursorMut::insert_after` check)
 - #110262 (Update unwind_safe.rs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/traits/non_lifetime_binders/missing-assoc-item.stderr7
-rw-r--r--tests/ui/typeck/issue-110052.rs12
-rw-r--r--tests/ui/typeck/issue-110052.stderr9
3 files changed, 27 insertions, 1 deletions
diff --git a/tests/ui/traits/non_lifetime_binders/missing-assoc-item.stderr b/tests/ui/traits/non_lifetime_binders/missing-assoc-item.stderr
index be6955c111e..d985386423d 100644
--- a/tests/ui/traits/non_lifetime_binders/missing-assoc-item.stderr
+++ b/tests/ui/traits/non_lifetime_binders/missing-assoc-item.stderr
@@ -11,7 +11,12 @@ error[E0223]: ambiguous associated type
   --> $DIR/missing-assoc-item.rs:6:12
    |
 LL |     for<B> B::Item: Send,
-   |            ^^^^^^^ help: use the fully-qualified path: `<B as IntoIterator>::Item`
+   |            ^^^^^^^
+   |
+help: if there were a trait named `Example` with associated type `Item` implemented for `B`, you could use the fully-qualified path
+   |
+LL |     for<B> <B as Example>::Item: Send,
+   |            ~~~~~~~~~~~~~~~~~~~~
 
 error: aborting due to previous error; 1 warning emitted
 
diff --git a/tests/ui/typeck/issue-110052.rs b/tests/ui/typeck/issue-110052.rs
new file mode 100644
index 00000000000..f124b58b5b6
--- /dev/null
+++ b/tests/ui/typeck/issue-110052.rs
@@ -0,0 +1,12 @@
+// Makes sure we deal with escaping lifetimes *above* INNERMOST when
+// suggesting trait for ambiguous associated type.
+
+impl<I, V> Validator<I> for ()
+where
+    for<'iter> dyn Validator<<&'iter I>::Item>:,
+    //~^ ERROR ambiguous associated type
+{}
+
+pub trait Validator<T> {}
+
+fn main() {}
diff --git a/tests/ui/typeck/issue-110052.stderr b/tests/ui/typeck/issue-110052.stderr
new file mode 100644
index 00000000000..0c15c03a740
--- /dev/null
+++ b/tests/ui/typeck/issue-110052.stderr
@@ -0,0 +1,9 @@
+error[E0223]: ambiguous associated type
+  --> $DIR/issue-110052.rs:6:30
+   |
+LL |     for<'iter> dyn Validator<<&'iter I>::Item>:,
+   |                              ^^^^^^^^^^^^^^^^ help: use the fully-qualified path: `<&'iter I as IntoIterator>::Item`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0223`.