1 type Noncopyable
= ~fn();
6 noncopyable
: Noncopyable
9 fn test0(f
: Foo
, g
: Noncopyable
, h
: Noncopyable
) {
10 // just copy implicitly copyable fields from `f`, no moves:
11 let _b
= Foo {moved: ~1, noncopyable: g, ..f}
;
12 let _c
= Foo {moved: ~2, noncopyable: h, ..f}
;
15 fn test1(f
: Foo
, g
: Noncopyable
, h
: Noncopyable
) {
16 // copying move-by-default fields from `f`, so move:
17 let _b
= Foo {noncopyable: g, ..f}
;
18 let _c
= Foo {noncopyable: h, ..f}
; //~ ERROR use of moved value: `f`
21 fn test2(f
: Foo
, g
: Noncopyable
) {
22 // move non-copyable field
23 let _b
= Foo {copied: 22, moved: ~23, ..f}
;
24 let _c
= Foo {noncopyable: g, ..f}
; //~ ERROR use of moved value: `f`