mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +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());
|
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
|
// Simple linear congruential generator for deterministic result
|
||||||
|
|
|
@ -566,7 +566,7 @@ fn match_loop_inner<'t>(
|
||||||
error_items.push(item);
|
error_items.push(item);
|
||||||
}
|
}
|
||||||
OpDelimited::Op(
|
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");
|
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::Subtree { tokens, .. } => collect_vars(collector_fun, tokens),
|
||||||
Op::Repeat { tokens, .. } => collect_vars(collector_fun, tokens),
|
Op::Repeat { tokens, .. } => collect_vars(collector_fun, tokens),
|
||||||
Op::Literal(_) | Op::Ident(_) | Op::Punct(_) => {}
|
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");
|
stdx::never!("metavariable expression in lhs found");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -242,7 +242,7 @@ fn expand_subtree(
|
||||||
.into(),
|
.into(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Op::Length { depth } => {
|
Op::Len { depth } => {
|
||||||
let length = ctx.nesting.get(ctx.nesting.len() - 1 - depth).map_or(0, |_nest| {
|
let length = ctx.nesting.get(ctx.nesting.len() - 1 - depth).map_or(0, |_nest| {
|
||||||
// FIXME: to be implemented
|
// FIXME: to be implemented
|
||||||
0
|
0
|
||||||
|
|
|
@ -75,7 +75,7 @@ pub(crate) enum Op {
|
||||||
Index {
|
Index {
|
||||||
depth: usize,
|
depth: usize,
|
||||||
},
|
},
|
||||||
Length {
|
Len {
|
||||||
depth: usize,
|
depth: usize,
|
||||||
},
|
},
|
||||||
Count {
|
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 }
|
Op::Ignore { name: ident.text.clone(), id: ident.span }
|
||||||
}
|
}
|
||||||
"index" => Op::Index { depth: parse_depth(&mut args)? },
|
"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" => {
|
"count" => {
|
||||||
if new_meta_vars {
|
if new_meta_vars {
|
||||||
args.expect_dollar()?;
|
args.expect_dollar()?;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue