diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/fn/fn-trait-formatting.stderr | |
parent | Initial commit. (diff) | |
download | rustc-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/fn/fn-trait-formatting.stderr')
-rw-r--r-- | src/test/ui/fn/fn-trait-formatting.stderr | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/test/ui/fn/fn-trait-formatting.stderr b/src/test/ui/fn/fn-trait-formatting.stderr new file mode 100644 index 000000000..ea88e401b --- /dev/null +++ b/src/test/ui/fn/fn-trait-formatting.stderr @@ -0,0 +1,52 @@ +error[E0308]: mismatched types + --> $DIR/fn-trait-formatting.rs:6:17 + | +LL | let _: () = Box::new(|_: isize| {}) as Box<dyn FnOnce(isize)>; + | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `Box` + | | + | expected due to this + | + = note: expected unit type `()` + found struct `Box<dyn FnOnce(isize)>` + +error[E0308]: mismatched types + --> $DIR/fn-trait-formatting.rs:10:17 + | +LL | let _: () = Box::new(|_: isize, isize| {}) as Box<dyn Fn(isize, isize)>; + | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `Box` + | | + | expected due to this + | + = note: expected unit type `()` + found struct `Box<dyn Fn(isize, isize)>` + +error[E0308]: mismatched types + --> $DIR/fn-trait-formatting.rs:14:17 + | +LL | let _: () = Box::new(|| -> isize { unimplemented!() }) as Box<dyn FnMut() -> isize>; + | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found struct `Box` + | | + | expected due to this + | + = note: expected unit type `()` + found struct `Box<dyn FnMut() -> isize>` + +error[E0277]: expected a `Fn<(isize,)>` closure, found `{integer}` + --> $DIR/fn-trait-formatting.rs:19:14 + | +LL | needs_fn(1); + | -------- ^ expected an `Fn<(isize,)>` closure, found `{integer}` + | | + | required by a bound introduced by this call + | + = help: the trait `Fn<(isize,)>` is not implemented for `{integer}` +note: required by a bound in `needs_fn` + --> $DIR/fn-trait-formatting.rs:1:31 + | +LL | fn needs_fn<F>(x: F) where F: Fn(isize) -> isize {} + | ^^^^^^^^^^^^^^^^^^ required by this bound in `needs_fn` + +error: aborting due to 4 previous errors + +Some errors have detailed explanations: E0277, E0308. +For more information about an error, try `rustc --explain E0277`. |