Skip to content

Commit 863b638

Browse files
committed
Minor test fmt
1 parent 444c824 commit 863b638

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

tests/ui/borrowck/borrowck-fn-in-const-a.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ const MOVE: fn(&String) -> String = {
99
};
1010

1111
fn main() {
12+
println!("{}", MOVE(&String::new()));
1213
}

tests/ui/borrowck/borrowck-in-static.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// check that borrowck looks inside consts/statics
22

3-
static FN : &'static (dyn Fn() -> (Box<dyn Fn()->Box<i32>>) + Sync) = &|| {
3+
static FN : &'static (dyn Fn() -> Box<dyn Fn()->Box<i32>> + Sync) = &|| {
44
let x = Box::new(0);
55
Box::new(|| x) //~ ERROR cannot move out of `x`, a captured variable in an `Fn` closure
66
};

tests/ui/borrowck/borrowck-move-out-of-static-item.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ static BAR: Foo = Foo { foo: 5 };
88

99

1010
fn test(f: Foo) {
11-
let _f = Foo{foo: 4, ..f};
11+
let f = Foo { foo: 4, ..f };
12+
println!("{}", f.foo);
1213
}
1314

1415
fn main() {

tests/ui/borrowck/borrowck-move-out-of-static-item.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0507]: cannot move out of static item `BAR`
2-
--> $DIR/borrowck-move-out-of-static-item.rs:15:10
2+
--> $DIR/borrowck-move-out-of-static-item.rs:16:10
33
|
44
LL | test(BAR);
55
| ^^^ move occurs because `BAR` has type `Foo`, which does not implement the `Copy` trait

0 commit comments

Comments
 (0)