AST: Quote attributes more consistently in DiagnosticsSIL.def

This commit is contained in:
Anthony Latsis
2025-04-07 16:00:17 +01:00
parent 1d6ed11e46
commit 17032b6eaf
5 changed files with 17 additions and 15 deletions

View File

@@ -143,7 +143,7 @@ ERROR(deserialize_function_type_mismatch,Fatal,
(StringRef, Type, Type))
ERROR(without_actually_escaping_on_isolated_any,none,
"withoutActuallyEscaping is currently unimplemented for @isolated(any) "
"withoutActuallyEscaping is currently unimplemented for '@isolated(any)' "
"function values", ())
// Capture before declaration diagnostics.
@@ -391,9 +391,9 @@ ERROR(embedded_swift_existential_protocol,none,
ERROR(embedded_swift_existential,none,
"cannot use a value of protocol type in embedded Swift", ())
ERROR(perf_diag_existential_type,none,
"cannot use a value of protocol type %0 in @_noExistential function", (Type))
"cannot use a value of protocol type %0 in '@_noExistential' function", (Type))
ERROR(perf_diag_existential,none,
"cannot use a value of protocol type in @_noExistential function", ())
"cannot use a value of protocol type in '@_noExistential' function", ())
ERROR(embedded_swift_value_deinit,none,
"cannot de-virtualize deinit of type %0", (Type))
ERROR(embedded_swift_metatype_type,none,
@@ -824,7 +824,7 @@ NOTE(capturepromotion_variable_defined_here,none,
// noimplicitcopy on generic or existential binding
ERROR(noimplicitcopy_used_on_generic_or_existential, none,
"@_noImplicitCopy can not be used on a generic or existential typed "
"'@_noImplicitCopy' can not be used on a generic or existential typed "
"binding or a nominal type containing such typed things", ())
// discard statement
@@ -879,7 +879,8 @@ ERROR(sil_movechecking_cannot_destructure_imported_nonfrozen, none,
"cannot partially consume '%0' of non-frozen type %1 imported from %2",
(StringRef, Type, const ModuleDecl*))
ERROR(sil_movechecking_cannot_destructure_exported_usableFromInline_alwaysEmitIntoClient, none,
"cannot partially consume '%0' of non-frozen usableFromInline type %1 within a function annotated @_alwaysEmitIntoClient",
"cannot partially consume '%0' of non-frozen usableFromInline type %1 "
"within a function annotated '@_alwaysEmitIntoClient'",
(StringRef, Type))
ERROR(sil_movechecking_cannot_destructure, none,
"cannot partially consume '%0'",
@@ -891,7 +892,8 @@ ERROR(sil_movechecking_cannot_partially_reinit_nonfrozen, none,
"cannot partially reinitialize '%0' of non-frozen type %1 imported from %2; only full reinitialization is allowed",
(StringRef, Type, const ModuleDecl*))
ERROR(sil_movechecking_cannot_partially_reinit_exported_usableFromInline_alwaysEmitIntoClient, none,
"cannot partially reinitialize '%0' of non-frozen usableFromInline type %1 within a function annotated @_alwaysEmitIntoClient",
"cannot partially reinitialize '%0' of non-frozen usableFromInline type "
"%1 within a function annotated '@_alwaysEmitIntoClient'",
(StringRef, Type))
ERROR(sil_movechecking_cannot_partially_reinit, none,
"cannot partially reinitialize '%0' after it has been consumed; only full reinitialization is allowed",

View File

@@ -10,24 +10,24 @@ struct MyStruct {
// these are part of MyStruct.
//
// TODO: Make error specific for move only on struct/enum.
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}}
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}}
}
}
struct MyGenericStruct<T> {
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}}
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}}
}
}
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}}
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}}
}
class MyClass {
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}}
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}}
}
}
class MyGenericClass<T> {
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}}
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}}
}
}

View File

@@ -34,10 +34,10 @@ internal struct Agg_Internal_UFI : ~Copyable {
@_alwaysEmitIntoClient
func piecewise_Agg_Internal_UFI(_ a: consuming Agg_Internal_UFI) {
take(a.u1) // expected-fragile-error{{cannot partially consume 'a' of non-frozen usableFromInline type 'Agg_Internal_UFI' within a function annotated @_alwaysEmitIntoClient}}
take(a.u1) // expected-fragile-error{{cannot partially consume 'a' of non-frozen usableFromInline type 'Agg_Internal_UFI' within a function annotated '@_alwaysEmitIntoClient'}}
// expected-resilient-error@-1{{field 'a.u1' was consumed but not reinitialized; the field must be reinitialized during the access}}
// expected-resilient-note@-2{{consumed here}}
take(a.u2) // expected-fragile-error{{cannot partially consume 'a' of non-frozen usableFromInline type 'Agg_Internal_UFI' within a function annotated @_alwaysEmitIntoClient}}
take(a.u2) // expected-fragile-error{{cannot partially consume 'a' of non-frozen usableFromInline type 'Agg_Internal_UFI' within a function annotated '@_alwaysEmitIntoClient'}}
// expected-resilient-error@-1{{field 'a.u2' was consumed but not reinitialized; the field must be reinitialized during the access}}
// expected-resilient-note@-2{{consumed here}}
}

View File

@@ -8,7 +8,7 @@ struct GenericAggregate<T> {
}
func test1<T>(_ x: T) {
@_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}}
@_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}}
// These fail b/c we use an unchecked_addr_cast to convert addresses from
// @moveOnly to non-@moveOnly. We should change moveonly_to_copyable to

View File

@@ -485,7 +485,7 @@ func dynamicCastNoExistential(_ a: AnyObject) -> Cl? {
@_noExistentials
func useOfExistential() -> P {
Str(x: 1) // expected-error {{cannot use a value of protocol type 'any P' in @_noExistential function}}
Str(x: 1) // expected-error {{cannot use a value of protocol type 'any P' in '@_noExistential' function}}
}
@_noExistentials