summaryrefslogtreecommitdiffstats
path: root/src/test/ui/mismatched_types/issue-36053-2.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/mismatched_types/issue-36053-2.stderr
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/mismatched_types/issue-36053-2.stderr')
-rw-r--r--src/test/ui/mismatched_types/issue-36053-2.stderr42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/test/ui/mismatched_types/issue-36053-2.stderr b/src/test/ui/mismatched_types/issue-36053-2.stderr
new file mode 100644
index 000000000..b11ea97d1
--- /dev/null
+++ b/src/test/ui/mismatched_types/issue-36053-2.stderr
@@ -0,0 +1,42 @@
+error[E0631]: type mismatch in closure arguments
+ --> $DIR/issue-36053-2.rs:7:32
+ |
+LL | once::<&str>("str").fuse().filter(|a: &str| true).count();
+ | ^^^^^^ --------- found signature defined here
+ | |
+ | expected due to this
+ |
+ = note: expected closure signature `for<'r> fn(&'r &str) -> _`
+ found closure signature `for<'r> fn(&'r str) -> _`
+note: required by a bound in `filter`
+ --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
+ |
+LL | P: FnMut(&Self::Item) -> bool,
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `filter`
+
+error[E0599]: the method `count` exists for struct `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>`, but its trait bounds were not satisfied
+ --> $DIR/issue-36053-2.rs:7:55
+ |
+LL | once::<&str>("str").fuse().filter(|a: &str| true).count();
+ | --------- ^^^^^ method cannot be called on `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>` due to unsatisfied trait bounds
+ | |
+ | doesn't satisfy `<_ as FnOnce<(&&str,)>>::Output = bool`
+ | doesn't satisfy `_: FnMut<(&&str,)>`
+ |
+ ::: $SRC_DIR/core/src/iter/adapters/filter.rs:LL:COL
+ |
+LL | pub struct Filter<I, P> {
+ | ----------------------- doesn't satisfy `_: Iterator`
+ |
+ = note: the following trait bounds were not satisfied:
+ `<[closure@$DIR/issue-36053-2.rs:7:39: 7:48] as FnOnce<(&&str,)>>::Output = bool`
+ which is required by `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>: Iterator`
+ `[closure@$DIR/issue-36053-2.rs:7:39: 7:48]: FnMut<(&&str,)>`
+ which is required by `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>: Iterator`
+ `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>: Iterator`
+ which is required by `&mut Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>: Iterator`
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0599, E0631.
+For more information about an error, try `rustc --explain E0599`.