about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-03-28 06:28:48 +0000
committerbors <bors@rust-lang.org>2025-03-28 06:28:48 +0000
commite77a8f439cc87c5d67b007e9811578533de1de91 (patch)
tree61ed07fb4f969f80703432b0c0cebee9d7a1a7a8 /compiler/rustc_errors/src
parent3f690c2257b7080cd3a8cce64e082fc972148990 (diff)
parent63718922df76dac4be1c6d5d5e24867f090f7de0 (diff)
downloadrust-e77a8f439cc87c5d67b007e9811578533de1de91.tar.gz
rust-e77a8f439cc87c5d67b007e9811578533de1de91.zip
Auto merge of #139037 - jhpratt:rollup-4c74y8a, r=jhpratt
Rollup of 6 pull requests

Successful merges:

 - #138720 (Specify a concrete stack size in channel tests)
 - #139010 (Improve `xcrun` error handling)
 - #139021 (std: get rid of pre-Vista fallback code)
 - #139025 (Do not trim paths in MIR validator)
 - #139026 (Use `abs_diff` where applicable)
 - #139030 (saethlin goes on vacation)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_errors/src')
-rw-r--r--compiler/rustc_errors/src/snippet.rs6
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 {