From 53c2ed4274201780265c0a9d270599b26969c5a2 Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Tue, 18 Aug 2015 13:24:28 -0700 Subject: [PATCH] Fix bug resizing attribute vec --- syntex_syntax/Cargo.toml | 2 +- syntex_syntax/src/attr.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/syntex_syntax/Cargo.toml b/syntex_syntax/Cargo.toml index 14e0296c..8b8cb6fe 100644 --- a/syntex_syntax/Cargo.toml +++ b/syntex_syntax/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "syntex_syntax" -version = "0.11.0" +version = "0.11.1" authors = [ "erick.tryzelaar@gmail.com" ] license = "MIT/Apache-2.0" description = "Export of libsyntax for code generation" diff --git a/syntex_syntax/src/attr.rs b/syntex_syntax/src/attr.rs index 72a53e6a..e93a13b7 100644 --- a/syntex_syntax/src/attr.rs +++ b/syntex_syntax/src/attr.rs @@ -39,8 +39,8 @@ pub fn mark_used(attr: &Attribute) { let idx = (id / 64) as usize; let shift = id % 64; if slot.borrow().len() <= idx { - slot.borrow_mut().extend( - (slot.borrow().len() .. idx).map(|_| 0)); + let len = slot.borrow().len(); + slot.borrow_mut().extend((0 .. (idx + 1 - len)).map(|_| 0)); } slot.borrow_mut()[idx] |= 1 << shift; });