aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/parse/rust-parse-impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/parse/rust-parse-impl.h')
-rw-r--r--gcc/rust/parse/rust-parse-impl.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 708140a..a36107b 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -2892,9 +2892,11 @@ Parser<ManagedTokenSource>::parse_generic_param (EndTokenPred is_end_token)
"%<identifier%> or %<literal%>, got %qs",
token_id_to_str (tok->get_id ()));
- // TODO: At this point, we *know* that we are parsing a const
- // expression. We should figure out how to disambiguate the default
- // expr in the case of `const N: usize = M`
+ // At this point, we *know* that we are parsing a const
+ // expression
+ if (default_expr.get_kind ()
+ == AST::ConstGenericArg::Kind::Ambiguous)
+ default_expr = default_expr.disambiguate_to_const ();
}
param = std::unique_ptr<AST::ConstGenericParam> (