@@ -745,97 +745,70 @@ NOTE(discard_nontrivial_implicit_storage_note,none,
745745 " type %0 implicitly contains %1 which cannot be trivially destroyed" ,
746746 (Type, Type))
747747
748- // move only checker diagnostics
749- ERROR(sil_moveonlychecker_owned_value_consumed_more_than_once, none,
748+
749+ // / Move Checking / Noncopyable types diagnostics
750+
751+ ERROR(sil_movechecking_owned_value_consumed_more_than_once, none,
750752 " '%0' consumed more than once" , (StringRef))
751- ERROR(sil_moveonlychecker_owned_value_consumed_and_used_at_same_time , none,
753+ ERROR(sil_movechecking_owned_value_consumed_and_used_at_same_time , none,
752754 " '%0' consumed and used at the same time" , (StringRef))
753- ERROR(sil_moveonlychecker_value_used_after_consume , none,
755+ ERROR(sil_movechecking_value_used_after_consume , none,
754756 " '%0' used after consume" , (StringRef))
755- ERROR(sil_moveonlychecker_guaranteed_value_consumed, none,
756- " '%0' has guaranteed ownership but was consumed" , (StringRef))
757- ERROR(sil_moveonlychecker_guaranteed_value_captured_by_closure, none,
758- " '%0' has guaranteed ownership but was consumed due to being captured by a closure" , (StringRef))
759- ERROR(sil_moveonlychecker_let_value_consumed_in_closure, none,
760- " '%0' consumed in closure. This is illegal since if the closure is invoked more than once the binding will be uninitialized on later invocations" , (StringRef))
761- ERROR(sil_moveonlychecker_inout_not_reinitialized_before_end_of_function, none,
762- " '%0' consumed but not reinitialized before end of function" , (StringRef))
763- ERROR(sil_moveonlychecker_inout_not_reinitialized_before_end_of_closure, none,
764- " '%0' consumed in closure but not reinitialized before end of closure" , (StringRef))
765- ERROR(sil_moveonlychecker_value_consumed_in_a_loop, none,
766- " '%0' consumed by a use in a loop" , (StringRef))
767- ERROR(sil_moveonlychecker_exclusivity_violation, none,
768- " '%0' has consuming use that cannot be eliminated due to a tight exclusivity scope" , (StringRef))
769- ERROR(sil_moveonlychecker_moveonly_field_consumed, none,
770- " '%0' has a move only field that was consumed before later uses" , (StringRef))
771-
772- ERROR(sil_moveonlychecker_notconsumable_but_assignable_was_consumed_classfield_let, none,
773- " '%0' was consumed but it is illegal to consume a noncopyable class let field. One can only read from it" ,
774- (StringRef))
775- ERROR(sil_moveonlychecker_notconsumable_but_assignable_was_consumed_classfield_var, none,
776- " '%0' was consumed but it is illegal to consume a noncopyable class var field. One can only read from it or assign to it" ,
777- (StringRef))
778- ERROR(sil_moveonlychecker_notconsumable_but_assignable_was_consumed_global_var, none,
779- " '%0' was consumed but it is illegal to consume a noncopyable global var. One can only read from it or assign to it" ,
780- (StringRef))
781- ERROR(sil_moveonlychecker_notconsumable_but_assignable_was_consumed_global_let, none,
782- " '%0' was consumed but it is illegal to consume a noncopyable global let. One can only read from it" ,
783- (StringRef))
784- ERROR(sil_moveonlychecker_notconsumable_but_assignable_was_consumed_escaping_var, none,
785- " '%0' was consumed but it is illegal to consume a noncopyable mutable capture of an escaping closure. One can only read from it or assign over it" ,
786- (StringRef))
787- ERROR(sil_moveonlychecker_let_capture_consumed, none,
788- " '%0' was consumed but it is illegal to consume a noncopyable immutable capture of an escaping closure. One can only read from it" , (StringRef))
789- ERROR(sil_moveonlychecker_cannot_destructure_deinit_nominal_type_self, none,
790- " Cannot partially consume '%0' since it has a user defined deinit" ,
757+ ERROR(sil_movechecking_guaranteed_value_consumed, none,
758+ " '%0' is borrowed and cannot be consumed" , (StringRef))
759+
760+ // FIXME: this diagnostic shouldn't ever be emitted now. rdar://109742587 (closures may still try to consume captures, e.g., borrowed parameters)
761+ ERROR(sil_movechecking_guaranteed_value_captured_by_closure, none,
762+ " '%0' is borrowed and cannot be consumed by closure capture" , (StringRef))
763+
764+ ERROR(sil_movechecking_capture_consumed, none,
765+ " noncopyable '%0' cannot be consumed when captured by a closure" , (StringRef))
766+ ERROR(sil_movechecking_inout_not_reinitialized_before_end_of_function, none,
767+ " missing reinitialization of inout parameter '%0' after consume" , (StringRef))
768+ ERROR(sil_movechecking_value_consumed_in_a_loop, none,
769+ " '%0' consumed in a loop" , (StringRef))
770+ ERROR(sil_movechecking_use_after_partial_consume, none,
771+ " cannot use '%0' after partial consume" , (StringRef))
772+ ERROR(sil_movechecking_notconsumable_but_assignable_was_consumed, none,
773+ " cannot consume noncopyable stored property '%0' %select{of a class|that is global}1" ,
774+ (StringRef, bool ))
775+ ERROR(sil_movechecking_cannot_destructure_has_deinit, none,
776+ " cannot partially consume '%0' when it has a deinitializer" ,
791777 (StringRef))
792- ERROR(sil_moveonlychecker_cannot_destructure_deinit_nominal_type_field, none,
793- " Cannot partially consume '%0' since it contains field '%1.%2' whose type %3 has a user defined deinit" ,
794- (StringRef, StringRef, StringRef, DeclBaseName))
795-
796- NOTE(sil_moveonlychecker_moveonly_field_consumed_here, none,
797- " move only field consumed here" , ())
798- NOTE(sil_moveonlychecker_boundary_use, none,
799- " boundary use here" , ())
800- NOTE(sil_moveonlychecker_consuming_use_here, none,
801- " consuming use here" , ())
802- NOTE(sil_moveonlychecker_other_consuming_use_here, none,
803- " other consuming use here" , ())
804- NOTE(sil_moveonlychecker_two_consuming_uses_here, none,
805- " two consuming uses here" , ())
806- NOTE(sil_moveonlychecker_consuming_and_non_consuming_uses_here, none,
807- " consuming and non-consuming uses here" , ())
808- NOTE(sil_moveonlychecker_consuming_closure_use_here, none,
809- " closure capture here" , ())
810- NOTE(sil_moveonlychecker_nonconsuming_use_here, none,
811- " non-consuming use here" , ())
812- NOTE(sil_movekillscopyablevalue_value_cyclic_consumed_in_loop_here, none,
813- " consuming in loop use here" , ())
814- NOTE(sil_moveonlychecker_deinit_here, none,
815- " deinit declared here" , ())
816-
817- ERROR(sil_moveonlychecker_not_understand_consumable_and_assignable, none,
818- " Usage of @noImplicitCopy that the move checker does not know how to "
819- " check!" , ())
820- ERROR(sil_moveonlychecker_not_understand_moveonly, none,
821- " Usage of a move only type that the move checker does not know how to "
822- " check!" , ())
823- ERROR(sil_moveonlychecker_missed_copy, none,
824- " copy of noncopyable typed value. This is a compiler bug. Please file a bug with a small example of the bug" , ())
825778
826- // move kills copyable values checker diagnostics
827- ERROR(sil_movekillscopyablevalue_value_consumed_more_than_once, none,
828- " '%0' used after being consumed" , (StringRef))
829- NOTE(sil_movekillscopyablevalue_move_here, none,
830- " consume here" , ())
831- NOTE(sil_movekillscopyablevalue_use_here, none,
832- " use here" , ())
833- NOTE(sil_movekillscopyablevalue_value_consumed_in_loop, none,
834- " consume here would occur multiple times in loop" , ())
779+ NOTE(sil_movechecking_partial_consume_here, none,
780+ " partially consumed here" , ())
781+ NOTE(sil_movechecking_consuming_use_here, none,
782+ " consumed here" , ())
783+ NOTE(sil_movechecking_consumed_again_here, none,
784+ " consumed again here" , ())
785+ NOTE(sil_movechecking_two_consuming_uses_here, none,
786+ " multiple consumes here" , ())
787+ NOTE(sil_movechecking_consuming_and_non_consuming_uses_here, none,
788+ " consumed and used here" , ())
789+ NOTE(sil_movechecking_consuming_closure_use_here, none,
790+ " closure capturing '%0' here" , (StringRef))
791+ NOTE(sil_movechecking_nonconsuming_use_here, none,
792+ " used here" , ())
793+ NOTE(sil_movechecking_consumed_in_loop_here, none,
794+ " consumed in loop here" , ())
795+ NOTE(sil_movechecking_deinit_here, none,
796+ " deinitializer declared here" , ())
797+
798+ // errors involving noncopyables that are considered to be bugs in the compiler
799+ ERROR(sil_movechecking_not_understand_consumable_and_assignable, none,
800+ " usage of no-implicit-copy value that the compiler can't verify. This is a compiler bug. Please file a bug with a small example of the bug" , ())
801+ ERROR(sil_movechecking_not_understand_moveonly, none,
802+ " usage of a noncopyable type that compiler can't verify. This is a compiler bug. Please file a bug with a small example of the bug" , ())
803+ ERROR(sil_movechecking_bug_missed_copy, none,
804+ " copy of noncopyable typed value. This is a compiler bug. Please file a bug with a small example of the bug" , ())
805+ ERROR(sil_movechecking_bug_exclusivity_violation, none,
806+ " '%0' has an unexpected exclusivity violation. This is a compiler bug. Please file a bug with a small example of the bug" , (StringRef))
835807ERROR(sil_movekillscopyablevalue_move_applied_to_unsupported_move, none,
836- " 'consume' applied to value that the compiler does not support checking " ,
808+ " 'consume' applied to value that the compiler does not support. This is a compiler bug. Please file a bug with a small example of the bug " ,
837809 ())
838810
811+
839812// Implicit inout-to-UnsafeRawPointer conversions
840813WARNING(nontrivial_to_rawpointer_conversion,none,
841814 " forming %1 to a variable of type %0; this is likely incorrect because %2 may contain "
0 commit comments