Files
rust/tests/ui/impl-trait/precise-capturing/bad-params.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

41 lines
1.5 KiB
Plaintext
Raw Normal View History

error[E0412]: cannot find type `T` in this scope
2024-04-04 12:54:56 -04:00
--> $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 {}
| +++
2024-04-04 12:54:56 -04:00
error[E0411]: cannot find type `Self` in this scope
2024-04-04 12:54:56 -04:00
--> $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
2024-04-04 12:54:56 -04:00
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 {}
| ^^^^
2024-04-04 12:54:56 -04:00
error: aborting due to 3 previous errors; 1 warning emitted
Some errors have detailed explanations: E0411, E0412.
For more information about an error, try `rustc --explain E0411`.