Skip to content

Commit e1e9478

Browse files
committed
Test: disable flaky bit of manual_ownership.swift
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
1 parent 3bbd7da commit e1e9478

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

test/SIL/manual_ownership.swift

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -423,13 +423,24 @@ extension FixedWidthInteger {
423423
}
424424
}
425425

426-
struct CollectionOf32BitLittleEndianIntegers<BaseCollection: Collection> where BaseCollection.Element == UInt8 {
427-
var baseCollection: BaseCollection
428-
429-
init(_ baseCollection: BaseCollection) {
430-
precondition(baseCollection.count % 4 == 0)
431-
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+
//
433436

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
446+
// }

0 commit comments

Comments
 (0)