mirror of https://github.com/rust-lang/rust.git
Feature gate `impl_trait_in_fn_trait_return`
This commit is contained in:
parent
00f22771f6
commit
cc752f5665
|
@ -363,7 +363,10 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
||||||
// fn f(_: impl Fn() -> impl Debug) -> impl Fn() -> impl Debug
|
// fn f(_: impl Fn() -> impl Debug) -> impl Fn() -> impl Debug
|
||||||
// // disallowed --^^^^^^^^^^ allowed --^^^^^^^^^^
|
// // disallowed --^^^^^^^^^^ allowed --^^^^^^^^^^
|
||||||
// ```
|
// ```
|
||||||
FnRetTy::Ty(ty) if matches!(itctx, ImplTraitContext::ReturnPositionOpaqueTy { .. }) => {
|
FnRetTy::Ty(ty)
|
||||||
|
if matches!(itctx, ImplTraitContext::ReturnPositionOpaqueTy { .. })
|
||||||
|
&& self.tcx.features().impl_trait_in_fn_trait_return =>
|
||||||
|
{
|
||||||
self.lower_ty(&ty, itctx)
|
self.lower_ty(&ty, itctx)
|
||||||
}
|
}
|
||||||
FnRetTy::Ty(ty) => {
|
FnRetTy::Ty(ty) => {
|
||||||
|
|
|
@ -414,6 +414,8 @@ declare_features! (
|
||||||
(active, half_open_range_patterns_in_slices, "CURRENT_RUSTC_VERSION", Some(67264), None),
|
(active, half_open_range_patterns_in_slices, "CURRENT_RUSTC_VERSION", Some(67264), None),
|
||||||
/// Allows `if let` guard in match arms.
|
/// Allows `if let` guard in match arms.
|
||||||
(active, if_let_guard, "1.47.0", Some(51114), None),
|
(active, if_let_guard, "1.47.0", Some(51114), None),
|
||||||
|
/// Allows `impl Trait` as output type in `Fn` traits in return position of functions.
|
||||||
|
(active, impl_trait_in_fn_trait_return, "1.64.0", Some(99697), None),
|
||||||
/// Allows using imported `main` function
|
/// Allows using imported `main` function
|
||||||
(active, imported_main, "1.53.0", Some(28937), None),
|
(active, imported_main, "1.53.0", Some(28937), None),
|
||||||
/// Allows associated types in inherent impls.
|
/// Allows associated types in inherent impls.
|
||||||
|
|
|
@ -813,6 +813,7 @@ symbols! {
|
||||||
impl_lint_pass,
|
impl_lint_pass,
|
||||||
impl_macros,
|
impl_macros,
|
||||||
impl_trait_in_bindings,
|
impl_trait_in_bindings,
|
||||||
|
impl_trait_in_fn_trait_return,
|
||||||
implied_by,
|
implied_by,
|
||||||
import,
|
import,
|
||||||
import_name_type,
|
import_name_type,
|
||||||
|
|
Loading…
Reference in New Issue