File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,19 @@ func takeNoncopyableGeneric<T: ~Copyable>(_ t: T) {} // expected-error {{expecte
41
41
~ Copyable // expected-note {{attribute already specified here}}
42
42
{ }
43
43
44
- // basic test to ensure it's viewed as a noncopyable struct:
45
- struct HasADeinit : ~ Copyable {
46
- deinit { }
44
+ // basic tests to ensure it's viewed as a noncopyable struct, by using
45
+ // capabilities only available to them
46
+ struct HasADeinit : ~ Copyable { deinit { } }
47
+
48
+ public struct MoveOnlyS1 < T> : ~ Copyable { deinit { } }
49
+ public struct MoveOnlyS2 < T: Equatable > : ~ Copyable { deinit { } }
50
+
51
+ public enum MoveOnlyE1 < T> : ~ Copyable {
52
+ case holding( s: MoveOnlyS1 < T > )
53
+ consuming func x( ) { }
54
+ }
55
+
56
+ public enum MoveOnlyE2 < T: Equatable > : ~ Copyable {
57
+ case holding( s: MoveOnlyS1 < T > )
58
+ consuming func x( ) { }
47
59
}
You can’t perform that action at this time.
0 commit comments