Remove CallKind::Deref hack from UseSpans
It's not really necessary
This commit is contained in:
parent
cd65cd27db
commit
339902908e
4 changed files with 6 additions and 15 deletions
|
@ -661,9 +661,6 @@ impl UseSpans<'_> {
|
|||
UseSpans::ClosureUse { args_span: span, .. }
|
||||
| UseSpans::PatUse(span)
|
||||
| UseSpans::OtherUse(span) => span,
|
||||
UseSpans::FnSelfUse { fn_call_span, kind: CallKind::DerefCoercion { .. }, .. } => {
|
||||
fn_call_span
|
||||
}
|
||||
UseSpans::FnSelfUse { var_span, .. } => var_span,
|
||||
}
|
||||
}
|
||||
|
@ -674,9 +671,6 @@ impl UseSpans<'_> {
|
|||
UseSpans::ClosureUse { path_span: span, .. }
|
||||
| UseSpans::PatUse(span)
|
||||
| UseSpans::OtherUse(span) => span,
|
||||
UseSpans::FnSelfUse { fn_call_span, kind: CallKind::DerefCoercion { .. }, .. } => {
|
||||
fn_call_span
|
||||
}
|
||||
UseSpans::FnSelfUse { var_span, .. } => var_span,
|
||||
}
|
||||
}
|
||||
|
@ -687,9 +681,6 @@ impl UseSpans<'_> {
|
|||
UseSpans::ClosureUse { capture_kind_span: span, .. }
|
||||
| UseSpans::PatUse(span)
|
||||
| UseSpans::OtherUse(span) => span,
|
||||
UseSpans::FnSelfUse { fn_call_span, kind: CallKind::DerefCoercion { .. }, .. } => {
|
||||
fn_call_span
|
||||
}
|
||||
UseSpans::FnSelfUse { var_span, .. } => var_span,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ error[E0382]: borrow of partially moved value: `val`
|
|||
LL | let _val = val.first;
|
||||
| --------- value partially moved here
|
||||
LL | val.inner;
|
||||
| ^^^^^^^^^ value borrowed here after partial move
|
||||
| ^^^ value borrowed here after partial move
|
||||
|
|
||||
= note: partial move occurs because `val.first` has type `NotCopy`, which does not implement the `Copy` trait
|
||||
= note: borrow occurs due to deref coercion to `NotCopy`
|
||||
|
@ -20,7 +20,7 @@ error[E0382]: borrow of partially moved value: `val`
|
|||
LL | let _val = val.first;
|
||||
| --------- value partially moved here
|
||||
LL | val.inner_method();
|
||||
| ^^^^^^^^^^^^^^^^^^ value borrowed here after partial move
|
||||
| ^^^ value borrowed here after partial move
|
||||
|
|
||||
= note: partial move occurs because `val.first` has type `NotCopy`, which does not implement the `Copy` trait
|
||||
= note: borrow occurs due to deref coercion to `NotCopy`
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0382]: borrow of moved value: `arc_v`
|
||||
--> $DIR/no-capture-arc.rs:14:16
|
||||
--> $DIR/no-capture-arc.rs:14:18
|
||||
|
|
||||
LL | let arc_v = Arc::new(v);
|
||||
| ----- move occurs because `arc_v` has type `Arc<Vec<i32>>`, which does not implement the `Copy` trait
|
||||
|
@ -10,7 +10,7 @@ LL | assert_eq!((*arc_v)[3], 4);
|
|||
| ----- variable moved due to use in closure
|
||||
...
|
||||
LL | assert_eq!((*arc_v)[2], 3);
|
||||
| ^^^^^^^^ value borrowed here after move
|
||||
| ^^^^^ value borrowed here after move
|
||||
|
|
||||
= note: borrow occurs due to deref coercion to `Vec<i32>`
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0382]: borrow of moved value: `arc_v`
|
||||
--> $DIR/no-reuse-move-arc.rs:12:16
|
||||
--> $DIR/no-reuse-move-arc.rs:12:18
|
||||
|
|
||||
LL | let arc_v = Arc::new(v);
|
||||
| ----- move occurs because `arc_v` has type `Arc<Vec<i32>>`, which does not implement the `Copy` trait
|
||||
|
@ -10,7 +10,7 @@ LL | assert_eq!((*arc_v)[3], 4);
|
|||
| ----- variable moved due to use in closure
|
||||
...
|
||||
LL | assert_eq!((*arc_v)[2], 3);
|
||||
| ^^^^^^^^ value borrowed here after move
|
||||
| ^^^^^ value borrowed here after move
|
||||
|
|
||||
= note: borrow occurs due to deref coercion to `Vec<i32>`
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue