Rollup merge of #105408 - cuviper:help-rpitirpit, r=compiler-errors
Add help for `#![feature(impl_trait_in_fn_trait_return)]` This adds a new variant `ImplTraitContext::FeatureGated`, so we can generalize the help for `return_position_impl_trait_in_trait` to also work for `impl_trait_in_fn_trait_return`. cc #99697
This commit is contained in:
commit
2fbde2b028
3 changed files with 40 additions and 17 deletions
|
|
@ -3,12 +3,18 @@ error[E0562]: `impl Trait` only allowed in function and inherent method return t
|
|||
|
|
||||
LL | fn f() -> impl Fn() -> impl Sized { || () }
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #99697 <https://github.com/rust-lang/rust/issues/99697> for more information
|
||||
= help: add `#![feature(impl_trait_in_fn_trait_return)]` to the crate attributes to enable
|
||||
|
||||
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait return
|
||||
--> $DIR/feature-gate-impl_trait_in_fn_trait_return.rs:3:32
|
||||
|
|
||||
LL | fn g() -> &'static dyn Fn() -> impl Sized { &|| () }
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #99697 <https://github.com/rust-lang/rust/issues/99697> for more information
|
||||
= help: add `#![feature(impl_trait_in_fn_trait_return)]` to the crate attributes to enable
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue