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
The diagnostic messages are not yet stabilized, so we're
getting an extra diagnostic depending on whether we're building
the stdlib in debug-asserts mode, i.e., when
```
preset=buildbot,tools=RA,stdlib=DA
```
rdar://164852821
self.baseCollection = baseCollection // expected-warning {{accessing 'baseCollection' may produce a copy}}
432
-
} // expected-warning {{accessing 'self' may produce a copy}}
426
+
// FIXME(rdar://164852821): Some of the diagnostic message tailoring for assignments
427
+
// are unstable when targeting platforms like the simulator, since we seem to emit
428
+
// slightly different SIL which then throws off the heuristics. For example,
429
+
//
430
+
// <snip>/swift/test/SIL/manual_ownership.swift:431:68: error: incorrect message found
431
+
// self.baseCollection = baseCollection
432
+
// // x-warning@-1 {{accessing 'baseCollection' may produce a copy}}
433
+
// ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
434
+
// closure capture of 'baseCollection' requires independent copy of it; write [baseCollection = copy baseCollection] in the closure's capture list to acknowledge
435
+
//
433
436
434
-
// FIXME: the above initializer shouldn't have any diagnostics
435
-
}
437
+
// struct CollectionOf32BitLittleEndianIntegers<BaseCollection: Collection> where BaseCollection.Element == UInt8 {
438
+
// var baseCollection: BaseCollection
439
+
//
440
+
// init(_ baseCollection: BaseCollection) {
441
+
// precondition(baseCollection.count % 4 == 0)
442
+
// self.baseCollection = baseCollection // x-warning {{accessing 'baseCollection' may produce a copy}}
443
+
// } // x-warning {{accessing 'self' may produce a copy}}
444
+
//
445
+
// // FIXME: the above initializer shouldn't have any diagnostics
0 commit comments