Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c55c4d7

Browse files
committed
[Sema] move 4 warnings to new UnnecessaryEffectMarker group
The “no unsafe operations occur within ‘unsafe’ expression” diagnostic was not part of any warning group. The new group also includes the matching “try” and “await” warnings.
1 parent 6da4da7 commit c55c4d7

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

include/swift/AST/DiagnosticGroups.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ GROUP(TemporaryPointers,none,"temporary-pointers")
100100
GROUP(TrailingClosureMatching,none,"trailing-closure-matching")
101101
GROUP(UnavailableSendableConformance,none,"unavailable-sendable-conformance")
102102
GROUP(UnknownWarningGroup,none,"unknown-warning-group")
103+
GROUP(UnnecessaryEffectMarker,none,"unnecessary-effect-marker")
103104
GROUP(UnsupportedScopedImport,none,"unsupported-scoped-import")
104105
GROUP(UnusedImportAccess,none,"unused-import-access")
105106
GROUP(UntypedThrows,DefaultIgnoreWarnings,"untyped-throws")

include/swift/AST/DiagnosticsSema.def

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5744,7 +5744,7 @@ NOTE(note_error_to_optional,none,
57445744
NOTE(note_disable_error_propagation,none,
57455745
"did you mean to disable error propagation?", ())
57465746

5747-
WARNING(no_throw_in_try,none,
5747+
GROUPED_WARNING(no_throw_in_try,UnnecessaryEffectMarker,none,
57485748
"no calls to throwing functions occur within 'try' expression", ())
57495749

57505750
WARNING(no_throw_in_do_with_catch,none,
@@ -5771,7 +5771,7 @@ NOTE(async_call_without_await_in_autoclosure,none,
57715771
NOTE(async_call_without_await_in_async_let,none,
57725772
"call is 'async' in an 'async let' initializer", ())
57735773

5774-
WARNING(no_async_in_await,none,
5774+
GROUPED_WARNING(no_async_in_await,UnnecessaryEffectMarker,none,
57755775
"no 'async' operations occur within 'await' expression", ())
57765776
ERROR(async_in_nonasync_function,none,
57775777
"%select{'async'|'async' call|'await'|'async let'|'async' property access|'async' subscript access}0 in "
@@ -8862,9 +8862,9 @@ GROUPED_WARNING(unsafe_without_unsafe,StrictMemorySafety,none,
88628862
"expression uses unsafe constructs but is not marked with 'unsafe'", ())
88638863
GROUPED_WARNING(for_unsafe_without_unsafe,StrictMemorySafety,none,
88648864
"for-in loop uses unsafe constructs but is not marked with 'unsafe'", ())
8865-
WARNING(no_unsafe_in_unsafe,none,
8865+
GROUPED_WARNING(no_unsafe_in_unsafe,UnnecessaryEffectMarker,none,
88668866
"no unsafe operations occur within 'unsafe' expression", ())
8867-
WARNING(no_unsafe_in_unsafe_for,none,
8867+
GROUPED_WARNING(no_unsafe_in_unsafe_for,UnnecessaryEffectMarker,none,
88688868
"no unsafe operations occur within 'unsafe' for-in loop", ())
88698869
NOTE(make_subclass_unsafe,none,
88708870
"make class %0 '@unsafe' to allow unsafe overrides of safe superclass "

0 commit comments

Comments
 (0)