@@ -6907,30 +6907,6 @@ ERROR(wrap_invalid_attr_added_by_access_note, none,
6907
6907
6908
6908
#undef WHICH_ACCESS_NOTE
6909
6909
6910
- // Move Only diagnostics
6911
-
6912
- ERROR (experimental_moveonly_feature_can_only_be_used_when_enabled,
6913
- none, " Can not use feature when experimental move only is disabled! Pass"
6914
- " the frontend flag -enable-experimental-move-only to swift to enable "
6915
- " the usage of this language feature" , ())
6916
- ERROR(noimplicitcopy_attr_valid_only_on_local_let_params,
6917
- none, " '@_noImplicitCopy' attribute can only be applied to local lets and params" , ())
6918
- ERROR(noimplicitcopy_attr_invalid_in_generic_context,
6919
- none, " '@_noImplicitCopy' attribute cannot be applied to entities in generic contexts" , ())
6920
- ERROR(moveonly_generics, none, " move-only type %0 cannot be used with generics yet" , (Type))
6921
- ERROR(moveonly_effectful_getter,none,
6922
- " %0 of move-only type cannot be 'async' or 'throws'" , (DescriptiveDeclKind))
6923
- ERROR(noimplicitcopy_attr_not_allowed_on_moveonlytype,none,
6924
- " '@_noImplicitCopy' has no effect when applied to a move only type" , ())
6925
- ERROR(moveonly_enums_do_not_support_indirect,none,
6926
- " move-only enum %0 cannot be marked indirect or have indirect cases yet" , (Identifier))
6927
- ERROR(moveonly_cast,none,
6928
- " move-only types cannot be conditionally cast" , ())
6929
- ERROR(moveonly_failable_init,none,
6930
- " move-only types cannot have failable initializers yet" , ())
6931
- ERROR(moveonly_objc_enum_banned, none,
6932
- " @objc enums cannot be marked as move-only" , ())
6933
-
6934
6910
// ------------------------------------------------------------------------------
6935
6911
// MARK: Type inference from default expressions
6936
6912
// ------------------------------------------------------------------------------
@@ -6988,21 +6964,6 @@ ERROR(concurrency_task_to_thread_model_global_actor_annotation,none,
6988
6964
" annotating a type with a global actor %0 is not permitted within %1" ,
6989
6965
(TypeRepr*, StringRef))
6990
6966
6991
- ERROR(moveOnly_not_allowed_here,none,
6992
- " 'moveOnly' only applies to structs or enums" , ())
6993
- ERROR(consume_expression_not_passed_lvalue,none,
6994
- " 'consume' can only be applied to lvalues" , ())
6995
- ERROR(borrow_expression_not_passed_lvalue,none,
6996
- " 'borrow' can only be applied to lvalues" , ())
6997
- ERROR(copy_expression_not_passed_lvalue,none,
6998
- " 'copy' can only be applied to lvalues" , ())
6999
- ERROR(copy_expression_cannot_be_used_with_noncopyable_types,none,
7000
- " 'copy' cannot be applied to noncopyable types" , ())
7001
-
7002
- ERROR(moveOnly_requires_lexical_lifetimes,none,
7003
- " noncopyable types require lexical borrow scopes "
7004
- " (add -enable-lexical-borrow-scopes=true)" , ())
7005
-
7006
6967
// ------------------------------------------------------------------------------
7007
6968
// MARK: #_hasSymbol
7008
6969
// ------------------------------------------------------------------------------
@@ -7135,31 +7096,68 @@ NOTE(macro_expand_circular_reference_unnamed_through, none,
7135
7096
" circular reference expanding %0 macros" , (StringRef))
7136
7097
7137
7098
// ------------------------------------------------------------------------------
7138
- // MARK: Move Only Errors
7099
+ // MARK: Noncopyable Types Diagnostics
7139
7100
// ------------------------------------------------------------------------------
7140
7101
7141
- ERROR(moveonly_copyable_type_that_contains_moveonly_type , none,
7142
- " %0 %1 cannot contain a move-only type without also being move-only " ,
7102
+ ERROR(noncopyable_within_copyable , none,
7103
+ " %0 %1 cannot contain a noncopyable type without also being noncopyable " ,
7143
7104
(DescriptiveDeclKind, DeclName))
7144
- NOTE(moveonly_copyable_type_that_contains_moveonly_type_location , none,
7145
- " contained move-only %0 '%1.%2'" ,
7105
+ NOTE(noncopyable_within_copyable_location , none,
7106
+ " contained noncopyable %0 '%1.%2'" ,
7146
7107
(DescriptiveDeclKind, StringRef, StringRef))
7147
- ERROR(moveonly_cannot_conform_to_type , none,
7148
- " move-only %0 %1 cannot conform to %2" ,
7108
+ ERROR(noncopyable_cannot_conform_to_type , none,
7109
+ " noncopyable %0 %1 cannot conform to %2" ,
7149
7110
(DescriptiveDeclKind, DeclName, Type))
7150
- ERROR(moveonly_parameter_missing_ownership , none,
7111
+ ERROR(noncopyable_parameter_requires_ownership , none,
7151
7112
" noncopyable parameter must specify its ownership" , ())
7152
- ERROR(moveonly_parameter_subscript_unsupported , none,
7113
+ ERROR(noncopyable_parameter_subscript_unsupported , none,
7153
7114
" subscripts cannot have noncopyable parameters yet" , ())
7154
- NOTE(moveonly_parameter_ownership_suggestion , none,
7115
+ NOTE(noncopyable_parameter_ownership_suggestion , none,
7155
7116
" add '%0' %1" , (StringRef, StringRef))
7156
7117
ERROR(ownership_specifier_copyable,none,
7157
- " Copyable types cannot be 'consuming' or 'borrowing' yet" , ())
7118
+ " copyable types cannot be 'consuming' or 'borrowing' yet" , ())
7158
7119
ERROR(self_ownership_specifier_copyable,none,
7159
- " %0 is not yet valid on %1s in a Copyable type" ,
7120
+ " %0 is not yet valid on %1s of a copyable type" ,
7160
7121
(SelfAccessKind, DescriptiveDeclKind))
7161
7122
ERROR(ownership_specifier_nonescaping_closure,none,
7162
7123
" '%0' cannot be applied to nonescaping closure" , (StringRef))
7124
+ ERROR(noncopyable_generics, none, " noncopyable type %0 cannot be used with generics yet" , (Type))
7125
+ ERROR(noncopyable_effectful_getter,none,
7126
+ " %0 of noncopyable type cannot be 'async' or 'throws'" , (DescriptiveDeclKind))
7127
+ ERROR(noncopyable_enums_do_not_support_indirect,none,
7128
+ " noncopyable enum %0 cannot be marked indirect or have indirect cases yet" , (Identifier))
7129
+ ERROR(noncopyable_cast,none,
7130
+ " noncopyable types cannot be conditionally cast" , ())
7131
+ ERROR(noncopyable_failable_init,none,
7132
+ " noncopyable types cannot have failable initializers yet" , ())
7133
+ ERROR(noncopyable_objc_enum, none,
7134
+ " noncopyable enums cannot be marked '@objc'" , ())
7135
+ ERROR(moveOnly_not_allowed_here,none,
7136
+ " '@_moveOnly' attribute is only valid on structs or enums" , ())
7137
+ ERROR(consume_expression_not_passed_lvalue,none,
7138
+ " 'consume' can only be applied to a local binding ('let', 'var', or parameter)" , ())
7139
+ ERROR(borrow_expression_not_passed_lvalue,none,
7140
+ " 'borrow' can only be applied to a local binding ('let', 'var', or parameter)" , ())
7141
+ ERROR(copy_expression_not_passed_lvalue,none,
7142
+ " 'copy' can only be applied to a local binding ('let', 'var', or parameter)" , ())
7143
+ ERROR(copy_expression_cannot_be_used_with_noncopyable_types,none,
7144
+ " 'copy' cannot be applied to noncopyable types" , ())
7145
+
7146
+ ERROR(moveOnly_requires_lexical_lifetimes,none,
7147
+ " noncopyable types require lexical borrow scopes "
7148
+ " (add -enable-lexical-borrow-scopes=true)" , ())
7149
+
7150
+ // Experimental noncopyable feature diagnostics:
7151
+ ERROR(experimental_moveonly_feature_can_only_be_used_when_enabled,
7152
+ none, " Can not use feature when experimental move only is disabled! Pass"
7153
+ " the frontend flag -enable-experimental-move-only to swift to enable "
7154
+ " the usage of this language feature" , ())
7155
+ ERROR(noimplicitcopy_attr_valid_only_on_local_let_params,
7156
+ none, " '@_noImplicitCopy' attribute can only be applied to local lets and params" , ())
7157
+ ERROR(noimplicitcopy_attr_invalid_in_generic_context,
7158
+ none, " '@_noImplicitCopy' attribute cannot be applied to entities in generic contexts" , ())
7159
+ ERROR(noimplicitcopy_attr_not_allowed_on_moveonlytype,none,
7160
+ " '@_noImplicitCopy' has no effect when applied to a noncopyable type" , ())
7163
7161
7164
7162
// ------------------------------------------------------------------------------
7165
7163
// MARK: Runtime discoverable attributes (@runtimeMetadata)
0 commit comments