]> git.lizzy.rs Git - rust.git/blob - tests/ui/feature-gates/feature-gate-impl_trait_in_fn_trait_return.stderr
Rollup merge of #106664 - chenyukang:yukang/fix-106597-remove-lseek, r=cuviper
[rust.git] / tests / ui / feature-gates / feature-gate-impl_trait_in_fn_trait_return.stderr
1 error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait return
2   --> $DIR/feature-gate-impl_trait_in_fn_trait_return.rs:1:24
3    |
4 LL | fn f() -> impl Fn() -> impl Sized { || () }
5    |                        ^^^^^^^^^^
6    |
7    = note: see issue #99697 <https://github.com/rust-lang/rust/issues/99697> for more information
8    = help: add `#![feature(impl_trait_in_fn_trait_return)]` to the crate attributes to enable
9
10 error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait return
11   --> $DIR/feature-gate-impl_trait_in_fn_trait_return.rs:3:32
12    |
13 LL | fn g() -> &'static dyn Fn() -> impl Sized { &|| () }
14    |                                ^^^^^^^^^^
15    |
16    = note: see issue #99697 <https://github.com/rust-lang/rust/issues/99697> for more information
17    = help: add `#![feature(impl_trait_in_fn_trait_return)]` to the crate attributes to enable
18
19 error: aborting due to 2 previous errors
20
21 For more information about this error, try `rustc --explain E0562`.