about summary refs log tree commit diff
path: root/compiler/rustc_span/src/lib.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-12-12 02:34:06 +0000
committerbors <bors@rust-lang.org>2024-12-12 02:34:06 +0000
commit903d2976fdb6ceeb65526b7555d8d1e6f8c02134 (patch)
treea2cae32f538b4205d39fd07fa877e3bd27f31d89 /compiler/rustc_span/src/lib.rs
parent1daec069fbf562f5ec22c2ab1c6aee3573348858 (diff)
parent68227a3777c7bf8ba6a69e2b8871d224504d1c31 (diff)
downloadrust-903d2976fdb6ceeb65526b7555d8d1e6f8c02134.tar.gz
rust-903d2976fdb6ceeb65526b7555d8d1e6f8c02134.zip
Auto merge of #129181 - beetrees:asm-spans, r=pnkfelix,compiler-errors
Pass end position of span through inline ASM cookie

Before this PR, only the start position of the span was passed though the inline ASM cookie to diagnostics. LLVM 19 has full support for 64-bit inline ASM cookies; this PR uses that to pass the end position of the span in the upper 32 bits, meaning inline ASM diagnostics now point at the entire line the error occurred on, not just the first character of it.
Diffstat (limited to 'compiler/rustc_span/src/lib.rs')
-rw-r--r--compiler/rustc_span/src/lib.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs
index 958d4f0c251..bd8b93bb4d1 100644
--- a/compiler/rustc_span/src/lib.rs
+++ b/compiler/rustc_span/src/lib.rs
@@ -523,6 +523,12 @@ impl SpanData {
     }
 }
 
+impl Default for SpanData {
+    fn default() -> Self {
+        Self { lo: BytePos(0), hi: BytePos(0), ctxt: SyntaxContext::root(), parent: None }
+    }
+}
+
 impl PartialOrd for Span {
     fn partial_cmp(&self, rhs: &Self) -> Option<Ordering> {
         PartialOrd::partial_cmp(&self.data(), &rhs.data())