From e1e9478fbf9c8ad229366833a53c08276cc11ef1 Mon Sep 17 00:00:00 2001 From: Kavon Farvardin Date: Wed, 17 Dec 2025 11:22:49 -0800 Subject: [PATCH] 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 --- test/SIL/manual_ownership.swift | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/test/SIL/manual_ownership.swift b/test/SIL/manual_ownership.swift index a12bc1ba279c8..b8eef6dc8c7a0 100644 --- a/test/SIL/manual_ownership.swift +++ b/test/SIL/manual_ownership.swift @@ -423,13 +423,24 @@ extension FixedWidthInteger { } } -struct CollectionOf32BitLittleEndianIntegers where BaseCollection.Element == UInt8 { - var baseCollection: BaseCollection - - init(_ baseCollection: BaseCollection) { - precondition(baseCollection.count % 4 == 0) - self.baseCollection = baseCollection // expected-warning {{accessing 'baseCollection' may produce a copy}} - } // expected-warning {{accessing 'self' may produce a copy}} +// FIXME(rdar://164852821): Some of the diagnostic message tailoring for assignments +// are unstable when targeting platforms like the simulator, since we seem to emit +// slightly different SIL which then throws off the heuristics. For example, +// +// /swift/test/SIL/manual_ownership.swift:431:68: error: incorrect message found +// self.baseCollection = baseCollection +// // x-warning@-1 {{accessing 'baseCollection' may produce a copy}} +// ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// closure capture of 'baseCollection' requires independent copy of it; write [baseCollection = copy baseCollection] in the closure's capture list to acknowledge +// - // FIXME: the above initializer shouldn't have any diagnostics -} +// struct CollectionOf32BitLittleEndianIntegers where BaseCollection.Element == UInt8 { +// var baseCollection: BaseCollection +// +// init(_ baseCollection: BaseCollection) { +// precondition(baseCollection.count % 4 == 0) +// self.baseCollection = baseCollection // x-warning {{accessing 'baseCollection' may produce a copy}} +// } // x-warning {{accessing 'self' may produce a copy}} +// +// // FIXME: the above initializer shouldn't have any diagnostics +// }