File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
compiler/rustc_errors/src Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -777,15 +777,15 @@ impl Diagnostic {
777777 applicability : Applicability ,
778778 style : SuggestionStyle ,
779779 ) -> & mut Self {
780- let suggestions: Vec < _ > = suggestions. into_iter ( ) . collect ( ) ;
781- debug_assert ! (
782- !( sp. is_empty( ) && suggestions. iter( ) . any( |suggestion| suggestion. is_empty( ) ) ) ,
783- "Span must not be empty and have no suggestion"
784- ) ;
785-
786780 let substitutions = suggestions
787781 . into_iter ( )
788- . map ( |snippet| Substitution { parts : vec ! [ SubstitutionPart { snippet, span: sp } ] } )
782+ . map ( |snippet| {
783+ debug_assert ! (
784+ !( sp. is_empty( ) && snippet. is_empty( ) ) ,
785+ "Span must not be empty and have no suggestion"
786+ ) ;
787+ Substitution { parts : vec ! [ SubstitutionPart { snippet, span: sp } ] }
788+ } )
789789 . collect ( ) ;
790790 self . push_suggestion ( CodeSuggestion {
791791 substitutions,
You can’t perform that action at this time.
0 commit comments