Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev.

This commit is contained in:
Josh Matthews 2015-01-15 13:26:44 -05:00 committed by Glenn Watson
parent ff8cbff810
commit 95fc29fa0d
255 changed files with 3550 additions and 3362 deletions

View file

@ -31,6 +31,8 @@ use servo_util::range::{Range, RangeIndex};
use std::cmp::max;
use std::fmt;
use std::mem;
use std::num::ToPrimitive;
use std::ops::{Add, Sub, Mul, Div, Rem, Neg, Shl, Shr, Not, BitOr, BitAnd, BitXor};
use std::u16;
use style::computed_values::{text_align, vertical_align, white_space};
use style::ComputedValues;
@ -65,7 +67,7 @@ static FONT_SUPERSCRIPT_OFFSET_RATIO: f64 = 0.34;
/// with a float or a horizontal wall of the containing block. The block-start
/// inline-start corner of the green zone is the same as that of the line, but
/// the green zone can be taller and wider than the line itself.
#[deriving(Encodable, Show, Copy)]
#[derive(RustcEncodable, Show, Copy)]
pub struct Line {
/// A range of line indices that describe line breaks.
///
@ -150,7 +152,7 @@ pub struct Line {
}
int_range_index! {
#[deriving(Encodable)]
#[derive(RustcEncodable)]
#[doc = "The index of a fragment in a flattened vector of DOM elements."]
struct FragmentIndex(int)
}
@ -256,7 +258,7 @@ impl LineBreaker {
mut old_fragment_iter: I,
flow: &'a InlineFlow,
layout_context: &LayoutContext)
where I: Iterator<Fragment> {
where I: Iterator<Item=Fragment> {
loop {
// Acquire the next fragment to lay out from the work list or fragment list, as
// appropriate.
@ -305,18 +307,18 @@ impl LineBreaker {
/// Note that you probably don't want to call this method directly in order to be
/// incremental-reflow-safe; try `next_unbroken_fragment` instead.
fn next_fragment<I>(&mut self, old_fragment_iter: &mut I) -> Option<Fragment>
where I: Iterator<Fragment> {
where I: Iterator<Item=Fragment> {
if self.work_list.is_empty() {
return match old_fragment_iter.next() {
None => None,
Some(fragment) => {
debug!("LineBreaker: working with fragment from flow: {}", fragment);
debug!("LineBreaker: working with fragment from flow: {:?}", fragment);
Some(fragment)
}
}
}
debug!("LineBreaker: working with fragment from work list: {}", self.work_list.front());
debug!("LineBreaker: working with fragment from work list: {:?}", self.work_list.front());
self.work_list.pop_front()
}
@ -325,7 +327,7 @@ impl LineBreaker {
/// fragment to lay out, undoing line break operations that any previous reflows may have
/// performed. You probably want to be using this method instead of `next_fragment`.
fn next_unbroken_fragment<I>(&mut self, old_fragment_iter: &mut I) -> Option<Fragment>
where I: Iterator<Fragment> {
where I: Iterator<Item=Fragment> {
let mut result = match self.next_fragment(old_fragment_iter) {
None => return None,
Some(fragment) => fragment,
@ -342,7 +344,7 @@ impl LineBreaker {
};
let need_to_merge = match (&mut result.specific, &candidate.specific) {
(&SpecificFragmentInfo::ScannedText(ref mut result_info),
(&mut SpecificFragmentInfo::ScannedText(ref mut result_info),
&SpecificFragmentInfo::ScannedText(ref candidate_info))
if arc_ptr_eq(&result_info.run, &candidate_info.run) &&
result_info.range.end() + CharIndex(1) == candidate_info.range.begin() => {
@ -362,7 +364,7 @@ impl LineBreaker {
/// Commits a line to the list.
fn flush_current_line(&mut self) {
debug!("LineBreaker: flushing line {}: {}", self.lines.len(), self.pending_line);
debug!("LineBreaker: flushing line {}: {:?}", self.lines.len(), self.pending_line);
self.lines.push(self.pending_line);
self.cur_b = self.pending_line.bounds.start.b + self.pending_line.bounds.size.block;
self.reset_line();
@ -388,7 +390,7 @@ impl LineBreaker {
first_fragment: &Fragment,
ceiling: Au)
-> (LogicalRect<Au>, Au) {
debug!("LineBreaker: trying to place first fragment of line {}; fragment size: {}, \
debug!("LineBreaker: trying to place first fragment of line {}; fragment size: {:?}, \
splittable: {}",
self.lines.len(),
first_fragment.border_box.size,
@ -496,7 +498,7 @@ impl LineBreaker {
.expect("LineBreaker: this split case makes no sense!");
let writing_mode = self.floats.writing_mode;
let split_fragment = |split: SplitInfo| {
let split_fragment = |&:split: SplitInfo| {
let info = box ScannedTextFragmentInfo::new(run.clone(),
split.range,
(*in_fragment.newline_positions()
@ -541,7 +543,7 @@ impl LineBreaker {
self.pending_line.green_zone = line_bounds.size;
}
debug!("LineBreaker: trying to append to line {} (fragment size: {}, green zone: {}): {}",
debug!("LineBreaker: trying to append to line {} (fragment size: {:?}, green zone: {:?}): {:?}",
self.lines.len(),
fragment.border_box.size,
self.pending_line.green_zone,
@ -586,13 +588,13 @@ impl LineBreaker {
match fragment.calculate_split_position(available_inline_size,
self.pending_line_is_empty()) {
None => {
debug!("LineBreaker: fragment was unsplittable; deferring to next line: {}",
debug!("LineBreaker: fragment was unsplittable; deferring to next line: {:?}",
fragment);
self.work_list.push_front(fragment);
return false
}
Some(split_result) => {
let split_fragment = |split: SplitInfo| {
let split_fragment = |&:split: SplitInfo| {
let info = box ScannedTextFragmentInfo::new(split_result.text_run.clone(),
split.range,
Vec::new(),
@ -657,7 +659,7 @@ impl LineBreaker {
}
/// Represents a list of inline fragments, including element ranges.
#[deriving(Encodable, Clone)]
#[derive(RustcEncodable, Clone)]
pub struct InlineFragments {
/// The fragments themselves.
pub fragments: Vec<Fragment>,
@ -665,7 +667,7 @@ pub struct InlineFragments {
impl fmt::Show for InlineFragments {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.fragments)
write!(f, "{:?}", self.fragments)
}
}
@ -711,7 +713,7 @@ impl InlineFragments {
}
/// Flows for inline layout.
#[deriving(Encodable)]
#[derive(RustcEncodable)]
pub struct InlineFlow {
/// Data common to all flows.
pub base: BaseFlow,
@ -966,7 +968,7 @@ impl Flow for InlineFlow {
let mut computation = IntrinsicISizesContribution::new();
for fragment in self.fragments.fragments.iter_mut() {
debug!("Flow: measuring {}", *fragment);
debug!("Flow: measuring {:?}", *fragment);
computation.union_inline(&fragment.compute_intrinsic_inline_sizes().finish())
}
self.base.intrinsic_inline_sizes = computation.finish()
@ -982,7 +984,7 @@ impl Flow for InlineFlow {
// TODO: Combine this with `LineBreaker`'s walk in the fragment list, or put this into
// `Fragment`.
debug!("InlineFlow::assign_inline_sizes: floats in: {}", self.base.floats);
debug!("InlineFlow::assign_inline_sizes: floats in: {:?}", self.base.floats);
self.base.position.size.inline = self.base.block_container_inline_size;
@ -1022,7 +1024,7 @@ impl Flow for InlineFlow {
// element to determine its block-size for computing the line's own block-size.
//
// TODO(pcwalton): Cache the line scanner?
debug!("assign_block_size_inline: floats in: {}", self.base.floats);
debug!("assign_block_size_inline: floats in: {:?}", self.base.floats);
// Assign the block-size for the inline fragments.
let containing_block_block_size =
@ -1254,11 +1256,11 @@ impl Flow for InlineFlow {
impl fmt::Show for InlineFlow {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{} - {:x} - {}", self.class(), self.base.debug_id(), self.fragments)
write!(f, "{:?} - {:x} - {:?}", self.class(), self.base.debug_id(), self.fragments)
}
}
#[deriving(Clone)]
#[derive(Clone)]
pub struct InlineFragmentContext {
pub styles: Vec<Arc<ComputedValues>>,
}