about summary refs log tree commit diff
path: root/src/librustc_errors/diagnostic_builder.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustc_errors/diagnostic_builder.rs')
-rw-r--r--src/librustc_errors/diagnostic_builder.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_errors/diagnostic_builder.rs b/src/librustc_errors/diagnostic_builder.rs
index 60a68b1e496..2f16470530e 100644
--- a/src/librustc_errors/diagnostic_builder.rs
+++ b/src/librustc_errors/diagnostic_builder.rs
@@ -128,7 +128,7 @@ impl<'a> DiagnosticBuilder<'a> {
         message: &str,
         span: Option<S>,
     ) -> &mut Self {
-        let span = span.map(|s| s.into()).unwrap_or(MultiSpan::new());
+        let span = span.map(|s| s.into()).unwrap_or_else(|| MultiSpan::new());
         self.diagnostic.sub(level, message, span, None);
         self
     }
@@ -253,7 +253,7 @@ impl<'a> DiagnosticBuilder<'a> {
     pub fn span_suggestions_with_applicability(&mut self,
                                                sp: Span,
                                                msg: &str,
-                                               suggestions: Vec<String>,
+                                               suggestions: impl Iterator<Item = String>,
                                                applicability: Applicability)
                                                -> &mut Self {
         if !self.allow_suggestions {