You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func closureCoroutineAssignmentLetBorrowingArgument(_ e:borrowingEmpty){ // expected-error {{'e' has guaranteed ownership but was consumed due to being captured by a closure}}
_ = e // expected-error {{'e' was consumed but it is illegal to consume a noncopyable mutable capture of an escaping closure. One can only read from it or assign over it}}
1358
+
}
1359
+
varc=ClosureHolder()
1360
+
c.fCoroutine = f
1361
+
}
1362
+
1363
+
func closureCoroutineAssignmentLetBinding(){
1364
+
lete=Empty()
1365
+
letf:()->()={
1366
+
_ = e
1367
+
}
1368
+
varc=ClosureHolder()
1369
+
c.fCoroutine = f
1370
+
}
1371
+
1372
+
func closureCoroutineAssignmentVarBinding(){
1373
+
vare=Empty()
1374
+
e =Empty()
1375
+
letf:()->()={
1376
+
_ = e // expected-error {{'e' was consumed but it is illegal to consume a noncopyable mutable capture of an escaping closure. One can only read from it or assign over it}}
abort_apply %10 // expected-note {{non-consuming use here}}
437
+
destroy_value %6 : $@callee_guaranteed () -> ()
438
+
destroy_addr %2 : $*NonTrivialStruct
439
+
dealloc_stack %1 : $*NonTrivialStruct
440
+
%17 = tuple ()
441
+
return %17 : $()
442
+
}
443
+
444
+
// This test has some copy_value that are eliminated by the object checker. We
445
+
// are just testing the address checker here so we get a copy of noncopyable
446
+
// typed value error since we do not run the object checker. But it is ok since
447
+
// it doesn't effect the underlying test case.
448
+
sil [ossa] @coroutine_caller_uses_partial_apply_reinit : $@convention(thin) (@guaranteed NonTrivialStruct) -> () {
449
+
bb0(%0 : @guaranteed $NonTrivialStruct):
450
+
%1 = copy_value %0 : $NonTrivialStruct // expected-error {{copy of noncopyable typed value. This is a compiler bug. Please file a bug with a small example of the bug}}
%6 = copy_value %2 : $NonTrivialStruct // expected-error {{copy of noncopyable typed value. This is a compiler bug. Please file a bug with a small example of the bug}}
%17 = copy_value %2 : $NonTrivialStruct // expected-error {{copy of noncopyable typed value. This is a compiler bug. Please file a bug with a small example of the bug}}
466
+
store %17 to [init] %5 : $*NonTrivialStruct
467
+
abort_apply %14
468
+
destroy_value %2 : $NonTrivialStruct
469
+
destroy_value %10 : $@callee_guaranteed () -> ()
470
+
destroy_addr %5 : $*NonTrivialStruct
471
+
dealloc_stack %4 : $*NonTrivialStruct
472
+
%24 = tuple ()
473
+
return %24 : $()
474
+
}
475
+
476
+
sil [ossa] @coroutine_caller_uses_partial_apply_different_cfg : $@convention(thin) (@owned NonTrivialStruct) -> () {
0 commit comments