refactor: Rename and move const_arg_path

It wasn't testing the `const_arg` code path, it was actually hitting
const_param's default value code path, so move it to the right place
and rename it.
This commit is contained in:
Steven Joruk 2022-03-11 21:44:18 +00:00
parent e84453c47f
commit 8a28430676
6 changed files with 41 additions and 33 deletions

View file

@ -99,9 +99,8 @@ pub(super) fn const_arg_expr(p: &mut Parser) {
expressions::literal(p);
lm.complete(p, PREFIX_EXPR);
}
// test const_arg_path
// type T = S<u32::MAX>;
_ => {
// This shouldn't be hit by `const_arg`
let lm = p.start();
paths::use_path(p);
lm.complete(p, PATH_EXPR);

View file

@ -85,6 +85,9 @@ fn const_param(p: &mut Parser, m: Marker) {
// test const_param_default_expression
// struct A<const N: i32 = { 1 }>;
// test const_param_default_path
// struct A<const N: i32 = i32::MAX>;
generic_args::const_arg_expr(p);
}