about summary refs log tree commit diff
path: root/src/librustc_data_structures
diff options
context:
space:
mode:
authorOliver Schneider <github35764891676564198441@oli-obk.de>2018-09-10 14:40:12 +0200
committerOliver Schneider <github35764891676564198441@oli-obk.de>2018-09-11 11:27:12 +0200
commit24dca6aecaded209d47aba6e60e0b87eae2d49d6 (patch)
tree39726bfb02de0d85cc0acc0fd03fc0681c894b5c /src/librustc_data_structures
parent88ebb95f46c077baf165c9d2b174f90e5d369854 (diff)
Simplify Scope/ScopeData to have less chance of introducing UB or size increases
Diffstat (limited to 'src/librustc_data_structures')
-rw-r--r--src/librustc_data_structures/indexed_vec.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/librustc_data_structures/indexed_vec.rs b/src/librustc_data_structures/indexed_vec.rs
index 0b5fb97f0e1..2f11fea46d6 100644
--- a/src/librustc_data_structures/indexed_vec.rs
+++ b/src/librustc_data_structures/indexed_vec.rs
@@ -72,7 +72,8 @@ macro_rules! newtype_index {
         newtype_index!(
             // Leave out derives marker so we can use its absence to ensure it comes first
             @type         [$name]
-            @max          [0xFFFF_FFFE]
+            // shave off 256 indices at the end to allow space for packing these indices into enums
+            @max          [0xFFFF_FF00]
             @vis          [$v]
             @debug_format ["{}"]);
     );
@@ -82,7 +83,8 @@ macro_rules! newtype_index {
         newtype_index!(
             // Leave out derives marker so we can use its absence to ensure it comes first
             @type         [$name]
-            @max          [0xFFFF_FFFE]
+            // shave off 256 indices at the end to allow space for packing these indices into enums
+            @max          [0xFFFF_FF00]
             @vis          [$v]
             @debug_format ["{}"]
                           $($tokens)+);