Auto merge of #26071 - servo:rustup, r=nox

Upgrade to rustc 1.44.0-nightly (42abbd887 2020-04-07)

~Blocked on https://github.com/rust-lang/rust/issues/70280~
This commit is contained in:
bors-servo 2020-04-10 00:37:54 -04:00 committed by GitHub
commit 9fd668488e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 40 additions and 56 deletions

View file

@ -3,5 +3,5 @@ std = { features = ["panic-unwind"] }
# https://github.com/rust-lang/rust/issues/65313 # https://github.com/rust-lang/rust/issues/65313
[target.aarch64-uwp-windows-msvc.dependencies] [target.aarch64-uwp-windows-msvc.dependencies]
std = {} std = { features = ["panic-unwind"] }

View file

@ -15,7 +15,7 @@ use servo_config::opts;
use std::fmt; use std::fmt;
lazy_static! { lazy_static! {
static ref IS_MULTIPROCESS: bool = { opts::multiprocess() }; static ref IS_MULTIPROCESS: bool = opts::multiprocess();
} }
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize)]

View file

@ -13,7 +13,7 @@ use servo_config::opts;
use std::fmt; use std::fmt;
lazy_static! { lazy_static! {
static ref IS_MULTIPROCESS: bool = { opts::multiprocess() }; static ref IS_MULTIPROCESS: bool = opts::multiprocess();
} }
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize)]

View file

@ -55,7 +55,7 @@ use tokio::prelude::{future, Future, Stream};
use tokio::runtime::Runtime; use tokio::runtime::Runtime;
lazy_static! { lazy_static! {
pub static ref HANDLE: Mutex<Runtime> = { Mutex::new(Runtime::new().unwrap()) }; pub static ref HANDLE: Mutex<Runtime> = Mutex::new(Runtime::new().unwrap());
} }
/// The various states an entry of the HttpCache can be in. /// The various states an entry of the HttpCache can be in.

View file

@ -51,7 +51,7 @@ use tokio::runtime::Runtime;
use tokio_openssl::SslAcceptorExt; use tokio_openssl::SslAcceptorExt;
lazy_static! { lazy_static! {
pub static ref HANDLE: Mutex<Runtime> = { Mutex::new(Runtime::new().unwrap()) }; pub static ref HANDLE: Mutex<Runtime> = Mutex::new(Runtime::new().unwrap());
} }
const DEFAULT_USER_AGENT: &'static str = "Such Browser. Very Layout. Wow."; const DEFAULT_USER_AGENT: &'static str = "Such Browser. Very Layout. Wow.";

View file

@ -2017,11 +2017,11 @@ impl ScriptThread {
// occurs for the rest of the messages // occurs for the rest of the messages
match msg { match msg {
WebDriverScriptCommand::ExecuteScript(script, reply) => { WebDriverScriptCommand::ExecuteScript(script, reply) => {
let window = { self.documents.borrow().find_window(pipeline_id) }; let window = self.documents.borrow().find_window(pipeline_id);
return webdriver_handlers::handle_execute_script(window, script, reply); return webdriver_handlers::handle_execute_script(window, script, reply);
}, },
WebDriverScriptCommand::ExecuteAsyncScript(script, reply) => { WebDriverScriptCommand::ExecuteAsyncScript(script, reply) => {
let window = { self.documents.borrow().find_window(pipeline_id) }; let window = self.documents.borrow().find_window(pipeline_id);
return webdriver_handlers::handle_execute_async_script(window, script, reply); return webdriver_handlers::handle_execute_async_script(window, script, reply);
}, },
_ => (), _ => (),
@ -2289,7 +2289,7 @@ impl ScriptThread {
id: PipelineId, id: PipelineId,
scroll_states: &[(UntrustedNodeAddress, Vector2D<f32, LayoutPixel>)], scroll_states: &[(UntrustedNodeAddress, Vector2D<f32, LayoutPixel>)],
) { ) {
let window = match { self.documents.borrow().find_window(id) } { let window = match self.documents.borrow().find_window(id) {
Some(window) => window, Some(window) => window,
None => { None => {
return warn!( return warn!(
@ -2696,7 +2696,7 @@ impl ScriptThread {
Some(r) => r, Some(r) => r,
None => return, None => return,
}; };
let window = match { self.documents.borrow().find_window(pipeline_id) } { let window = match self.documents.borrow().find_window(pipeline_id) {
Some(window) => window, Some(window) => window,
None => return warn!("Registration failed for {}", scope), None => return warn!("Registration failed for {}", scope),
}; };
@ -2775,7 +2775,7 @@ impl ScriptThread {
/// Handles a request for the window title. /// Handles a request for the window title.
fn handle_get_title_msg(&self, pipeline_id: PipelineId) { fn handle_get_title_msg(&self, pipeline_id: PipelineId) {
let document = match { self.documents.borrow().find_document(pipeline_id) } { let document = match self.documents.borrow().find_document(pipeline_id) {
Some(document) => document, Some(document) => document,
None => return warn!("Message sent to closed pipeline {}.", pipeline_id), None => return warn!("Message sent to closed pipeline {}.", pipeline_id),
}; };
@ -2892,7 +2892,7 @@ impl ScriptThread {
/// Handles when layout thread finishes all animation in one tick /// Handles when layout thread finishes all animation in one tick
fn handle_tick_all_animations(&self, id: PipelineId) { fn handle_tick_all_animations(&self, id: PipelineId) {
let document = match { self.documents.borrow().find_document(id) } { let document = match self.documents.borrow().find_document(id) {
Some(document) => document, Some(document) => document,
None => return warn!("Message sent to closed pipeline {}.", id), None => return warn!("Message sent to closed pipeline {}.", id),
}; };
@ -2977,7 +2977,7 @@ impl ScriptThread {
old_value: Option<String>, old_value: Option<String>,
new_value: Option<String>, new_value: Option<String>,
) { ) {
let window = match { self.documents.borrow().find_window(pipeline_id) } { let window = match self.documents.borrow().find_window(pipeline_id) {
None => return warn!("Storage event sent to closed pipeline {}.", pipeline_id), None => return warn!("Storage event sent to closed pipeline {}.", pipeline_id),
Some(window) => window, Some(window) => window,
}; };
@ -3380,7 +3380,7 @@ impl ScriptThread {
/// TODO: Actually perform DOM event dispatch. /// TODO: Actually perform DOM event dispatch.
fn handle_event(&self, pipeline_id: PipelineId, event: CompositorEvent) { fn handle_event(&self, pipeline_id: PipelineId, event: CompositorEvent) {
// Do not handle events if the pipeline exited. // Do not handle events if the pipeline exited.
let window = match { self.documents.borrow().find_window(pipeline_id) } { let window = match self.documents.borrow().find_window(pipeline_id) {
Some(win) => win, Some(win) => win,
None => { None => {
return warn!( return warn!(
@ -3424,7 +3424,7 @@ impl ScriptThread {
}, },
MouseMoveEvent(point, node_address, pressed_mouse_buttons) => { MouseMoveEvent(point, node_address, pressed_mouse_buttons) => {
let document = match { self.documents.borrow().find_document(pipeline_id) } { let document = match self.documents.borrow().find_document(pipeline_id) {
Some(document) => document, Some(document) => document,
None => return warn!("Message sent to closed pipeline {}.", pipeline_id), None => return warn!("Message sent to closed pipeline {}.", pipeline_id),
}; };
@ -3517,7 +3517,7 @@ impl ScriptThread {
}, },
KeyboardEvent(key_event) => { KeyboardEvent(key_event) => {
let document = match { self.documents.borrow().find_document(pipeline_id) } { let document = match self.documents.borrow().find_document(pipeline_id) {
Some(document) => document, Some(document) => document,
None => return warn!("Message sent to closed pipeline {}.", pipeline_id), None => return warn!("Message sent to closed pipeline {}.", pipeline_id),
}; };
@ -3525,7 +3525,7 @@ impl ScriptThread {
}, },
CompositionEvent(composition_event) => { CompositionEvent(composition_event) => {
let document = match { self.documents.borrow().find_document(pipeline_id) } { let document = match self.documents.borrow().find_document(pipeline_id) {
Some(document) => document, Some(document) => document,
None => return warn!("Message sent to closed pipeline {}.", pipeline_id), None => return warn!("Message sent to closed pipeline {}.", pipeline_id),
}; };
@ -3546,7 +3546,7 @@ impl ScriptThread {
point_in_node: Option<Point2D<f32>>, point_in_node: Option<Point2D<f32>>,
pressed_mouse_buttons: u16, pressed_mouse_buttons: u16,
) { ) {
let document = match { self.documents.borrow().find_document(pipeline_id) } { let document = match self.documents.borrow().find_document(pipeline_id) {
Some(document) => document, Some(document) => document,
None => return warn!("Message sent to closed pipeline {}.", pipeline_id), None => return warn!("Message sent to closed pipeline {}.", pipeline_id),
}; };
@ -3569,7 +3569,7 @@ impl ScriptThread {
point: Point2D<f32>, point: Point2D<f32>,
node_address: Option<UntrustedNodeAddress>, node_address: Option<UntrustedNodeAddress>,
) -> TouchEventResult { ) -> TouchEventResult {
let document = match { self.documents.borrow().find_document(pipeline_id) } { let document = match self.documents.borrow().find_document(pipeline_id) {
Some(document) => document, Some(document) => document,
None => { None => {
warn!("Message sent to closed pipeline {}.", pipeline_id); warn!("Message sent to closed pipeline {}.", pipeline_id);
@ -3592,7 +3592,7 @@ impl ScriptThread {
point: Point2D<f32>, point: Point2D<f32>,
node_address: Option<UntrustedNodeAddress>, node_address: Option<UntrustedNodeAddress>,
) { ) {
let document = match { self.documents.borrow().find_document(pipeline_id) } { let document = match self.documents.borrow().find_document(pipeline_id) {
Some(document) => document, Some(document) => document,
None => return warn!("Message sent to closed pipeline {}.", pipeline_id), None => return warn!("Message sent to closed pipeline {}.", pipeline_id),
}; };
@ -3664,7 +3664,7 @@ impl ScriptThread {
new_size: WindowSizeData, new_size: WindowSizeData,
size_type: WindowSizeType, size_type: WindowSizeType,
) { ) {
let document = match { self.documents.borrow().find_document(pipeline_id) } { let document = match self.documents.borrow().find_document(pipeline_id) {
Some(document) => document, Some(document) => document,
None => return warn!("Message sent to closed pipeline {}.", pipeline_id), None => return warn!("Message sent to closed pipeline {}.", pipeline_id),
}; };

View file

@ -19,21 +19,21 @@
#![feature(rustc_private)] #![feature(rustc_private)]
#![cfg(feature = "unrooted_must_root_lint")] #![cfg(feature = "unrooted_must_root_lint")]
extern crate rustc;
extern crate rustc_ast; extern crate rustc_ast;
extern crate rustc_driver; extern crate rustc_driver;
extern crate rustc_hir; extern crate rustc_hir;
extern crate rustc_lint; extern crate rustc_lint;
extern crate rustc_middle;
extern crate rustc_session; extern crate rustc_session;
extern crate rustc_span; extern crate rustc_span;
use rustc::ty;
use rustc_ast::ast::{AttrKind, Attribute}; use rustc_ast::ast::{AttrKind, Attribute};
use rustc_driver::plugin::Registry; use rustc_driver::plugin::Registry;
use rustc_hir::def_id::DefId; use rustc_hir::def_id::DefId;
use rustc_hir::intravisit as visit; use rustc_hir::intravisit as visit;
use rustc_hir::{self as hir, ExprKind, HirId}; use rustc_hir::{self as hir, ExprKind, HirId};
use rustc_lint::{LateContext, LateLintPass, LintContext, LintPass}; use rustc_lint::{LateContext, LateLintPass, LintContext, LintPass};
use rustc_middle::ty;
use rustc_session::declare_lint; use rustc_session::declare_lint;
use rustc_span::source_map; use rustc_span::source_map;
use rustc_span::source_map::{ExpnKind, MacroKind, Span}; use rustc_span::source_map::{ExpnKind, MacroKind, Span};
@ -101,8 +101,16 @@ fn has_lint_attr(sym: &Symbols, attrs: &[Attribute], name: Symbol) -> bool {
/// Checks if a type is unrooted or contains any owned unrooted types /// Checks if a type is unrooted or contains any owned unrooted types
fn is_unrooted_ty(sym: &Symbols, cx: &LateContext, ty: &ty::TyS, in_new_function: bool) -> bool { fn is_unrooted_ty(sym: &Symbols, cx: &LateContext, ty: &ty::TyS, in_new_function: bool) -> bool {
let mut ret = false; let mut ret = false;
ty.maybe_walk(|t| { let mut walker = ty.walk();
match t.kind { while let Some(generic_arg) = walker.next() {
let t = match generic_arg.unpack() {
rustc_middle::ty::subst::GenericArgKind::Type(t) => t,
_ => {
walker.skip_current_subtree();
continue;
},
};
let recur_into_subtree = match t.kind {
ty::Adt(did, substs) => { ty::Adt(did, substs) => {
let has_attr = |did, name| has_lint_attr(sym, &cx.tcx.get_attrs(did), name); let has_attr = |did, name| has_lint_attr(sym, &cx.tcx.get_attrs(did), name);
if has_attr(did.did, sym.must_root) { if has_attr(did.did, sym.must_root) {
@ -180,8 +188,11 @@ fn is_unrooted_ty(sym: &Symbols, cx: &LateContext, ty: &ty::TyS, in_new_function
ty::FnDef(..) | ty::FnPtr(_) => false, ty::FnDef(..) | ty::FnPtr(_) => false,
_ => true, _ => true,
};
if !recur_into_subtree {
walker.skip_current_subtree();
} }
}); }
ret ret
} }
@ -298,7 +309,7 @@ struct FnDefVisitor<'a, 'b: 'a, 'tcx: 'a + 'b> {
} }
impl<'a, 'b, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'b, 'tcx> { impl<'a, 'b, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'b, 'tcx> {
type Map = rustc::hir::map::Map<'tcx>; type Map = rustc_middle::hir::map::Map<'tcx>;
fn visit_expr(&mut self, expr: &'tcx hir::Expr) { fn visit_expr(&mut self, expr: &'tcx hir::Expr) {
let cx = self.cx; let cx = self.cx;

View file

@ -90,7 +90,7 @@ impl EventsLoop {
} }
EventLoop::Headless(ref data) => { EventLoop::Headless(ref data) => {
let &(ref flag, ref condvar) = &**data; let &(ref flag, ref condvar) = &**data;
while { !*flag.lock().unwrap() } { while !*flag.lock().unwrap() {
self.sleep(flag, condvar); self.sleep(flag, condvar);
if callback(glutin::Event::Awakened) == glutin::ControlFlow::Break { if callback(glutin::Event::Awakened) == glutin::ControlFlow::Break {
break; break;

View file

@ -37,7 +37,7 @@ extern "C" fn default_panic_handler(msg: *const c_char) {
lazy_static! { lazy_static! {
static ref ON_PANIC: RwLock<extern "C" fn(*const c_char)> = RwLock::new(default_panic_handler); static ref ON_PANIC: RwLock<extern "C" fn(*const c_char)> = RwLock::new(default_panic_handler);
static ref SERVO_VERSION: CString = static ref SERVO_VERSION: CString =
{ CString::new(simpleservo::servo_version()).expect("Can't create string") }; CString::new(simpleservo::servo_version()).expect("Can't create string");
} }
#[no_mangle] #[no_mangle]

View file

@ -625,9 +625,6 @@ def check_rust(file_name, lines):
(r": &Root<", "use &T instead of &Root<T>", no_filter), (r": &Root<", "use &T instead of &Root<T>", no_filter),
(r": &DomRoot<", "use &T instead of &DomRoot<T>", no_filter), (r": &DomRoot<", "use &T instead of &DomRoot<T>", no_filter),
(r"^&&", "operators should go at the end of the first line", no_filter), (r"^&&", "operators should go at the end of the first line", no_filter),
# This particular pattern is not reentrant-safe in script_thread.rs
(r"match self.documents.borrow", "use a separate variable for the match expression",
lambda match, line: file_name.endswith('script_thread.rs')),
# -> () is unnecessary # -> () is unnecessary
(r"-> \(\)", "encountered function signature with -> ()", no_filter), (r"-> \(\)", "encountered function signature with -> ()", no_filter),
] ]

View file

@ -1,18 +0,0 @@
fn main() {
// This should trigger an error.
match self.documents.borrow_mut() {
_ => {}
}
// This should trigger an error.
match self.documents.borrow() {
_ => {}
}
// This should not trigger an error.
match { self.documents.borrow().find_window(id) } {
=> {}
}
// This should not trigger an error.
match self.documents_status.borrow() {
=> {}
}
}

View file

@ -140,12 +140,6 @@ class CheckTidiness(unittest.TestCase):
self.assertEqual('method declared in webidl is missing a comment with a specification link', next(errors)[2]) self.assertEqual('method declared in webidl is missing a comment with a specification link', next(errors)[2])
self.assertNoMoreErrors(errors) self.assertNoMoreErrors(errors)
def test_script_thread(self):
errors = tidy.collect_errors_for_files(iterFile('script_thread.rs'), [], [tidy.check_rust], print_text=False)
self.assertEqual('use a separate variable for the match expression', next(errors)[2])
self.assertEqual('use a separate variable for the match expression', next(errors)[2])
self.assertNoMoreErrors(errors)
def test_webidl(self): def test_webidl(self):
errors = tidy.collect_errors_for_files(iterFile('spec.webidl'), [tidy.check_webidl_spec], [], print_text=False) errors = tidy.collect_errors_for_files(iterFile('spec.webidl'), [tidy.check_webidl_spec], [], print_text=False)
self.assertEqual('No specification link found.', next(errors)[2]) self.assertEqual('No specification link found.', next(errors)[2])

View file

@ -1 +1 @@
nightly-2020-03-16 nightly-2020-04-08