We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dc4bfcb commit 53b2acaCopy full SHA for 53b2aca
compiler/rustc_error_messages/src/lib.rs
@@ -320,18 +320,12 @@ impl MultiSpan {
320
321
/// Returns `true` if any of the primary spans are displayable.
322
pub fn has_primary_spans(&self) -> bool {
323
- self.primary_spans.iter().any(|sp| !sp.is_dummy())
+ !self.primary_spans.iter().all(|sp| sp.is_dummy())
324
}
325
326
/// Returns `true` if this contains only a dummy primary span with any hygienic context.
327
pub fn is_dummy(&self) -> bool {
328
- let mut is_dummy = true;
329
- for span in &self.primary_spans {
330
- if !span.is_dummy() {
331
- is_dummy = false;
332
- }
333
334
- is_dummy
+ self.primary_spans.iter().all(|sp| sp.is_dummy())
335
336
337
/// Replaces all occurrences of one Span with another. Used to move `Span`s in areas that don't
0 commit comments