Skip to content

Commit b0bbbfb

Browse files
authored
Merge pull request swiftlang#39329 from slavapestov/no-back-quotes-in-diags
Don't use back-quotes in diagnostics
2 parents 67aab42 + c8f3476 commit b0bbbfb

19 files changed

+31
-31
lines changed

include/swift/AST/DiagnosticsDriver.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,6 @@ WARNING(warning_unsupported_driver_option,none,
174174
"option '%0' is ony supported in swift-driver", (StringRef))
175175

176176
WARNING(old_driver_deprecated,none,
177-
"legacy driver is now deprecated; consider avoiding specifying `%0`", (StringRef))
177+
"legacy driver is now deprecated; consider avoiding specifying '%0'", (StringRef))
178178
#define UNDEFINE_DIAGNOSTIC_MACROS
179179
#include "DefineDiagnosticMacros.h"

include/swift/AST/DiagnosticsSema.def

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1940,7 +1940,7 @@ NOTE(nonsendable_tuple_type,none,
19401940
"a tuple type must be composed of 'Sendable' elements to conform to "
19411941
"'Sendable'", ())
19421942
NOTE(non_sendable_nominal,none,
1943-
"%0 %1 does not conform to the `Sendable` protocol",
1943+
"%0 %1 does not conform to the 'Sendable' protocol",
19441944
(DescriptiveDeclKind, DeclName))
19451945
NOTE(add_nominal_sendable_conformance,none,
19461946
"consider making %0 %1 conform to the 'Sendable' protocol",
@@ -2963,7 +2963,7 @@ WARNING(differentiable_immutable_wrapper_implicit_noderivative_fixit,none,
29632963
/*nominalCanDeriveAdditiveArithmetic*/ bool))
29642964
WARNING(differentiable_let_property_implicit_noderivative_fixit,none,
29652965
"synthesis of the 'Differentiable.move(by:)' requirement for %0 "
2966-
"requires all stored properties not marked with `@noDerivative` to be "
2966+
"requires all stored properties not marked with '@noDerivative' to be "
29672967
"mutable or have a non-mutating 'move(by:)'; use 'var' instead, or "
29682968
"add an explicit '@noDerivative' attribute "
29692969
"%select{|, or conform %0 to 'AdditiveArithmetic'}1",
@@ -4536,10 +4536,10 @@ ERROR(concurrent_value_outside_source_file,none,
45364536
"%0 %1; use '@unchecked Sendable' for retroactive conformance",
45374537
(DescriptiveDeclKind, DeclName))
45384538
ERROR(concurrent_value_nonfinal_class,none,
4539-
"non-final class %0 cannot conform to `Sendable`; "
4540-
"use `@unchecked Sendable`", (DeclName))
4539+
"non-final class %0 cannot conform to 'Sendable'; "
4540+
"use '@unchecked Sendable'", (DeclName))
45414541
ERROR(concurrent_value_inherit,none,
4542-
"`Sendable` class %1 cannot inherit from another class"
4542+
"'Sendable' class %1 cannot inherit from another class"
45434543
"%select{| other than 'NSObject'}0",
45444544
(bool, DeclName))
45454545
ERROR(non_sendable_type,none,

test/AutoDiff/Sema/DerivedConformances/class_differentiable.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ class ImmutableStoredProperties<T: Differentiable & AnyObject>: Differentiable {
5757
// expected-warning @+1 {{stored property 'nondiff' has no derivative because 'Int' does not conform to 'Differentiable'; add an explicit '@noDerivative' attribute}} {{3-3=@noDerivative }}
5858
let nondiff: Int
5959

60-
// expected-warning @+1 {{synthesis of the 'Differentiable.move(by:)' requirement for 'ImmutableStoredProperties' requires all stored properties not marked with `@noDerivative` to be mutable or have a non-mutating 'move(by:)'; use 'var' instead, or add an explicit '@noDerivative' attribute}} {{3-3=@noDerivative }}
60+
// expected-warning @+1 {{synthesis of the 'Differentiable.move(by:)' requirement for 'ImmutableStoredProperties' requires all stored properties not marked with '@noDerivative' to be mutable or have a non-mutating 'move(by:)'; use 'var' instead, or add an explicit '@noDerivative' attribute}} {{3-3=@noDerivative }}
6161
let diff: Float
6262

6363
let letClass: Empty // No error on class-bound differentiable `let` with a non-mutating 'move(by:)'.
6464

6565
let letClassWithInheritedNonmutatingMoveAlong: EmptyWithInheritedNonmutatingMoveAlong
6666

67-
// expected-warning @+1 {{synthesis of the 'Differentiable.move(by:)' requirement for 'ImmutableStoredProperties' requires all stored properties not marked with `@noDerivative` to be mutable or have a non-mutating 'move(by:)'; use 'var' instead, or add an explicit '@noDerivative' attribute}} {{3-3=@noDerivative }}
67+
// expected-warning @+1 {{synthesis of the 'Differentiable.move(by:)' requirement for 'ImmutableStoredProperties' requires all stored properties not marked with '@noDerivative' to be mutable or have a non-mutating 'move(by:)'; use 'var' instead, or add an explicit '@noDerivative' attribute}} {{3-3=@noDerivative }}
6868
let letClassGeneric: T // Error due to lack of non-mutating 'move(by:)'.
6969

7070
let letClassWrappingGeneric: EmptyWrapper<T> // No error on class-bound differentiable `let` with a non-mutating 'move(by:)'.
@@ -91,7 +91,7 @@ class MutableStoredPropertiesWithInitialValue: Differentiable {
9191
}
9292
// Test class with both an empty constructor and memberwise initializer.
9393
class AllMixedStoredPropertiesHaveInitialValue: Differentiable {
94-
// expected-warning @+1 {{synthesis of the 'Differentiable.move(by:)' requirement for 'AllMixedStoredPropertiesHaveInitialValue' requires all stored properties not marked with `@noDerivative` to be mutable or have a non-mutating 'move(by:)'; use 'var' instead, or add an explicit '@noDerivative' attribute}} {{3-3=@noDerivative }}
94+
// expected-warning @+1 {{synthesis of the 'Differentiable.move(by:)' requirement for 'AllMixedStoredPropertiesHaveInitialValue' requires all stored properties not marked with '@noDerivative' to be mutable or have a non-mutating 'move(by:)'; use 'var' instead, or add an explicit '@noDerivative' attribute}} {{3-3=@noDerivative }}
9595
let x = Float(1)
9696
var y = Float(1)
9797
// Memberwise initializer should be `init(y:)` since `x` is immutable.

test/AutoDiff/Sema/DerivedConformances/struct_differentiable.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct ImmutableStoredProperties: Differentiable {
5151
// expected-warning @+1 {{stored property 'nondiff' has no derivative because 'Int' does not conform to 'Differentiable'; add an explicit '@noDerivative' attribute}} {{3-3=@noDerivative }}
5252
let nondiff: Int
5353

54-
// expected-warning @+1 {{synthesis of the 'Differentiable.move(by:)' requirement for 'ImmutableStoredProperties' requires all stored properties not marked with `@noDerivative` to be mutable or have a non-mutating 'move(by:)'; use 'var' instead, or add an explicit '@noDerivative' attribute}} {{3-3=@noDerivative }}
54+
// expected-warning @+1 {{synthesis of the 'Differentiable.move(by:)' requirement for 'ImmutableStoredProperties' requires all stored properties not marked with '@noDerivative' to be mutable or have a non-mutating 'move(by:)'; use 'var' instead, or add an explicit '@noDerivative' attribute}} {{3-3=@noDerivative }}
5555
let diff: Float
5656

5757
let nonmutatingMoveAlongStruct: EmptyWithConcreteNonmutatingMoveAlong
@@ -73,7 +73,7 @@ struct MutableStoredPropertiesWithInitialValue: Differentiable {
7373
}
7474
// Test struct with both an empty constructor and memberwise initializer.
7575
struct AllMixedStoredPropertiesHaveInitialValue: Differentiable {
76-
// expected-warning @+1 {{synthesis of the 'Differentiable.move(by:)' requirement for 'AllMixedStoredPropertiesHaveInitialValue' requires all stored properties not marked with `@noDerivative` to be mutable or have a non-mutating 'move(by:)'; use 'var' instead, or add an explicit '@noDerivative' attribute}} {{3-3=@noDerivative }}
76+
// expected-warning @+1 {{synthesis of the 'Differentiable.move(by:)' requirement for 'AllMixedStoredPropertiesHaveInitialValue' requires all stored properties not marked with '@noDerivative' to be mutable or have a non-mutating 'move(by:)'; use 'var' instead, or add an explicit '@noDerivative' attribute}} {{3-3=@noDerivative }}
7777
let x = Float(1)
7878
var y = Float(1)
7979
// Memberwise initializer should be `init(y:)` since `x` is immutable.

test/Concurrency/actor_call_implicitly_async.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func rethrower(_ f : @autoclosure () throws -> Any) rethrows -> Any {
1313
func asAutoclosure(_ f : @autoclosure () -> Any) -> Any { return f() }
1414

1515
// not a concurrency-safe type
16-
class Box { // expected-note 4{{class 'Box' does not conform to the `Sendable` protocol}}
16+
class Box { // expected-note 4{{class 'Box' does not conform to the 'Sendable' protocol}}
1717
var counter : Int = 0
1818
}
1919

test/Concurrency/actor_isolation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ actor MySuperActor {
4646
}
4747
}
4848

49-
class Point { // expected-note{{class 'Point' does not conform to the `Sendable` protocol}}
49+
class Point { // expected-note{{class 'Point' does not conform to the 'Sendable' protocol}}
5050
var x : Int = 0
5151
var y : Int = 0
5252
}

test/Concurrency/actor_isolation_unsafe.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct S4_P1: P1 {
3434
}
3535

3636
@MainActor(unsafe)
37-
protocol P2 { // expected-note{{protocol 'P2' does not conform to the `Sendable` protocol}}
37+
protocol P2 { // expected-note{{protocol 'P2' does not conform to the 'Sendable' protocol}}
3838
func f() // expected-note{{calls to instance method 'f()' from outside of its actor context are implicitly asynchronous}}
3939
nonisolated func g()
4040
}

test/Concurrency/actor_keypath_isolation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %target-typecheck-verify-swift -disable-availability-checking -warn-concurrency
22
// REQUIRES: concurrency
33

4-
class Box { // expected-note 3{{class 'Box' does not conform to the `Sendable` protocol}}
4+
class Box { // expected-note 3{{class 'Box' does not conform to the 'Sendable' protocol}}
55
let size : Int = 0
66
}
77

test/Concurrency/actor_keypath_isolation_swift6.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %target-typecheck-verify-swift -disable-availability-checking -warn-concurrency -swift-version 6
22
// REQUIRES: concurrency && asserts
33

4-
class Box { // expected-note 3{{class 'Box' does not conform to the `Sendable` protocol}}
4+
class Box { // expected-note 3{{class 'Box' does not conform to the 'Sendable' protocol}}
55
let size : Int = 0
66
}
77

test/Concurrency/concurrency_warnings.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class GlobalCounter {
88
let rs = GlobalCounter()
99
var globalInt = 17 // expected-note 2{{var declared here}}
1010

11-
class MyError: Error { // expected-warning{{non-final class 'MyError' cannot conform to `Sendable`; use `@unchecked Sendable`}}
11+
class MyError: Error { // expected-warning{{non-final class 'MyError' cannot conform to 'Sendable'; use '@unchecked Sendable'}}
1212
var storage = 0 // expected-warning{{stored property 'storage' of 'Sendable'-conforming class 'MyError' is mutable}}
1313
}
1414

0 commit comments

Comments
 (0)