aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-02-12 11:06:50 -0700
committerbors-servo <metajack+bors@gmail.com>2015-02-12 11:06:50 -0700
commitfab80925818e53bfb92ffa2684a6834bb9f70f29 (patch)
treee5154fd6a2e60fc9ff64525558532bb0d2fae93d
parent29d24a5049cda10111bb36f3ca2d798e68137107 (diff)
parent2b0eb98c1d0889d7966b2341528417cb3f916911 (diff)
downloadservo-fab80925818e53bfb92ffa2684a6834bb9f70f29.tar.gz
servo-fab80925818e53bfb92ffa2684a6834bb9f70f29.zip
auto merge of #4902 : servo/servo/warnings, r=jdm
-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
-rw-r--r--components/servo/lib.rs13
-rw-r--r--components/servo/main.rs10
9 files changed, 38 insertions, 30 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;
diff --git a/components/servo/lib.rs b/components/servo/lib.rs
index 005514b5757..903beab52f3 100644
--- a/components/servo/lib.rs
+++ b/components/servo/lib.rs
@@ -2,10 +2,9 @@
* 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)]
+#![feature(core, env, libc, path, rustc_private, std_misc, thread_local)]
#![allow(missing_copy_implementations)]
-#![allow(unstable)]
#[macro_use]
extern crate log;
@@ -52,8 +51,6 @@ use util::opts;
use util::taskpool::TaskPool;
#[cfg(not(test))]
-use std::os;
-#[cfg(not(test))]
use std::rc::Rc;
#[cfg(not(test))]
use std::sync::mpsc::channel;
@@ -67,6 +64,8 @@ pub struct Browser<Window> {
impl<Window> Browser<Window> where Window: WindowMethods + 'static {
#[cfg(not(test))]
pub fn new(window: Option<Rc<Window>>) -> Browser<Window> {
+ use std::env;
+
::util::opts::set_experimental_enabled(opts::get().enable_experimental);
let opts = opts::get();
RegisterBindings::RegisterProxyHandlers();
@@ -112,12 +111,12 @@ impl<Window> Browser<Window> where Window: WindowMethods + 'static {
storage_task);
// Send the URL command to the constellation.
- let cwd = os::getcwd().unwrap();
+ let cwd = env::current_dir().unwrap();
for url in opts.urls.iter() {
- let url = match url::Url::parse(url.as_slice()) {
+ let url = match url::Url::parse(&*url) {
Ok(url) => url,
Err(url::ParseError::RelativeUrlWithoutBase)
- => url::Url::from_file_path(&cwd.join(url.as_slice())).unwrap(),
+ => url::Url::from_file_path(&cwd.join(&*url)).unwrap(),
Err(_) => panic!("URL parsing failed"),
};
diff --git a/components/servo/main.rs b/components/servo/main.rs
index b8bcb0f77fa..1e7683a9e06 100644
--- a/components/servo/main.rs
+++ b/components/servo/main.rs
@@ -2,7 +2,7 @@
* 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/. */
-#![allow(unstable)]
+#![feature(env, os)]
#[cfg(target_os="android")]
extern crate libc;
@@ -39,9 +39,6 @@ use compositing::windowing::WindowEvent;
#[cfg(target_os="android")]
use std::borrow::ToOwned;
-#[cfg(not(any(test,target_os="android")))]
-use std::os;
-
#[cfg(not(test))]
struct BrowserWrapper {
browser: Browser<app::window::Window>,
@@ -60,7 +57,8 @@ fn get_args() -> Vec<String> {
#[cfg(not(target_os="android"))]
fn get_args() -> Vec<String> {
- os::args()
+ use std::env;
+ env::args().map(|s| s.into_string().unwrap()).collect()
}
#[cfg(target_os="android")]
@@ -113,7 +111,7 @@ fn setup_logging() {
}
fn main() {
- if opts::from_cmdline_args(get_args().as_slice()) {
+ if opts::from_cmdline_args(&*get_args()) {
setup_logging();
resource_task::global_init();