Dont stop find loop node at struct field node
This commit is contained in:
parent
4264548283
commit
dcee2e8a0f
4 changed files with 14 additions and 12 deletions
|
|
@ -56,7 +56,9 @@ fn from_field<'a>(s: &'a mut S<'a>) -> Option<&'a mut usize> {
|
|||
mod issue_non_copy_13077 {
|
||||
pub fn something(mut maybe_side_effect: Option<&mut String>) {
|
||||
for _ in 0..10 {
|
||||
let _ = S { field: other(maybe_side_effect) };
|
||||
let _ = S {
|
||||
field: other(maybe_side_effect.as_deref_mut()),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -64,5 +66,7 @@ mod issue_non_copy_13077 {
|
|||
unimplemented!()
|
||||
}
|
||||
|
||||
pub struct S { pub field: () }
|
||||
pub struct S {
|
||||
pub field: (),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,9 @@ fn from_field<'a>(s: &'a mut S<'a>) -> Option<&'a mut usize> {
|
|||
mod issue_non_copy_13077 {
|
||||
pub fn something(mut maybe_side_effect: Option<&mut String>) {
|
||||
for _ in 0..10 {
|
||||
let _ = S { field: other(maybe_side_effect.as_deref_mut()) };
|
||||
let _ = S {
|
||||
field: other(maybe_side_effect.as_deref_mut()),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -64,5 +66,7 @@ mod issue_non_copy_13077 {
|
|||
unimplemented!()
|
||||
}
|
||||
|
||||
pub struct S { pub field: () }
|
||||
pub struct S {
|
||||
pub field: (),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,11 +19,5 @@ error: derefed type is same as origin
|
|||
LL | let _ = x.as_deref_mut();
|
||||
| ^^^^^^^^^^^^^^^^ help: try: `x`
|
||||
|
||||
error: derefed type is same as origin
|
||||
--> tests/ui/needless_option_as_deref.rs:59:38
|
||||
|
|
||||
LL | let _ = S { field: other(maybe_side_effect.as_deref_mut()) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `maybe_side_effect`
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue