Skip to content

Commit 1d970c3

Browse files
committed
Using the is_empty method of a span
1 parent da10a05 commit 1d970c3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/rustc_errors/src/diagnostic.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ impl Diagnostic {
568568
) -> &mut Self {
569569
assert!(!suggestion.is_empty());
570570
debug_assert!(
571-
!(suggestion.iter().any(|(sp, text)| sp.lo() == sp.hi() && text.is_empty())),
571+
!(suggestion.iter().any(|(sp, text)| sp.is_empty() && text.is_empty())),
572572
"Span must not be empty and have no suggestion"
573573
);
574574

@@ -650,7 +650,7 @@ impl Diagnostic {
650650
style: SuggestionStyle,
651651
) -> &mut Self {
652652
debug_assert!(
653-
!(sp.lo() == sp.hi() && suggestion.to_string().is_empty()),
653+
!(sp.is_empty() && suggestion.to_string().is_empty()),
654654
"Span must not be empty and have no suggestion"
655655
);
656656
self.push_suggestion(CodeSuggestion {
@@ -695,7 +695,7 @@ impl Diagnostic {
695695
suggestions.sort();
696696

697697
debug_assert!(
698-
!(sp.lo() == sp.hi() && suggestions.iter().any(|suggestion| suggestion.is_empty())),
698+
!(sp.is_empty() && suggestions.iter().any(|suggestion| suggestion.is_empty())),
699699
"Span must not be empty and have no suggestion"
700700
);
701701

@@ -725,7 +725,7 @@ impl Diagnostic {
725725
!(suggestions
726726
.iter()
727727
.flat_map(|suggs| suggs)
728-
.any(|(sp, suggestion)| sp.lo() == sp.hi() && suggestion.is_empty())),
728+
.any(|(sp, suggestion)| sp.is_empty() && suggestion.is_empty())),
729729
"Span must not be empty and have no suggestion"
730730
);
731731

0 commit comments

Comments
 (0)