summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/trait-hidden-method.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:41 +0000
commit4f9fe856a25ab29345b90e7725509e9ee38a37be (patch)
treee4ffd8a9374cae7b21f7cbfb352927e0e074aff6 /tests/ui/suggestions/trait-hidden-method.stderr
parentAdding upstream version 1.68.2+dfsg1. (diff)
downloadrustc-upstream/1.69.0+dfsg1.tar.xz
rustc-upstream/1.69.0+dfsg1.zip
Adding upstream version 1.69.0+dfsg1.upstream/1.69.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tests/ui/suggestions/trait-hidden-method.stderr24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/suggestions/trait-hidden-method.stderr b/tests/ui/suggestions/trait-hidden-method.stderr
new file mode 100644
index 000000000..a5a65d193
--- /dev/null
+++ b/tests/ui/suggestions/trait-hidden-method.stderr
@@ -0,0 +1,24 @@
+error[E0191]: the value of the associated type `Item` (from trait `Iterator`) must be specified
+ --> $DIR/trait-hidden-method.rs:6:33
+ |
+LL | Box::new(1..=10) as Box<dyn Iterator>
+ | ^^^^^^^^ help: specify the associated type: `Iterator<Item = Type>`
+
+error[E0271]: expected `Box<dyn Iterator>` to be an iterator that yields `u32`, but it yields `<dyn Iterator as Iterator>::Item`
+ --> $DIR/trait-hidden-method.rs:3:32
+ |
+LL | pub fn i_can_has_iterator() -> impl Iterator<Item = u32> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected associated type, found `u32`
+...
+LL | Box::new(1..=10) as Box<dyn Iterator>
+ | ------------------------------------- return type was inferred to be `Box<dyn Iterator>` here
+ |
+ = note: expected associated type `<dyn Iterator as Iterator>::Item`
+ found type `u32`
+ = help: consider constraining the associated type `<dyn Iterator as Iterator>::Item` to `u32` or calling a method that returns `<dyn Iterator as Iterator>::Item`
+ = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0191, E0271.
+For more information about an error, try `rustc --explain E0191`.