mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
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:
parent
e84453c47f
commit
8a28430676
6 changed files with 41 additions and 33 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue