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.

38 lines
1.3 KiB
Plaintext
Raw Normal View History

error[E0412]: cannot find type `T` in this scope
--> $DIR/bad-params.rs:1:34
2024-04-04 12:54:56 -04:00
|
2024-06-05 16:18:52 -04:00
LL | fn missing() -> impl Sized + use<T> {}
| ^ not found in this scope
|
help: you might be missing a type parameter
|
2024-06-05 16:18:52 -04:00
LL | fn missing<T>() -> impl Sized + use<T> {}
| +++
2024-04-04 12:54:56 -04:00
error[E0411]: cannot find type `Self` in this scope
--> $DIR/bad-params.rs:4:39
2024-04-04 12:54:56 -04:00
|
2024-06-05 16:18:52 -04:00
LL | fn missing_self() -> impl Sized + use<Self> {}
| ------------ ^^^^ `Self` is only available in impls, traits, and type definitions
| |
| `Self` not allowed in a function
2024-04-04 12:54:56 -04:00
error: `Self` can't be captured in `use<...>` precise captures list, since it is an alias
--> $DIR/bad-params.rs:9:48
|
LL | impl MyType {
| ----------- `Self` is not a generic argument, but an alias to the type of the implementation
2024-06-05 16:18:52 -04:00
LL | fn self_is_not_param() -> impl Sized + use<Self> {}
| ^^^^
2024-04-04 20:36:18 -04:00
error: expected type or const parameter in `use<...>` precise captures list, found function
--> $DIR/bad-params.rs:13:32
2024-04-04 20:36:18 -04:00
|
2024-06-05 16:18:52 -04:00
LL | fn hello() -> impl Sized + use<hello> {}
| ^^^^^
2024-04-04 20:36:18 -04:00
error: aborting due to 4 previous errors
2024-04-04 12:54:56 -04:00
Some errors have detailed explanations: E0411, E0412.
For more information about an error, try `rustc --explain E0411`.