error[E0412]: cannot find type `T` in this scope --> $DIR/bad-params.rs:3:34 | LL | fn missing() -> impl Sized + use {} | ^ not found in this scope | help: you might be missing a type parameter | LL | fn missing() -> impl Sized + use {} | +++ error[E0411]: cannot find type `Self` in this scope --> $DIR/bad-params.rs:6:39 | LL | fn missing_self() -> impl Sized + use {} | ------------ ^^^^ `Self` is only available in impls, traits, and type definitions | | | `Self` not allowed in a function error: `Self` can't be captured in `use<...>` precise captures list, since it is an alias --> $DIR/bad-params.rs:11:48 | 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 Sized + use {} | ^^^^ error: expected type or const parameter in `use<...>` precise captures list, found function --> $DIR/bad-params.rs:15:32 | LL | fn hello() -> impl Sized + use {} | ^^^^^ error: aborting due to 4 previous errors Some errors have detailed explanations: E0411, E0412. For more information about an error, try `rustc --explain E0411`.