aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2015-02-12 18:58:38 +0100
committerMs2ger <ms2ger@gmail.com>2015-02-12 18:58:38 +0100
commit2b0eb98c1d0889d7966b2341528417cb3f916911 (patch)
tree337f4305f1a2012ac205b065c4908272e6d21a7a
parent31f65959818751ab0dadc18acb5a90357067c9a4 (diff)
downloadservo-2b0eb98c1d0889d7966b2341528417cb3f916911.tar.gz
servo-2b0eb98c1d0889d7966b2341528417cb3f916911.zip
Fix some warnings in layout.
-rw-r--r--components/layout/block.rs4
-rw-r--r--components/layout/css/matching.rs8
-rw-r--r--components/layout/display_list_builder.rs4
-rw-r--r--components/layout/flow.rs6
-rw-r--r--components/layout/fragment.rs2
-rw-r--r--components/layout/layout_debug.rs4
-rw-r--r--components/layout/lib.rs17
7 files changed, 28 insertions, 17 deletions
diff --git a/components/layout/block.rs b/components/layout/block.rs
index ef22c12333b..50042be38b7 100644
--- a/components/layout/block.rs
+++ b/components/layout/block.rs
@@ -63,7 +63,7 @@ use style::computed_values::{overflow, position, box_sizing, display, float};
use std::sync::Arc;
/// Information specific to floated blocks.
-#[derive(Clone, Encodable)]
+#[derive(Clone, RustcEncodable)]
pub struct FloatedBlockInfo {
/// The amount of inline size that is available for the float.
pub containing_inline_size: Au,
@@ -735,7 +735,7 @@ impl BlockFlow {
traversal.process(flow);
let cb_block_start_edge_offset = flow.generated_containing_block_rect().start.b;
- let mut descendant_offset_iter = mut_base(flow).abs_descendants.iter_with_offset();
+ let descendant_offset_iter = mut_base(flow).abs_descendants.iter_with_offset();
// Pass in the respective static y offset for each descendant.
for (ref mut descendant_link, ref y_offset) in descendant_offset_iter {
let block = descendant_link.as_block();
diff --git a/components/layout/css/matching.rs b/components/layout/css/matching.rs
index bc096e7728d..31c14804d6b 100644
--- a/components/layout/css/matching.rs
+++ b/components/layout/css/matching.rs
@@ -71,7 +71,7 @@ impl ApplicableDeclarationsCacheEntry {
impl PartialEq for ApplicableDeclarationsCacheEntry {
fn eq(&self, other: &ApplicableDeclarationsCacheEntry) -> bool {
- let this_as_query = ApplicableDeclarationsCacheQuery::new(self.declarations.as_slice());
+ let this_as_query = ApplicableDeclarationsCacheQuery::new(&*self.declarations);
this_as_query.eq(other)
}
}
@@ -79,7 +79,7 @@ impl Eq for ApplicableDeclarationsCacheEntry {}
impl<H: Hasher+Writer> Hash<H> for ApplicableDeclarationsCacheEntry {
fn hash(&self, state: &mut H) {
- let tmp = ApplicableDeclarationsCacheQuery::new(self.declarations.as_slice());
+ let tmp = ApplicableDeclarationsCacheQuery::new(&*self.declarations);
tmp.hash(state);
}
}
@@ -643,7 +643,7 @@ impl<'ln> MatchMethods for LayoutNode<'ln> {
if applicable_declarations.before.len() > 0 {
damage = damage | self.cascade_node_pseudo_element(
Some(layout_data.shared_data.style.as_ref().unwrap()),
- applicable_declarations.before.as_slice(),
+ &*applicable_declarations.before,
&mut layout_data.data.before_style,
applicable_declarations_cache,
false);
@@ -651,7 +651,7 @@ impl<'ln> MatchMethods for LayoutNode<'ln> {
if applicable_declarations.after.len() > 0 {
damage = damage | self.cascade_node_pseudo_element(
Some(layout_data.shared_data.style.as_ref().unwrap()),
- applicable_declarations.after.as_slice(),
+ &*applicable_declarations.after,
&mut layout_data.data.after_style,
applicable_declarations_cache,
false);
diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs
index c071bb5777e..beea14abca0 100644
--- a/components/layout/display_list_builder.rs
+++ b/components/layout/display_list_builder.rs
@@ -468,9 +468,7 @@ impl FragmentDisplayListBuilding for Fragment {
position_to_offset(gradient.stops[i - 1].position.unwrap(), length)
};
let (end_index, end_offset) =
- match gradient.stops
- .as_slice()
- .slice_from(i)
+ match gradient.stops[i..]
.iter()
.enumerate()
.find(|&(_, ref stop)| stop.position.is_some()) {
diff --git a/components/layout/flow.rs b/components/layout/flow.rs
index 3febac7b9b3..7b82f1d3fd9 100644
--- a/components/layout/flow.rs
+++ b/components/layout/flow.rs
@@ -638,16 +638,16 @@ impl Descendants {
/// Return an iterator over the descendant flows.
pub fn iter<'a>(&'a mut self) -> DescendantIter<'a> {
DescendantIter {
- iter: self.descendant_links.slice_from_mut(0).iter_mut(),
+ iter: self.descendant_links.iter_mut(),
}
}
/// Return an iterator over (descendant, static y offset).
pub fn iter_with_offset<'a>(&'a mut self) -> DescendantOffsetIter<'a> {
let descendant_iter = DescendantIter {
- iter: self.descendant_links.slice_from_mut(0).iter_mut(),
+ iter: self.descendant_links.iter_mut(),
};
- descendant_iter.zip(self.static_block_offsets.slice_from_mut(0).iter_mut())
+ descendant_iter.zip(self.static_block_offsets.iter_mut())
}
}
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs
index 6a27fedfe54..e50342d2e69 100644
--- a/components/layout/fragment.rs
+++ b/components/layout/fragment.rs
@@ -1484,7 +1484,7 @@ impl Fragment {
/// A helper method that uses the breaking strategy described by `slice_iterator` (at present,
/// either natural word breaking or character breaking) to split this fragment.
fn calculate_split_position_using_breaking_strategy<'a,I>(&self,
- mut slice_iterator: I,
+ slice_iterator: I,
max_inline_size: Au,
flags: SplitOptions)
-> Option<SplitResult>
diff --git a/components/layout/layout_debug.rs b/components/layout/layout_debug.rs
index c9f22460de7..9ecb6a00ea2 100644
--- a/components/layout/layout_debug.rs
+++ b/components/layout/layout_debug.rs
@@ -14,11 +14,11 @@ use serialize::json;
use std::borrow::ToOwned;
use std::cell::RefCell;
use std::old_io::File;
-use std::sync::atomic::{AtomicUint, Ordering, ATOMIC_UINT_INIT};
+use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
thread_local!(static STATE_KEY: RefCell<Option<State>> = RefCell::new(None));
-static mut DEBUG_ID_COUNTER: AtomicUint = ATOMIC_UINT_INIT;
+static mut DEBUG_ID_COUNTER: AtomicUsize = ATOMIC_USIZE_INIT;
pub struct Scope;
diff --git a/components/layout/lib.rs b/components/layout/lib.rs
index 98e88360a53..a73ea6a7a0f 100644
--- a/components/layout/lib.rs
+++ b/components/layout/lib.rs
@@ -2,12 +2,25 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#![feature(thread_local, unsafe_destructor, box_syntax, plugin, int_uint)]
+#![feature(alloc)]
+#![feature(box_syntax)]
+#![feature(collections)]
+#![feature(core)]
+#![feature(hash)]
+#![feature(int_uint)]
+#![feature(io)]
+#![feature(libc)]
+#![feature(path)]
+#![feature(plugin)]
+#![feature(rustc_private)]
+#![feature(std_misc)]
+#![feature(thread_local)]
+#![feature(unicode)]
+#![feature(unsafe_destructor)]
#![deny(unsafe_blocks)]
#![allow(unrooted_must_root)]
#![allow(missing_copy_implementations)]
-#![allow(unstable)]
#[macro_use]
extern crate log;