@@ -6930,30 +6930,6 @@ ERROR(wrap_invalid_attr_added_by_access_note, none,
6930
6930
6931
6931
#undef WHICH_ACCESS_NOTE
6932
6932
6933
- // Move Only diagnostics
6934
-
6935
- ERROR (experimental_moveonly_feature_can_only_be_used_when_enabled,
6936
- none, " Can not use feature when experimental move only is disabled! Pass"
6937
- " the frontend flag -enable-experimental-move-only to swift to enable "
6938
- " the usage of this language feature" , ())
6939
- ERROR(noimplicitcopy_attr_valid_only_on_local_let_params,
6940
- none, " '@_noImplicitCopy' attribute can only be applied to local lets and params" , ())
6941
- ERROR(noimplicitcopy_attr_invalid_in_generic_context,
6942
- none, " '@_noImplicitCopy' attribute cannot be applied to entities in generic contexts" , ())
6943
- ERROR(moveonly_generics, none, " move-only type %0 cannot be used with generics yet" , (Type))
6944
- ERROR(moveonly_effectful_getter,none,
6945
- " %0 of move-only type cannot be 'async' or 'throws'" , (DescriptiveDeclKind))
6946
- ERROR(noimplicitcopy_attr_not_allowed_on_moveonlytype,none,
6947
- " '@_noImplicitCopy' has no effect when applied to a move only type" , ())
6948
- ERROR(moveonly_enums_do_not_support_indirect,none,
6949
- " move-only enum %0 cannot be marked indirect or have indirect cases yet" , (Identifier))
6950
- ERROR(moveonly_cast,none,
6951
- " move-only types cannot be conditionally cast" , ())
6952
- ERROR(moveonly_failable_init,none,
6953
- " move-only types cannot have failable initializers yet" , ())
6954
- ERROR(moveonly_objc_enum_banned, none,
6955
- " @objc enums cannot be marked as move-only" , ())
6956
-
6957
6933
// ------------------------------------------------------------------------------
6958
6934
// MARK: Type inference from default expressions
6959
6935
// ------------------------------------------------------------------------------
@@ -7011,21 +6987,6 @@ ERROR(concurrency_task_to_thread_model_global_actor_annotation,none,
7011
6987
" annotating a type with a global actor %0 is not permitted within %1" ,
7012
6988
(TypeRepr*, StringRef))
7013
6989
7014
- ERROR(moveOnly_not_allowed_here,none,
7015
- " 'moveOnly' only applies to structs or enums" , ())
7016
- ERROR(consume_expression_not_passed_lvalue,none,
7017
- " 'consume' can only be applied to lvalues" , ())
7018
- ERROR(borrow_expression_not_passed_lvalue,none,
7019
- " 'borrow' can only be applied to lvalues" , ())
7020
- ERROR(copy_expression_not_passed_lvalue,none,
7021
- " 'copy' can only be applied to lvalues" , ())
7022
- ERROR(copy_expression_cannot_be_used_with_noncopyable_types,none,
7023
- " 'copy' cannot be applied to noncopyable types" , ())
7024
-
7025
- ERROR(moveOnly_requires_lexical_lifetimes,none,
7026
- " noncopyable types require lexical borrow scopes "
7027
- " (add -enable-lexical-borrow-scopes=true)" , ())
7028
-
7029
6990
// ------------------------------------------------------------------------------
7030
6991
// MARK: #_hasSymbol
7031
6992
// ------------------------------------------------------------------------------
@@ -7158,31 +7119,68 @@ NOTE(macro_expand_circular_reference_unnamed_through, none,
7158
7119
" circular reference expanding %0 macros" , (StringRef))
7159
7120
7160
7121
// ------------------------------------------------------------------------------
7161
- // MARK: Move Only Errors
7122
+ // MARK: Noncopyable Types Diagnostics
7162
7123
// ------------------------------------------------------------------------------
7163
7124
7164
- ERROR(moveonly_copyable_type_that_contains_moveonly_type , none,
7165
- " %0 %1 cannot contain a move-only type without also being move-only " ,
7125
+ ERROR(noncopyable_within_copyable , none,
7126
+ " %0 %1 cannot contain a noncopyable type without also being noncopyable " ,
7166
7127
(DescriptiveDeclKind, DeclName))
7167
- NOTE(moveonly_copyable_type_that_contains_moveonly_type_location , none,
7168
- " contained move-only %0 '%1.%2'" ,
7128
+ NOTE(noncopyable_within_copyable_location , none,
7129
+ " contained noncopyable %0 '%1.%2'" ,
7169
7130
(DescriptiveDeclKind, StringRef, StringRef))
7170
- ERROR(moveonly_cannot_conform_to_type , none,
7171
- " move-only %0 %1 cannot conform to %2" ,
7131
+ ERROR(noncopyable_cannot_conform_to_type , none,
7132
+ " noncopyable %0 %1 cannot conform to %2" ,
7172
7133
(DescriptiveDeclKind, DeclName, Type))
7173
- ERROR(moveonly_parameter_missing_ownership , none,
7134
+ ERROR(noncopyable_parameter_requires_ownership , none,
7174
7135
" noncopyable parameter must specify its ownership" , ())
7175
- ERROR(moveonly_parameter_subscript_unsupported , none,
7136
+ ERROR(noncopyable_parameter_subscript_unsupported , none,
7176
7137
" subscripts cannot have noncopyable parameters yet" , ())
7177
- NOTE(moveonly_parameter_ownership_suggestion , none,
7138
+ NOTE(noncopyable_parameter_ownership_suggestion , none,
7178
7139
" add '%0' %1" , (StringRef, StringRef))
7179
7140
ERROR(ownership_specifier_copyable,none,
7180
- " Copyable types cannot be 'consuming' or 'borrowing' yet" , ())
7141
+ " copyable types cannot be 'consuming' or 'borrowing' yet" , ())
7181
7142
ERROR(self_ownership_specifier_copyable,none,
7182
- " %0 is not yet valid on %1s in a Copyable type" ,
7143
+ " %0 is not yet valid on %1s of a copyable type" ,
7183
7144
(SelfAccessKind, DescriptiveDeclKind))
7184
7145
ERROR(ownership_specifier_nonescaping_closure,none,
7185
7146
" '%0' cannot be applied to nonescaping closure" , (StringRef))
7147
+ ERROR(noncopyable_generics, none, " noncopyable type %0 cannot be used with generics yet" , (Type))
7148
+ ERROR(noncopyable_effectful_getter,none,
7149
+ " %0 of noncopyable type cannot be 'async' or 'throws'" , (DescriptiveDeclKind))
7150
+ ERROR(noncopyable_enums_do_not_support_indirect,none,
7151
+ " noncopyable enum %0 cannot be marked indirect or have indirect cases yet" , (Identifier))
7152
+ ERROR(noncopyable_cast,none,
7153
+ " noncopyable types cannot be conditionally cast" , ())
7154
+ ERROR(noncopyable_failable_init,none,
7155
+ " noncopyable types cannot have failable initializers yet" , ())
7156
+ ERROR(noncopyable_objc_enum, none,
7157
+ " noncopyable enums cannot be marked '@objc'" , ())
7158
+ ERROR(moveOnly_not_allowed_here,none,
7159
+ " '@_moveOnly' attribute is only valid on structs or enums" , ())
7160
+ ERROR(consume_expression_not_passed_lvalue,none,
7161
+ " 'consume' can only be applied to a local binding ('let', 'var', or parameter)" , ())
7162
+ ERROR(borrow_expression_not_passed_lvalue,none,
7163
+ " 'borrow' can only be applied to a local binding ('let', 'var', or parameter)" , ())
7164
+ ERROR(copy_expression_not_passed_lvalue,none,
7165
+ " 'copy' can only be applied to a local binding ('let', 'var', or parameter)" , ())
7166
+ ERROR(copy_expression_cannot_be_used_with_noncopyable_types,none,
7167
+ " 'copy' cannot be applied to noncopyable types" , ())
7168
+
7169
+ ERROR(moveOnly_requires_lexical_lifetimes,none,
7170
+ " noncopyable types require lexical borrow scopes "
7171
+ " (add -enable-lexical-borrow-scopes=true)" , ())
7172
+
7173
+ // Experimental noncopyable feature diagnostics:
7174
+ ERROR(experimental_moveonly_feature_can_only_be_used_when_enabled,
7175
+ none, " Can not use feature when experimental move only is disabled! Pass"
7176
+ " the frontend flag -enable-experimental-move-only to swift to enable "
7177
+ " the usage of this language feature" , ())
7178
+ ERROR(noimplicitcopy_attr_valid_only_on_local_let_params,
7179
+ none, " '@_noImplicitCopy' attribute can only be applied to local lets and params" , ())
7180
+ ERROR(noimplicitcopy_attr_invalid_in_generic_context,
7181
+ none, " '@_noImplicitCopy' attribute cannot be applied to entities in generic contexts" , ())
7182
+ ERROR(noimplicitcopy_attr_not_allowed_on_moveonlytype,none,
7183
+ " '@_noImplicitCopy' has no effect when applied to a noncopyable type" , ())
7186
7184
7187
7185
// ------------------------------------------------------------------------------
7188
7186
// MARK: Runtime discoverable attributes (@runtimeMetadata)
0 commit comments