mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 13:48:50 +00:00
Auto merge of #17392 - randomicon00:17242, r=Veykril
Change 'Length' to 'Len' This is a fix for #17242
This commit is contained in:
commit
0a16ae340b
4 changed files with 6 additions and 6 deletions
|
@ -215,7 +215,7 @@ fn invocation_fixtures(
|
|||
|
||||
token_trees.push(subtree.into());
|
||||
}
|
||||
Op::Ignore { .. } | Op::Index { .. } | Op::Count { .. } | Op::Length { .. } => {}
|
||||
Op::Ignore { .. } | Op::Index { .. } | Op::Count { .. } | Op::Len { .. } => {}
|
||||
};
|
||||
|
||||
// Simple linear congruential generator for deterministic result
|
||||
|
|
|
@ -566,7 +566,7 @@ fn match_loop_inner<'t>(
|
|||
error_items.push(item);
|
||||
}
|
||||
OpDelimited::Op(
|
||||
Op::Ignore { .. } | Op::Index { .. } | Op::Count { .. } | Op::Length { .. },
|
||||
Op::Ignore { .. } | Op::Index { .. } | Op::Count { .. } | Op::Len { .. },
|
||||
) => {
|
||||
stdx::never!("metavariable expression in lhs found");
|
||||
}
|
||||
|
@ -832,7 +832,7 @@ fn collect_vars(collector_fun: &mut impl FnMut(SmolStr), pattern: &MetaTemplate)
|
|||
Op::Subtree { tokens, .. } => collect_vars(collector_fun, tokens),
|
||||
Op::Repeat { tokens, .. } => collect_vars(collector_fun, tokens),
|
||||
Op::Literal(_) | Op::Ident(_) | Op::Punct(_) => {}
|
||||
Op::Ignore { .. } | Op::Index { .. } | Op::Count { .. } | Op::Length { .. } => {
|
||||
Op::Ignore { .. } | Op::Index { .. } | Op::Count { .. } | Op::Len { .. } => {
|
||||
stdx::never!("metavariable expression in lhs found");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -242,7 +242,7 @@ fn expand_subtree(
|
|||
.into(),
|
||||
);
|
||||
}
|
||||
Op::Length { depth } => {
|
||||
Op::Len { depth } => {
|
||||
let length = ctx.nesting.get(ctx.nesting.len() - 1 - depth).map_or(0, |_nest| {
|
||||
// FIXME: to be implemented
|
||||
0
|
||||
|
|
|
@ -75,7 +75,7 @@ pub(crate) enum Op {
|
|||
Index {
|
||||
depth: usize,
|
||||
},
|
||||
Length {
|
||||
Len {
|
||||
depth: usize,
|
||||
},
|
||||
Count {
|
||||
|
@ -345,7 +345,7 @@ fn parse_metavar_expr(new_meta_vars: bool, src: &mut TtIter<'_, Span>) -> Result
|
|||
Op::Ignore { name: ident.text.clone(), id: ident.span }
|
||||
}
|
||||
"index" => Op::Index { depth: parse_depth(&mut args)? },
|
||||
"length" => Op::Length { depth: parse_depth(&mut args)? },
|
||||
"len" => Op::Len { depth: parse_depth(&mut args)? },
|
||||
"count" => {
|
||||
if new_meta_vars {
|
||||
args.expect_dollar()?;
|
||||
|
|
Loading…
Reference in a new issue