... and trying to use foo afterwards, which triggers
error[E0382]: use of moved value: foo
Example:
struct Bar;
impl AsRef<Bar> for Bar {
fn as_ref(&self) -> &Bar {
self
}
}
fn foo<T: AsRef<Bar>>(_: T) {}
pub fn main() {
let bar = Bar;
foo(bar);
let baa = bar;
}
currently yields
rustc 1.17.0 (56124baa9 2017-04-24)
error[E0382]: use of moved value: `bar`
--> <anon>:15:9
|
14 | foo(bar);
| --- value moved here
15 | let baa = bar;
| ^^^ value used here after move
|
= note: move occurs because `bar` has type `Bar`, which does not implement the `Copy` trait
error: aborting due to previous error
I suggest that it should also contain
help: if you meant to borrow `bar` use `foo(&bar)`?
... and trying to use
fooafterwards, which triggersExample:
currently yields
I suggest that it should also contain