diff --git a/tests/ui/borrowck/borrowck-fn-in-const-a.rs b/tests/ui/borrowck/borrowck-fn-in-const-a.rs index d4ceae2963b..d52ec342b1a 100644 --- a/tests/ui/borrowck/borrowck-fn-in-const-a.rs +++ b/tests/ui/borrowck/borrowck-fn-in-const-a.rs @@ -9,4 +9,5 @@ const MOVE: fn(&String) -> String = { }; fn main() { + println!("{}", MOVE(&String::new())); } diff --git a/tests/ui/borrowck/borrowck-in-static.rs b/tests/ui/borrowck/borrowck-in-static.rs index a45f7b18e07..864dff40f46 100644 --- a/tests/ui/borrowck/borrowck-in-static.rs +++ b/tests/ui/borrowck/borrowck-in-static.rs @@ -1,6 +1,6 @@ // check that borrowck looks inside consts/statics -static FN : &'static (dyn Fn() -> (BoxBox>) + Sync) = &|| { +static FN : &'static (dyn Fn() -> BoxBox> + Sync) = &|| { let x = Box::new(0); Box::new(|| x) //~ ERROR cannot move out of `x`, a captured variable in an `Fn` closure }; diff --git a/tests/ui/borrowck/borrowck-move-out-of-static-item.rs b/tests/ui/borrowck/borrowck-move-out-of-static-item.rs index d01fb261894..b24d9b932cd 100644 --- a/tests/ui/borrowck/borrowck-move-out-of-static-item.rs +++ b/tests/ui/borrowck/borrowck-move-out-of-static-item.rs @@ -8,7 +8,8 @@ static BAR: Foo = Foo { foo: 5 }; fn test(f: Foo) { - let _f = Foo{foo: 4, ..f}; + let f = Foo { foo: 4, ..f }; + println!("{}", f.foo); } fn main() { diff --git a/tests/ui/borrowck/borrowck-move-out-of-static-item.stderr b/tests/ui/borrowck/borrowck-move-out-of-static-item.stderr index 07dcaf875e7..c4530820be5 100644 --- a/tests/ui/borrowck/borrowck-move-out-of-static-item.stderr +++ b/tests/ui/borrowck/borrowck-move-out-of-static-item.stderr @@ -1,5 +1,5 @@ error[E0507]: cannot move out of static item `BAR` - --> $DIR/borrowck-move-out-of-static-item.rs:15:10 + --> $DIR/borrowck-move-out-of-static-item.rs:16:10 | LL | test(BAR); | ^^^ move occurs because `BAR` has type `Foo`, which does not implement the `Copy` trait