about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-03-13 00:02:45 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-04-11 16:41:41 +0000
commitccae456863cf2c10e66d1e179b74ff8e950ebfa4 (patch)
tree0fc8fc9ea75942abdf8c9db2313449e0882c70e5
parent5eb573a343df5d5c955d0bcf671505d42310bf01 (diff)
downloadrust-ccae456863cf2c10e66d1e179b74ff8e950ebfa4.tar.gz
rust-ccae456863cf2c10e66d1e179b74ff8e950ebfa4.zip
Minor test fmt
-rw-r--r--tests/ui/borrowck/borrowck-fn-in-const-a.rs1
-rw-r--r--tests/ui/borrowck/borrowck-in-static.rs2
-rw-r--r--tests/ui/borrowck/borrowck-move-out-of-static-item.rs3
-rw-r--r--tests/ui/borrowck/borrowck-move-out-of-static-item.stderr2
4 files changed, 5 insertions, 3 deletions
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() -> (Box<dyn Fn()->Box<i32>>) + Sync) = &|| {
+static FN : &'static (dyn Fn() -> Box<dyn Fn()->Box<i32>> + 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