mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-12-23 08:48:08 +00:00
fix: allow equality expressions in parsing of format_args
This commit is contained in:
parent
b30c688856
commit
d24a6319db
2 changed files with 23 additions and 1 deletions
|
|
@ -6268,6 +6268,28 @@ fn main() {
|
|||
|
||||
fn $0fun_name(s: &Foo) {
|
||||
*print!("{}{}", s, s);
|
||||
}"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parameter_is_added_used_in_eq_expression_in_macro() {
|
||||
check_assist(
|
||||
extract_function,
|
||||
r#"
|
||||
//- minicore: fmt
|
||||
fn foo() {
|
||||
let v = 123;
|
||||
$0print!("{v:?}{}", v == 123);$0
|
||||
}"#,
|
||||
r#"
|
||||
fn foo() {
|
||||
let v = 123;
|
||||
fun_name(v);
|
||||
}
|
||||
|
||||
fn $0fun_name(v: i32) {
|
||||
print!("{v:?}{}", v == 123);
|
||||
}"#,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ fn builtin_expr(p: &mut Parser<'_>) -> Option<CompletedMarker> {
|
|||
if p.eat(T![,]) {
|
||||
while !p.at(EOF) && !p.at(T![')']) {
|
||||
let m = p.start();
|
||||
if p.at(IDENT) && p.nth_at(1, T![=]) {
|
||||
if p.at(IDENT) && p.nth_at(1, T![=]) && !p.nth_at(2, T![=]) {
|
||||
name(p);
|
||||
p.bump(T![=]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue