rust/tests/ui/impl-trait/precise-capturing/bad-params.stderr
2024-04-15 16:45:48 -04:00

47 lines
1.7 KiB
Plaintext

error[E0412]: cannot find type `T` in this scope
--> $DIR/bad-params.rs:4:26
|
LL | fn missing() -> impl use<T> Sized {}
| ^ not found in this scope
|
help: you might be missing a type parameter
|
LL | fn missing<T>() -> impl use<T> Sized {}
| +++
error[E0411]: cannot find type `Self` in this scope
--> $DIR/bad-params.rs:7:31
|
LL | fn missing_self() -> impl use<Self> Sized {}
| ------------ ^^^^ `Self` is only available in impls, traits, and type definitions
| |
| `Self` not allowed in a function
warning: the feature `precise_capturing` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/bad-params.rs:1:12
|
LL | #![feature(precise_capturing)]
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #123432 <https://github.com/rust-lang/rust/issues/123432> for more information
= note: `#[warn(incomplete_features)]` on by default
error: `Self` can't be captured in `use<...>` precise captures list, since it is an alias
--> $DIR/bad-params.rs:12:40
|
LL | impl MyType {
| ----------- `Self` is not a generic argument, but an alias to the type of the implementation
LL | fn self_is_not_param() -> impl use<Self> Sized {}
| ^^^^
error: expected type or const parameter in `use<...>` precise captures list, found function
--> $DIR/bad-params.rs:16:24
|
LL | fn hello() -> impl use<hello> Sized {}
| ^^^^^
error: aborting due to 4 previous errors; 1 warning emitted
Some errors have detailed explanations: E0411, E0412.
For more information about an error, try `rustc --explain E0411`.