diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index 0b6b02ba00f..878763dca14 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -482,7 +482,7 @@ enum ParamMode { } enum ParenthesizedGenericArgs { - Ok, + ParenSugar, Err, } diff --git a/compiler/rustc_ast_lowering/src/path.rs b/compiler/rustc_ast_lowering/src/path.rs index 592fc5aa645..6ab23206f54 100644 --- a/compiler/rustc_ast_lowering/src/path.rs +++ b/compiler/rustc_ast_lowering/src/path.rs @@ -51,7 +51,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { let parenthesized_generic_args = match base_res { // `a::b::Trait(Args)` Res::Def(DefKind::Trait, _) if i + 1 == proj_start => { - ParenthesizedGenericArgs::Ok + ParenthesizedGenericArgs::ParenSugar } // `a::b::Trait(Args)::TraitItem` Res::Def(DefKind::AssocFn, _) @@ -59,10 +59,10 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { | Res::Def(DefKind::AssocTy, _) if i + 2 == proj_start => { - ParenthesizedGenericArgs::Ok + ParenthesizedGenericArgs::ParenSugar } // Avoid duplicated errors. - Res::Err => ParenthesizedGenericArgs::Ok, + Res::Err => ParenthesizedGenericArgs::ParenSugar, // An error _ => ParenthesizedGenericArgs::Err, }; @@ -180,7 +180,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { self.lower_angle_bracketed_parameter_data(data, param_mode, itctx) } GenericArgs::Parenthesized(data) => match parenthesized_generic_args { - ParenthesizedGenericArgs::Ok => { + ParenthesizedGenericArgs::ParenSugar => { self.lower_parenthesized_parameter_data(data, itctx) } ParenthesizedGenericArgs::Err => {