From 706c767203ae98321c0c40cfcf2f7db8a9c73611 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sat, 17 Apr 2021 17:21:49 +0200 Subject: [PATCH] Allow longer spans in the short format. --- compiler/rustc_span/src/span_encoding.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_span/src/span_encoding.rs b/compiler/rustc_span/src/span_encoding.rs index ceb9b59b13ad1..faf92fc0fc1c3 100644 --- a/compiler/rustc_span/src/span_encoding.rs +++ b/compiler/rustc_span/src/span_encoding.rs @@ -62,8 +62,8 @@ pub struct Span { ctxt_or_zero: u16, } -const LEN_TAG: u16 = 0b1000_0000_0000_0000; -const MAX_LEN: u32 = 0b0111_1111_1111_1111; +const LEN_TAG: u16 = 0b1111_1111_1111_1111; +const MAX_LEN: u32 = (LEN_TAG as u32) - 1; const MAX_CTXT: u32 = 0b1111_1111_1111_1111; /// Dummy span, both position and length are zero, syntax context is zero as well.