mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
ManualOwnership: introduce 'SemanticCopies' diagnostic group
This includes documentation to explain how to understand these diagnostics.
This commit is contained in:
@@ -73,6 +73,7 @@ GROUP(ProtocolTypeNonConformance, "protocol-type-non-conformance")
|
||||
GROUP(RegionIsolation, "region-isolation")
|
||||
GROUP(ResultBuilderMethods, "result-builder-methods")
|
||||
GROUP(ReturnTypeImplicitCopy, "return-type-implicit-copy")
|
||||
GROUP(SemanticCopies, "semantic-copies")
|
||||
GROUP(SendableClosureCaptures, "sendable-closure-captures")
|
||||
GROUP(SendableMetatypes, "sendable-metatypes")
|
||||
GROUP(SendingClosureRisksDataRace, "sending-closure-risks-data-race")
|
||||
|
||||
@@ -433,13 +433,13 @@ ERROR(wrong_linkage_for_serialized_function,none,
|
||||
"function has wrong linkage to be called from %0", (StringRef))
|
||||
NOTE(performance_called_from,none,
|
||||
"called from here", ())
|
||||
ERROR(manualownership_copy,none,
|
||||
"explicit 'copy' required here; please report this vague diagnostic as a bug", ())
|
||||
ERROR(manualownership_copy_happened,none,
|
||||
GROUPED_WARNING(manualownership_copy,SemanticCopies,none,
|
||||
"implicit 'copy' happens here; please report this vague diagnostic as a bug", ())
|
||||
GROUPED_WARNING(manualownership_copy_happened,SemanticCopies,none,
|
||||
"accessing %0 may produce a copy; write 'copy' to acknowledge or 'consume' to elide", (Identifier))
|
||||
ERROR(manualownership_copy_demanded,none,
|
||||
GROUPED_WARNING(manualownership_copy_demanded,SemanticCopies,none,
|
||||
"independent copy of %0 is required here; write 'copy' to acknowledge or 'consume' to elide", (Identifier))
|
||||
ERROR(manualownership_copy_captured,none,
|
||||
GROUPED_WARNING(manualownership_copy_captured,SemanticCopies,none,
|
||||
"closure capture of '%0' requires independent copy of it; write [%0 = copy %0] in the closure's capture list to acknowledge", (StringRef))
|
||||
|
||||
// 'transparent' diagnostics
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// RUN: %target-swift-frontend %s -emit-sil -verify \
|
||||
// RUN: -Werror SemanticCopies \
|
||||
// RUN: -enable-experimental-feature ManualOwnership
|
||||
|
||||
// REQUIRES: swift_feature_ManualOwnership
|
||||
|
||||
3
userdocs/diagnostics/semantic-copies.md
Normal file
3
userdocs/diagnostics/semantic-copies.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# Semantic Copies (Experimental Diagnostics)
|
||||
|
||||
TODO explain
|
||||
Reference in New Issue
Block a user