mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
reduced the tests to their bare essence
This commit is contained in:
parent
5beddf93e7
commit
ec61abbe93
1 changed files with 6 additions and 12 deletions
|
@ -4346,11 +4346,9 @@ pub struct Foo {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn testfn(arg: &mut Foo) {
|
pub fn testfn(arg: &mut Foo) {
|
||||||
$0arg.field = 8; // write access
|
$0arg.field = 8;$0
|
||||||
println!("{}", arg.field); // read access$0
|
|
||||||
// Simulating access after the extracted portion
|
// Simulating access after the extracted portion
|
||||||
arg.field = 16; // write access
|
arg.field = 16;
|
||||||
println!("{}", arg.field); // read access
|
|
||||||
}
|
}
|
||||||
"#,
|
"#,
|
||||||
r#"
|
r#"
|
||||||
|
@ -4359,15 +4357,13 @@ pub struct Foo {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn testfn(arg: &mut Foo) {
|
pub fn testfn(arg: &mut Foo) {
|
||||||
fun_name(arg); // read access
|
fun_name(arg);
|
||||||
// Simulating access after the extracted portion
|
// Simulating access after the extracted portion
|
||||||
arg.field = 16; // write access
|
arg.field = 16;
|
||||||
println!("{}", arg.field); // read access
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn $0fun_name(arg: &mut Foo) {
|
fn $0fun_name(arg: &mut Foo) {
|
||||||
arg.field = 8;
|
arg.field = 8;
|
||||||
println!("{}", arg.field);
|
|
||||||
}
|
}
|
||||||
"#,
|
"#,
|
||||||
);
|
);
|
||||||
|
@ -4383,8 +4379,7 @@ pub struct Foo {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn testfn(arg: &mut Foo) {
|
pub fn testfn(arg: &mut Foo) {
|
||||||
$0arg.field = 8; // write access
|
$0arg.field = 8;$0
|
||||||
println!("{}", arg.field); // read access$0
|
|
||||||
}
|
}
|
||||||
"#,
|
"#,
|
||||||
r#"
|
r#"
|
||||||
|
@ -4393,12 +4388,11 @@ pub struct Foo {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn testfn(arg: &mut Foo) {
|
pub fn testfn(arg: &mut Foo) {
|
||||||
fun_name(arg); // read access
|
fun_name(arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn $0fun_name(arg: &mut Foo) {
|
fn $0fun_name(arg: &mut Foo) {
|
||||||
arg.field = 8;
|
arg.field = 8;
|
||||||
println!("{}", arg.field);
|
|
||||||
}
|
}
|
||||||
"#,
|
"#,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue