diff options
Diffstat (limited to 'src/librustc_errors')
| -rw-r--r-- | src/librustc_errors/annotate_snippet_emitter_writer.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/librustc_errors/annotate_snippet_emitter_writer.rs b/src/librustc_errors/annotate_snippet_emitter_writer.rs index 5b47364e714..265ba59cccb 100644 --- a/src/librustc_errors/annotate_snippet_emitter_writer.rs +++ b/src/librustc_errors/annotate_snippet_emitter_writer.rs @@ -159,14 +159,10 @@ impl AnnotateSnippetEmitterWriter { // FIXME(#59346): Not really sure when `fold` should be true or false fold: false, annotations: annotations - .into_iter() + .iter() .map(|annotation| SourceAnnotation { range: (annotation.start_col, annotation.end_col), - label: annotation - .label - .as_ref() - .map(|s| s.as_str()) - .unwrap_or_default(), + label: annotation.label.as_deref().unwrap_or_default(), annotation_type: annotation_type_for_level(*level), }) .collect(), |
