When an error occurs due to a partial move, we would use the world "partial" in some parts of the error message, but not in others. This commit ensures that we use the word 'partial' in either all or none of the diagnostic messages. Additionally, we no longer describe a move out of a `Box` via `*` as a 'partial move'. This was a pre-existing issue, but became more noticable when the word 'partial' is used in more places.
24 lines
413 B
Rust
24 lines
413 B
Rust
// run-rustfix
|
|
// Issue #63988
|
|
#[derive(Debug)]
|
|
struct S;
|
|
fn foo(_: Option<S>) {}
|
|
|
|
enum E {
|
|
V {
|
|
s: S,
|
|
}
|
|
}
|
|
fn bar(_: E) {}
|
|
|
|
fn main() {
|
|
let s = Some(S);
|
|
if let Some(ref x) = s {
|
|
let _ = x;
|
|
}
|
|
foo(s); //~ ERROR use of partially moved value: `s`
|
|
let e = E::V { s: S };
|
|
let E::V { s: ref x } = e;
|
|
let _ = x;
|
|
bar(e); //~ ERROR use of partially moved value: `e`
|
|
}
|