File tree 1 file changed +7
-8
lines changed
compiler/rustc_errors/src
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -519,16 +519,15 @@ impl Diagnostic {
519
519
520
520
/// Helper for pushing to `self.suggestions`, if available (not disable).
521
521
fn push_suggestion ( & mut self , suggestion : CodeSuggestion ) {
522
- let in_derive = suggestion. substitutions . iter ( ) . any ( |subst| {
523
- subst. parts . iter ( ) . any ( |part| {
522
+ for subst in & suggestion. substitutions {
523
+ for part in & subst. parts {
524
524
let span = part. span ;
525
525
let call_site = span. ctxt ( ) . outer_expn_data ( ) . call_site ;
526
- span. in_derive_expansion ( ) && span. overlaps_or_adjacent ( call_site)
527
- } )
528
- } ) ;
529
- if in_derive {
530
- // Ignore if spans is from derive macro.
531
- return ;
526
+ if span. in_derive_expansion ( ) && span. overlaps_or_adjacent ( call_site) {
527
+ // Ignore if spans is from derive macro.
528
+ return ;
529
+ }
530
+ }
532
531
}
533
532
534
533
if let Ok ( suggestions) = & mut self . suggestions {
You can’t perform that action at this time.
0 commit comments