mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
auto merge of #5262 : servo/servo/fix-warnings, r=metajack
This commit is contained in:
commit
124a78fb2e
22 changed files with 52 additions and 59 deletions
|
@ -5,7 +5,8 @@
|
|||
#![feature(box_syntax)]
|
||||
#![feature(core)]
|
||||
#![feature(int_uint)]
|
||||
#![feature(io)]
|
||||
#![feature(old_io)]
|
||||
#![feature(old_path)]
|
||||
#![feature(rustc_private)]
|
||||
#![feature(std_misc)]
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ impl ScrollingTimerProxy {
|
|||
receiver: to_scrolling_timer_receiver,
|
||||
};
|
||||
scrolling_timer.run();
|
||||
});
|
||||
}).unwrap();
|
||||
ScrollingTimerProxy {
|
||||
sender: to_scrolling_timer_sender,
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#![crate_name = "devtools"]
|
||||
#![crate_type = "rlib"]
|
||||
|
||||
#![feature(int_uint, box_syntax, io, core, rustc_private)]
|
||||
#![feature(int_uint, box_syntax, io, old_io, core, rustc_private)]
|
||||
#![feature(collections, std_misc)]
|
||||
|
||||
#![allow(non_snake_case)]
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
//! They are therefore not exactly analogous to constructs like Skia pictures, which consist of
|
||||
//! low-level drawing primitives.
|
||||
|
||||
#![deny(unsafe_blocks)]
|
||||
#![deny(unsafe_code)]
|
||||
|
||||
use display_list::optimizer::DisplayListOptimizer;
|
||||
use paint_context::{PaintContext, ToAzureRect};
|
||||
|
|
|
@ -6,10 +6,9 @@
|
|||
#![feature(box_syntax)]
|
||||
#![feature(collections)]
|
||||
#![feature(core)]
|
||||
#![feature(hash)]
|
||||
#![feature(int_uint)]
|
||||
#![cfg_attr(any(target_os="linux", target_os = "android"), feature(io))]
|
||||
#![cfg_attr(any(target_os="linux", target_os = "android"), feature(path))]
|
||||
#![cfg_attr(any(target_os="linux", target_os = "android"), feature(old_io))]
|
||||
#![cfg_attr(any(target_os="linux", target_os = "android"), feature(old_path))]
|
||||
#![feature(plugin)]
|
||||
#![feature(rustc_private)]
|
||||
#![feature(std_misc)]
|
||||
|
|
|
@ -439,7 +439,7 @@ impl WorkerThreadProxy {
|
|||
font_cache_task,
|
||||
time_profiler_chan);
|
||||
worker_thread.main();
|
||||
});
|
||||
}).unwrap();
|
||||
WorkerThreadProxy {
|
||||
receiver: from_worker_receiver,
|
||||
sender: to_worker_sender,
|
||||
|
|
|
@ -59,7 +59,7 @@ pub fn get_variations_for_family<F>(family_name: &str, mut callback: F)
|
|||
let font_set_array_ptr = &mut font_set;
|
||||
let pattern = FcPatternCreate();
|
||||
assert!(!pattern.is_null());
|
||||
let family_name_c = CString::from_slice(family_name.as_bytes());
|
||||
let family_name_c = CString::new(family_name).unwrap();
|
||||
let family_name = family_name_c.as_ptr();
|
||||
let ok = FcPatternAddString(pattern, FC_FAMILY.as_ptr() as *mut c_char, family_name as *mut FcChar8);
|
||||
assert!(ok != 0);
|
||||
|
@ -102,7 +102,7 @@ pub fn get_variations_for_family<F>(family_name: &str, mut callback: F)
|
|||
}
|
||||
|
||||
pub fn get_system_default_family(generic_name: &str) -> Option<String> {
|
||||
let generic_name_c = CString::from_slice(generic_name.as_bytes());
|
||||
let generic_name_c = CString::new(generic_name).unwrap();
|
||||
let generic_name_ptr = generic_name_c.as_ptr();
|
||||
|
||||
unsafe {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
* 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(hash)]
|
||||
#![feature(int_uint)]
|
||||
|
||||
extern crate azure;
|
||||
|
|
|
@ -5,10 +5,12 @@
|
|||
#![feature(box_syntax)]
|
||||
#![feature(collections)]
|
||||
#![feature(core)]
|
||||
#![feature(env)]
|
||||
#![feature(int_uint)]
|
||||
#![feature(io)]
|
||||
#![feature(old_io)]
|
||||
#![feature(old_path)]
|
||||
#![feature(path)]
|
||||
#![feature(path_ext)]
|
||||
#![feature(plugin)]
|
||||
#![feature(rustc_private)]
|
||||
#![feature(std_misc)]
|
||||
|
|
|
@ -14,7 +14,7 @@ pub fn new_sniffer_task() -> SnifferTask {
|
|||
let builder = Builder::new().name("SnifferManager".to_string());
|
||||
builder.spawn(move || {
|
||||
SnifferManager::new(rec).start();
|
||||
});
|
||||
}).unwrap();
|
||||
sen
|
||||
}
|
||||
|
||||
|
|
|
@ -2,17 +2,12 @@
|
|||
* 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(io)]
|
||||
|
||||
use std::old_io::process::{Command, ProcessExit, StdioContainer};
|
||||
|
||||
use std::process::Command;
|
||||
|
||||
fn main() {
|
||||
let result = Command::new("make")
|
||||
assert!(Command::new("make")
|
||||
.args(&["-f", "makefile.cargo"])
|
||||
.stdout(StdioContainer::InheritFd(1))
|
||||
.stderr(StdioContainer::InheritFd(2))
|
||||
.status()
|
||||
.unwrap();
|
||||
assert_eq!(result, ProcessExit::ExitStatus(0));
|
||||
.unwrap()
|
||||
.success());
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
* 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(core)]
|
||||
#![feature(int_uint)]
|
||||
|
||||
extern crate devtools_traits;
|
||||
|
|
|
@ -2,32 +2,33 @@
|
|||
* 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(env, old_io, old_path)]
|
||||
#![feature(io, path)]
|
||||
|
||||
use std::env;
|
||||
use std::old_path::Path;
|
||||
use std::old_io::process::{Command, ProcessExit, StdioContainer};
|
||||
use std::old_io::File;
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
use std::process::{Command, Stdio};
|
||||
use std::path::Path;
|
||||
|
||||
|
||||
fn main() {
|
||||
let python = if Command::new("python2.7").arg("--version").status() == Ok(ProcessExit::ExitStatus(0)) {
|
||||
let python = if Command::new("python2.7").arg("--version").status().unwrap().success() {
|
||||
"python2.7"
|
||||
} else {
|
||||
"python"
|
||||
};
|
||||
let style = Path::new(file!()).dir_path();
|
||||
let style = Path::new(file!()).parent().unwrap();
|
||||
let mako = style.join("Mako-0.9.1.zip");
|
||||
let template = style.join("properties.mako.rs");
|
||||
let result = Command::new(python)
|
||||
.env("PYTHONPATH", mako.as_str().unwrap())
|
||||
.env("TEMPLATE", template.as_str().unwrap())
|
||||
.env("PYTHONPATH", &mako)
|
||||
.env("TEMPLATE", &template)
|
||||
.arg("-c")
|
||||
.arg("from os import environ; from mako.template import Template; print(Template(filename=environ['TEMPLATE']).render())")
|
||||
.stderr(StdioContainer::InheritFd(2))
|
||||
.stderr(Stdio::inherit())
|
||||
.output()
|
||||
.unwrap();
|
||||
assert_eq!(result.status, ProcessExit::ExitStatus(0));
|
||||
let out = Path::new(env::var("OUT_DIR").unwrap());
|
||||
File::create(&out.join("properties.rs")).unwrap().write_all(&*result.output).unwrap();
|
||||
assert!(result.status.success());
|
||||
let out = env::var("OUT_DIR").unwrap();
|
||||
File::create(&Path::new(&out).join("properties.rs")).unwrap().write_all(&result.stdout).unwrap();
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
* 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(alloc)]
|
||||
#![feature(plugin)]
|
||||
#![feature(int_uint)]
|
||||
#![feature(box_syntax)]
|
||||
#![feature(core)]
|
||||
#![feature(std_misc)]
|
||||
#![feature(collections)]
|
||||
#![feature(rustc_private)]
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ use selectors::matching::{SelectorMap, Rule};
|
|||
use selectors::matching::DeclarationBlock as GenericDeclarationBlock;
|
||||
use selectors::parser::PseudoElement;
|
||||
use selectors::smallvec::VecLike;
|
||||
use selectors::tree::{TNode, TElement};
|
||||
use selectors::tree::TNode;
|
||||
use util::resource_files::read_resource_file;
|
||||
|
||||
use legacy::PresentationalHintSynthesis;
|
||||
|
|
|
@ -6,15 +6,20 @@
|
|||
#![feature(box_syntax)]
|
||||
#![feature(collections)]
|
||||
#![feature(core)]
|
||||
#![feature(env)]
|
||||
#![feature(exit_status)]
|
||||
#![feature(hash)]
|
||||
#![feature(int_uint)]
|
||||
#![feature(io)]
|
||||
#![feature(optin_builtin_traits)]
|
||||
#![feature(old_io)]
|
||||
#![feature(old_path)]
|
||||
#![feature(page_size)]
|
||||
#![feature(path)]
|
||||
#![feature(path_ext)]
|
||||
#![feature(plugin)]
|
||||
#![feature(rustc_private)]
|
||||
#![feature(std_misc)]
|
||||
#![feature(str_words)]
|
||||
#![feature(unicode)]
|
||||
#![feature(unsafe_destructor)]
|
||||
|
||||
|
|
|
@ -451,12 +451,12 @@ fn get_jemalloc_stat(value_name: &str) -> Option<u64> {
|
|||
// request. Without that jemalloc gives cached statistics(!) which can be
|
||||
// highly inaccurate.
|
||||
let epoch_name = "epoch";
|
||||
let epoch_c_name = CString::from_slice(epoch_name.as_bytes());
|
||||
let epoch_c_name = CString::new(epoch_name).unwrap();
|
||||
let mut epoch: u64 = 0;
|
||||
let epoch_ptr = &mut epoch as *mut _ as *mut c_void;
|
||||
let mut epoch_len = size_of::<u64>() as size_t;
|
||||
|
||||
let value_c_name = CString::from_slice(value_name.as_bytes());
|
||||
let value_c_name = CString::new(value_name).unwrap();
|
||||
let mut value: size_t = 0;
|
||||
let value_ptr = &mut value as *mut _ as *mut c_void;
|
||||
let mut value_len = size_of::<size_t>() as size_t;
|
||||
|
|
|
@ -126,7 +126,7 @@ macro_rules! int_range_index {
|
|||
|
||||
impl ::std::num::NumCast for $Self_ {
|
||||
fn from<T: ToPrimitive>(n: T) -> Option<$Self_> {
|
||||
n.to_int().map($Self_)
|
||||
n.to_isize().map($Self_)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,10 +9,10 @@ use cssparser::{self, RGBA, Color};
|
|||
use libc::c_char;
|
||||
use std::ascii::AsciiExt;
|
||||
use std::borrow::ToOwned;
|
||||
use std::ffi::c_str_to_bytes;
|
||||
use std::ffi::CStr;
|
||||
use std::iter::Filter;
|
||||
use std::num::{Int, ToPrimitive};
|
||||
use std::str::{from_utf8, CharEq, FromStr, Split};
|
||||
use std::str::{from_utf8, FromStr, Split};
|
||||
|
||||
pub type DOMString = String;
|
||||
pub type StaticCharVec = &'static [char];
|
||||
|
@ -333,5 +333,5 @@ impl Str for LowercaseString {
|
|||
/// Creates a String from the given null-terminated buffer.
|
||||
/// Panics if the buffer does not contain UTF-8.
|
||||
pub unsafe fn c_str_to_string(s: *const c_char) -> String {
|
||||
from_utf8(c_str_to_bytes(&s)).unwrap().to_owned()
|
||||
from_utf8(CStr::from_ptr(s).to_bytes()).unwrap().to_owned()
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ pub fn spawn_named<F>(name: String, f: F)
|
|||
let builder = thread::Builder::new().name(name);
|
||||
builder.spawn(move || {
|
||||
f()
|
||||
});
|
||||
}).unwrap();
|
||||
}
|
||||
|
||||
/// Arrange to send a particular message to a channel if the task fails.
|
||||
|
@ -40,7 +40,7 @@ pub fn spawn_named_with_send_on_failure<F, T>(name: &'static str,
|
|||
dest.send(msg).unwrap();
|
||||
}
|
||||
}
|
||||
});
|
||||
}).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#![feature(int_uint)]
|
||||
#![feature(core)]
|
||||
#![cfg_attr(feature = "window", feature(hash))]
|
||||
#![feature(box_syntax)]
|
||||
|
||||
#[macro_use] extern crate bitflags;
|
||||
|
|
|
@ -2,21 +2,14 @@
|
|||
* 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(env)]
|
||||
#![feature(io)]
|
||||
#![feature(old_io)]
|
||||
|
||||
use std::old_io::process::{Command, ProcessExit, StdioContainer};
|
||||
use std::process::Command;
|
||||
use std::env;
|
||||
|
||||
fn main() {
|
||||
let out_dir = env::var("OUT_DIR").unwrap();
|
||||
let result = Command::new("make")
|
||||
assert!(Command::new("make")
|
||||
.args(&["-f", "makefile.cargo"])
|
||||
.stdout(StdioContainer::InheritFd(1))
|
||||
.stderr(StdioContainer::InheritFd(2))
|
||||
.status()
|
||||
.unwrap();
|
||||
assert_eq!(result, ProcessExit::ExitStatus(0));
|
||||
println!("cargo:rustc-flags=-L native={}", out_dir);
|
||||
.unwrap()
|
||||
.success());
|
||||
println!("cargo:rustc-flags=-L native={}", env::var("OUT_DIR").unwrap());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue