diff options
| author | Ralf Jung <post@ralfj.de> | 2025-04-02 22:22:18 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-02 22:22:18 +0000 |
| commit | 5103bdeb29d7aa4d7ad4d811893c76baa8a98ab7 (patch) | |
| tree | c989d04f4bcd32bcd93ed62208af68e1dbe36b6d /compiler/rustc_errors/src | |
| parent | 4858c3fe7d1a9a7484db4998199f6deb1e05185a (diff) | |
| parent | e435ba32d85057070dba3f07fa8afd96799a0cfb (diff) | |
| download | rust-5103bdeb29d7aa4d7ad4d811893c76baa8a98ab7.tar.gz rust-5103bdeb29d7aa4d7ad4d811893c76baa8a98ab7.zip | |
Merge pull request #4245 from RalfJung/rustup
Rustup
Diffstat (limited to 'compiler/rustc_errors/src')
| -rw-r--r-- | compiler/rustc_errors/src/snippet.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/compiler/rustc_errors/src/snippet.rs b/compiler/rustc_errors/src/snippet.rs index 8485d7087cf..f09c2ed5534 100644 --- a/compiler/rustc_errors/src/snippet.rs +++ b/compiler/rustc_errors/src/snippet.rs @@ -159,11 +159,7 @@ impl Annotation { /// Length of this annotation as displayed in the stderr output pub(crate) fn len(&self) -> usize { // Account for usize underflows - if self.end_col.display > self.start_col.display { - self.end_col.display - self.start_col.display - } else { - self.start_col.display - self.end_col.display - } + self.end_col.display.abs_diff(self.start_col.display) } pub(crate) fn has_label(&self) -> bool { |
