From a4b7ed7a42c716ab9f05e351f003d589124fd55d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:58 +0200 Subject: Adding upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/error-codes/E0401.stderr | 70 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 tests/ui/error-codes/E0401.stderr (limited to 'tests/ui/error-codes/E0401.stderr') diff --git a/tests/ui/error-codes/E0401.stderr b/tests/ui/error-codes/E0401.stderr new file mode 100644 index 000000000..fa4b91cac --- /dev/null +++ b/tests/ui/error-codes/E0401.stderr @@ -0,0 +1,70 @@ +error[E0401]: can't use generic parameters from outer function + --> $DIR/E0401.rs:4:39 + | +LL | fn foo(x: T) { + | - type parameter from outer function +LL | fn bfnr, W: Fn()>(y: T) { + | - ^ use of generic parameter from outer function + | | + | help: try using a local generic parameter instead: `T,` + +error[E0401]: can't use generic parameters from outer function + --> $DIR/E0401.rs:9:16 + | +LL | fn foo(x: T) { + | - type parameter from outer function +... +LL | fn baz $DIR/E0401.rs:24:25 + | +LL | impl Iterator for A { + | ---- `Self` type implicitly declared here, by this `impl` +... +LL | fn helper(sel: &Self) -> u8 { + | ^^^^ + | | + | use of generic parameter from outer function + | use a type here instead + +error[E0282]: type annotations needed + --> $DIR/E0401.rs:11:5 + | +LL | bfnr(x); + | ^^^^ cannot infer type of the type parameter `U` declared on the function `bfnr` + | +help: consider specifying the generic arguments + | +LL | bfnr::(x); + | +++++++++++ + +error[E0283]: type annotations needed + --> $DIR/E0401.rs:11:5 + | +LL | bfnr(x); + | ^^^^ cannot infer type of the type parameter `W` declared on the function `bfnr` + | + = note: multiple `impl`s satisfying `_: Fn<()>` found in the following crates: `alloc`, `core`: + - impl Fn for &F + where A: Tuple, F: Fn, F: ?Sized; + - impl Fn for Box + where Args: Tuple, F: Fn, A: Allocator, F: ?Sized; +note: required by a bound in `bfnr` + --> $DIR/E0401.rs:4:30 + | +LL | fn bfnr, W: Fn()>(y: T) { + | ^^^^ required by this bound in `bfnr` +help: consider specifying the generic arguments + | +LL | bfnr::(x); + | +++++++++++ + +error: aborting due to 5 previous errors + +Some errors have detailed explanations: E0282, E0283, E0401. +For more information about an error, try `rustc --explain E0282`. -- cgit v1.2.3