diff options
Diffstat (limited to 'src/test/ui/moves/move-guard-same-consts.stderr')
-rw-r--r-- | src/test/ui/moves/move-guard-same-consts.stderr | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/moves/move-guard-same-consts.stderr b/src/test/ui/moves/move-guard-same-consts.stderr index 2048fefef..86e5f6524 100644 --- a/src/test/ui/moves/move-guard-same-consts.stderr +++ b/src/test/ui/moves/move-guard-same-consts.stderr @@ -8,6 +8,18 @@ LL | (1, 2) if take(x) => (), | - value moved here LL | (1, 2) if take(x) => (), | ^ value used here after move + | +note: consider changing this parameter type in function `take` to borrow instead if owning the value isn't necessary + --> $DIR/move-guard-same-consts.rs:25:15 + | +LL | fn take<T>(_: T) -> bool { false } + | ---- ^ this parameter takes ownership of the value + | | + | in this function +help: consider cloning the value if the performance cost is acceptable + | +LL | (1, 2) if take(x.clone()) => (), + | ++++++++ error: aborting due to previous error |