ParenthesizedGenericArgs::{Ok -> ParenSugar}

This commit is contained in:
Michael Goulet 2023-03-03 23:25:54 +00:00
parent 5bf139e360
commit f50c1e1f05
2 changed files with 5 additions and 5 deletions

View File

@ -482,7 +482,7 @@ enum ParamMode {
}
enum ParenthesizedGenericArgs {
Ok,
ParenSugar,
Err,
}

View File

@ -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 => {