Minor test fmt
This commit is contained in:
parent
5eb573a343
commit
ccae456863
@ -9,4 +9,5 @@ fn broken(x: &String) -> String {
|
||||
};
|
||||
|
||||
fn main() {
|
||||
println!("{}", MOVE(&String::new()));
|
||||
}
|
||||
|
@ -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
|
||||
};
|
||||
|
@ -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() {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user