@@ -307,22 +307,21 @@ extension LifetimeDependence.Scope {
307
307
/// forwarded (via struct/tuple) from multiple guaranteed values.
308
308
init ? ( base: Value , _ context: some Context ) {
309
309
if base. type. isAddress {
310
- if let scope = Self ( address: base, context) {
311
- self = scope
312
- return
310
+ guard let scope = Self ( address: base, context) else {
311
+ return nil
313
312
}
314
- return nil
313
+ self = scope
314
+ return
315
315
}
316
316
switch base. ownership {
317
317
case . owned:
318
318
self = . owned( base)
319
319
return
320
320
case . guaranteed:
321
- if let scope = Self ( guaranteed: base, context) {
322
- self = scope
323
- return
321
+ guard let scope = Self ( guaranteed: base, context) else {
322
+ return nil
324
323
}
325
- return nil
324
+ self = scope
326
325
case . none:
327
326
// lifetime dependence requires a nontrivial value"
328
327
return nil
@@ -339,23 +338,23 @@ extension LifetimeDependence.Scope {
339
338
switch accessBase {
340
339
case let . box( projectBox) :
341
340
// Note: the box may be in a borrow scope.
342
- if let scope = Self ( base: projectBox. operand. value, context) {
343
- self = scope
341
+ guard let scope = Self ( base: projectBox. operand. value, context) else {
342
+ return nil
344
343
}
345
- return nil
344
+ self = scope
346
345
case let . stack( allocStack) :
347
- if let scope = Self ( allocation: allocStack, context) {
348
- self = scope
346
+ guard let scope = Self ( allocation: allocStack, context) else {
347
+ return nil
349
348
}
350
- return nil
349
+ self = scope
351
350
case . global:
352
351
self = . unknown( address)
353
352
case . class, . tail:
354
353
let refElt = address as! UnaryInstruction
355
- if let scope = Self ( guaranteed: refElt. operand. value, context) {
356
- self = scope
354
+ guard let scope = Self ( guaranteed: refElt. operand. value, context) else {
355
+ return nil
357
356
}
358
- return nil
357
+ self = scope
359
358
case let . argument( arg) :
360
359
if arg. convention. isIndirectIn {
361
360
self = . initialized( initialAddress: arg, initializingStore: nil )
0 commit comments