Upgrade rustc to d3c49d2140fc65e8bb7d7cf25bfe74dda6ce5ecf/rustc-1.0.0-dev.

This commit is contained in:
Ms2ger 2015-03-11 11:08:57 +01:00 committed by Josh Matthews
parent 65d4b12bf2
commit 5f15eb5fbf
140 changed files with 1420 additions and 1222 deletions

View file

@ -3886,26 +3886,24 @@ pub mod shorthands {
// TODO(SimonSapin): Convert this to a syntax extension rather than a Mako template.
// Maybe submit for inclusion in libstd?
mod property_bit_field {
use std::uint;
use std::mem;
pub struct PropertyBitField {
storage: [uint; (${len(LONGHANDS)} - 1 + uint::BITS) / uint::BITS]
storage: [u32; (${len(LONGHANDS)} - 1 + 32) / 32]
}
impl PropertyBitField {
#[inline]
pub fn new() -> PropertyBitField {
PropertyBitField { storage: unsafe { mem::zeroed() } }
PropertyBitField { storage: [0; (${len(LONGHANDS)} - 1 + 32) / 32] }
}
#[inline]
fn get(&self, bit: uint) -> bool {
(self.storage[bit / uint::BITS] & (1 << (bit % uint::BITS))) != 0
(self.storage[bit / 32] & (1 << (bit % 32))) != 0
}
#[inline]
fn set(&mut self, bit: uint) {
self.storage[bit / uint::BITS] |= 1 << (bit % uint::BITS)
self.storage[bit / 32] |= 1 << (bit % 32)
}
% for i, property in enumerate(LONGHANDS):
% if property.derived_from is None: