Skip to content

Commit 3f3f814

Browse files
committed
AST: Quote attributes more consistently in DiagnosticsSIL.def
1 parent 7778268 commit 3f3f814

5 files changed

+17
-15
lines changed

include/swift/AST/DiagnosticsSIL.def

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ ERROR(deserialize_function_type_mismatch,Fatal,
143143
(StringRef, Type, Type))
144144

145145
ERROR(without_actually_escaping_on_isolated_any,none,
146-
"withoutActuallyEscaping is currently unimplemented for @isolated(any) "
146+
"withoutActuallyEscaping is currently unimplemented for '@isolated(any)' "
147147
"function values", ())
148148

149149
// Capture before declaration diagnostics.
@@ -389,9 +389,9 @@ ERROR(embedded_swift_existential_type,none,
389389
ERROR(embedded_swift_existential,none,
390390
"cannot use a value of protocol type in embedded Swift", ())
391391
ERROR(perf_diag_existential_type,none,
392-
"cannot use a value of protocol type %0 in @_noExistential function", (Type))
392+
"cannot use a value of protocol type %0 in '@_noExistential' function", (Type))
393393
ERROR(perf_diag_existential,none,
394-
"cannot use a value of protocol type in @_noExistential function", ())
394+
"cannot use a value of protocol type in '@_noExistential' function", ())
395395
ERROR(embedded_swift_value_deinit,none,
396396
"cannot de-virtualize deinit of type %0", (Type))
397397
ERROR(embedded_swift_metatype_type,none,
@@ -810,7 +810,7 @@ NOTE(capturepromotion_variable_defined_here,none,
810810

811811
// noimplicitcopy on generic or existential binding
812812
ERROR(noimplicitcopy_used_on_generic_or_existential, none,
813-
"@_noImplicitCopy can not be used on a generic or existential typed "
813+
"'@_noImplicitCopy' can not be used on a generic or existential typed "
814814
"binding or a nominal type containing such typed things", ())
815815

816816
// discard statement
@@ -865,7 +865,8 @@ ERROR(sil_movechecking_cannot_destructure_imported_nonfrozen, none,
865865
"cannot partially consume '%0' of non-frozen type %1 imported from %2",
866866
(StringRef, Type, const ModuleDecl*))
867867
ERROR(sil_movechecking_cannot_destructure_exported_usableFromInline_alwaysEmitIntoClient, none,
868-
"cannot partially consume '%0' of non-frozen usableFromInline type %1 within a function annotated @_alwaysEmitIntoClient",
868+
"cannot partially consume '%0' of non-frozen usableFromInline type %1 "
869+
"within a function annotated '@_alwaysEmitIntoClient'",
869870
(StringRef, Type))
870871
ERROR(sil_movechecking_cannot_destructure, none,
871872
"cannot partially consume '%0'",
@@ -877,7 +878,8 @@ ERROR(sil_movechecking_cannot_partially_reinit_nonfrozen, none,
877878
"cannot partially reinitialize '%0' of non-frozen type %1 imported from %2; only full reinitialization is allowed",
878879
(StringRef, Type, const ModuleDecl*))
879880
ERROR(sil_movechecking_cannot_partially_reinit_exported_usableFromInline_alwaysEmitIntoClient, none,
880-
"cannot partially reinitialize '%0' of non-frozen usableFromInline type %1 within a function annotated @_alwaysEmitIntoClient",
881+
"cannot partially reinitialize '%0' of non-frozen usableFromInline type "
882+
"%1 within a function annotated '@_alwaysEmitIntoClient'",
881883
(StringRef, Type))
882884
ERROR(sil_movechecking_cannot_partially_reinit, none,
883885
"cannot partially reinitialize '%0' after it has been consumed; only full reinitialization is allowed",

test/SILGen/noimplicitcopy_attr_arg_generic_users_banned.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,24 @@ struct MyStruct {
1010
// these are part of MyStruct.
1111
//
1212
// TODO: Make error specific for move only on struct/enum.
13-
func foo<T>(@_noImplicitCopy _ t: T) { // expected-error {{@_noImplicitCopy can not be used on a generic or existential typed binding or a nominal type containing such typed things}}
13+
func foo<T>(@_noImplicitCopy _ t: T) { // expected-error {{'@_noImplicitCopy' can not be used on a generic or existential typed binding or a nominal type containing such typed things}}
1414
}
1515
}
1616

1717
struct MyGenericStruct<T> {
18-
func foo(@_noImplicitCopy _ t: T) { // expected-error {{@_noImplicitCopy can not be used on a generic or existential typed binding or a nominal type containing such typed things}}
18+
func foo(@_noImplicitCopy _ t: T) { // expected-error {{'@_noImplicitCopy' can not be used on a generic or existential typed binding or a nominal type containing such typed things}}
1919
}
2020
}
2121

22-
func foo<T>(@_noImplicitCopy _ t: T) { // expected-error {{@_noImplicitCopy can not be used on a generic or existential typed binding or a nominal type containing such typed things}}
22+
func foo<T>(@_noImplicitCopy _ t: T) { // expected-error {{'@_noImplicitCopy' can not be used on a generic or existential typed binding or a nominal type containing such typed things}}
2323
}
2424

2525
class MyClass {
26-
func foo<T>(@_noImplicitCopy _ t: T) { // expected-error {{@_noImplicitCopy can not be used on a generic or existential typed binding or a nominal type containing such typed things}}
26+
func foo<T>(@_noImplicitCopy _ t: T) { // expected-error {{'@_noImplicitCopy' can not be used on a generic or existential typed binding or a nominal type containing such typed things}}
2727
}
2828
}
2929

3030
class MyGenericClass<T> {
31-
func foo(@_noImplicitCopy _ t: T) { // expected-error {{@_noImplicitCopy can not be used on a generic or existential typed binding or a nominal type containing such typed things}}
31+
func foo(@_noImplicitCopy _ t: T) { // expected-error {{'@_noImplicitCopy' can not be used on a generic or existential typed binding or a nominal type containing such typed things}}
3232
}
3333
}

test/SILOptimizer/moveonly_addresschecker_diagnostics_partial_consume_ufi.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ internal struct Agg_Internal_UFI : ~Copyable {
3434

3535
@_alwaysEmitIntoClient
3636
func piecewise_Agg_Internal_UFI(_ a: consuming Agg_Internal_UFI) {
37-
take(a.u1) // expected-fragile-error{{cannot partially consume 'a' of non-frozen usableFromInline type 'Agg_Internal_UFI' within a function annotated @_alwaysEmitIntoClient}}
37+
take(a.u1) // expected-fragile-error{{cannot partially consume 'a' of non-frozen usableFromInline type 'Agg_Internal_UFI' within a function annotated '@_alwaysEmitIntoClient'}}
3838
// expected-resilient-error@-1{{field 'a.u1' was consumed but not reinitialized; the field must be reinitialized during the access}}
3939
// expected-resilient-note@-2{{consumed here}}
40-
take(a.u2) // expected-fragile-error{{cannot partially consume 'a' of non-frozen usableFromInline type 'Agg_Internal_UFI' within a function annotated @_alwaysEmitIntoClient}}
40+
take(a.u2) // expected-fragile-error{{cannot partially consume 'a' of non-frozen usableFromInline type 'Agg_Internal_UFI' within a function annotated '@_alwaysEmitIntoClient'}}
4141
// expected-resilient-error@-1{{field 'a.u2' was consumed but not reinitialized; the field must be reinitialized during the access}}
4242
// expected-resilient-note@-2{{consumed here}}
4343
}

test/SILOptimizer/moveonly_checker_addressonly_fail.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ struct GenericAggregate<T> {
88
}
99

1010
func test1<T>(_ x: T) {
11-
@_noImplicitCopy let x2 = x // expected-error {{@_noImplicitCopy can not be used on a generic or existential typed binding or a nominal type containing such typed things}}
11+
@_noImplicitCopy let x2 = x // expected-error {{'@_noImplicitCopy' can not be used on a generic or existential typed binding or a nominal type containing such typed things}}
1212

1313
// These fail b/c we use an unchecked_addr_cast to convert addresses from
1414
// @moveOnly to non-@moveOnly. We should change moveonly_to_copyable to

test/SILOptimizer/performance-annotations.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ func dynamicCastNoExistential(_ a: AnyObject) -> Cl? {
485485

486486
@_noExistentials
487487
func useOfExistential() -> P {
488-
Str(x: 1) // expected-error {{cannot use a value of protocol type 'any P' in @_noExistential function}}
488+
Str(x: 1) // expected-error {{cannot use a value of protocol type 'any P' in '@_noExistential' function}}
489489
}
490490

491491
@_noExistentials

0 commit comments

Comments
 (0)