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