Minor test fmt

This commit is contained in:
Esteban Küber 2024-03-13 00:02:45 +00:00
parent 5eb573a343
commit ccae456863
4 changed files with 5 additions and 3 deletions

View file

@ -9,4 +9,5 @@ fn broken(x: &String) -> String {
};
fn main() {
println!("{}", MOVE(&String::new()));
}

View file

@ -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
};

View file

@ -8,7 +8,8 @@ struct Foo {
fn test(f: Foo) {
let _f = Foo{foo: 4, ..f};
let f = Foo { foo: 4, ..f };
println!("{}", f.foo);
}
fn main() {

View file

@ -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