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/error-codes/E0401.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/error-codes/E0401.stderr')
-rw-r--r-- | src/test/ui/error-codes/E0401.stderr | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/test/ui/error-codes/E0401.stderr b/src/test/ui/error-codes/E0401.stderr new file mode 100644 index 000000000..81715621d --- /dev/null +++ b/src/test/ui/error-codes/E0401.stderr @@ -0,0 +1,49 @@ +error[E0401]: can't use generic parameters from outer function + --> $DIR/E0401.rs:4:39 + | +LL | fn foo<T>(x: T) { + | - type parameter from outer function +LL | fn bfnr<U, V: Baz<U>, W: Fn()>(y: T) { + | --------------------------- ^ use of generic parameter from outer function + | | + | help: try using a local generic parameter instead: `bfnr<U, V: Baz<U>, W: Fn(), T>` + +error[E0401]: can't use generic parameters from outer function + --> $DIR/E0401.rs:9:16 + | +LL | fn foo<T>(x: T) { + | - type parameter from outer function +... +LL | fn baz<U, + | --- try adding a local generic parameter in this method instead +... +LL | (y: T) { + | ^ use of generic parameter from outer function + +error[E0401]: can't use generic parameters from outer function + --> $DIR/E0401.rs:22:25 + | +LL | impl<T> Iterator for A<T> { + | ---- `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::<U, V, W>(x); + | +++++++++++ + +error: aborting due to 4 previous errors + +Some errors have detailed explanations: E0282, E0401. +For more information about an error, try `rustc --explain E0282`. |