From 7d997748da14e1b5b64ea92b8fbeab123a1268c9 Mon Sep 17 00:00:00 2001 From: Dominic Cooney Date: Sat, 22 May 2021 17:53:48 +0900 Subject: [PATCH 1/5] Update toolchain to nightly-2021-05-18 The nightly-2021-03-12 toolchain doesn't have RLS on Windows. This breaks code completion in Visual Studio Code because the rust plugin picks up the project toolchain. RLS is available in all tier one platforms in nightly-2021-05-18 per: https://rust-lang.github.io/rustup-components-history/ Signed-off-by: Dominic Cooney --- components/script/lib.rs | 2 +- components/script_plugins/lib.rs | 6 +++++- rust-toolchain | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/components/script/lib.rs b/components/script/lib.rs index 86935833157..8c8c4376726 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -3,8 +3,8 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ #![feature(assoc_char_funcs)] -#![feature(const_fn)] #![feature(const_fn_fn_ptr_basics)] +#![feature(const_fn_trait_bound)] #![feature(core_intrinsics)] #![feature(drain_filter)] #![feature(plugin)] diff --git a/components/script_plugins/lib.rs b/components/script_plugins/lib.rs index 0a4f70c5c58..a42eb96bf23 100644 --- a/components/script_plugins/lib.rs +++ b/components/script_plugins/lib.rs @@ -405,7 +405,11 @@ fn match_def_path(cx: &LateContext, def_id: DefId, path: &[Symbol]) -> bool { fn in_derive_expn(span: Span) -> bool { matches!( span.ctxt().outer_expn_data().kind, - ExpnKind::Macro(MacroKind::Derive, _) + ExpnKind::Macro { + kind: MacroKind::Derive, + name: _, + proc_macro: _, + } ) } diff --git a/rust-toolchain b/rust-toolchain index 02c828fea2f..b2eff28fe03 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2021-03-12 +nightly-2021-05-18 From a68c336e55ff0246a8846bb346243559583f1ca4 Mon Sep 17 00:00:00 2001 From: Dominic Cooney Date: Sat, 22 May 2021 23:31:01 +0900 Subject: [PATCH 2/5] `mach fmt` after updating toolchain to 2021-05-18 Signed-off-by: Dominic Cooney --- components/net/http_cache.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/net/http_cache.rs b/components/net/http_cache.rs index 81109df2bda..a743a05cdde 100644 --- a/components/net/http_cache.rs +++ b/components/net/http_cache.rs @@ -230,8 +230,8 @@ fn get_response_expiry(response: &Response) -> Duration { let max_heuristic = Duration::hours(24) - age; let heuristic_freshness = if let Some(last_modified) = // If the response has a Last-Modified header field, - // caches are encouraged to use a heuristic expiration value - // that is no more than some fraction of the interval since that time. + // caches are encouraged to use a heuristic expiration value + // that is no more than some fraction of the interval since that time. response.headers.typed_get::() { let current = time::now().to_timespec(); From 0955b686ede427ae6e8bde7196cd07c832640607 Mon Sep 17 00:00:00 2001 From: Dominic Cooney Date: Sat, 22 May 2021 23:47:27 +0900 Subject: [PATCH 3/5] Don't name unused ExpnKind::Macro fields in components/script_plugins Co-authored-by: Simon Sapin --- components/script_plugins/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/script_plugins/lib.rs b/components/script_plugins/lib.rs index a42eb96bf23..c1dc92abb09 100644 --- a/components/script_plugins/lib.rs +++ b/components/script_plugins/lib.rs @@ -407,8 +407,7 @@ fn in_derive_expn(span: Span) -> bool { span.ctxt().outer_expn_data().kind, ExpnKind::Macro { kind: MacroKind::Derive, - name: _, - proc_macro: _, + .. } ) } From 3b93d209914610ac96627c6ae4feaf367ddbef91 Mon Sep 17 00:00:00 2001 From: Dominic Cooney Date: Sun, 23 May 2021 19:02:10 +0900 Subject: [PATCH 4/5] Fix three trivial warnings. Signed-off-by: Dominic Cooney --- components/canvas_traits/webgl_channel/mpsc.rs | 1 - components/media/media_channel/mpsc.rs | 1 - components/script/lib.rs | 1 - 3 files changed, 3 deletions(-) diff --git a/components/canvas_traits/webgl_channel/mpsc.rs b/components/canvas_traits/webgl_channel/mpsc.rs index 40acb050861..8e34bda8e9b 100644 --- a/components/canvas_traits/webgl_channel/mpsc.rs +++ b/components/canvas_traits/webgl_channel/mpsc.rs @@ -5,7 +5,6 @@ use serde::{Deserialize, Serialize}; use serde::{Deserializer, Serializer}; -#[macro_use] macro_rules! unreachable_serializable { ($name:ident) => { impl Serialize for $name { diff --git a/components/media/media_channel/mpsc.rs b/components/media/media_channel/mpsc.rs index 7d6a396185a..8651258c65a 100644 --- a/components/media/media_channel/mpsc.rs +++ b/components/media/media_channel/mpsc.rs @@ -6,7 +6,6 @@ use serde::{Deserialize, Serialize}; use serde::{Deserializer, Serializer}; use std::sync::mpsc; -#[macro_use] macro_rules! unreachable_serializable { ($name:ident) => { impl Serialize for $name { diff --git a/components/script/lib.rs b/components/script/lib.rs index 8c8c4376726..2fcae084fb6 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -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 https://mozilla.org/MPL/2.0/. */ -#![feature(assoc_char_funcs)] #![feature(const_fn_fn_ptr_basics)] #![feature(const_fn_trait_bound)] #![feature(core_intrinsics)] From 30c5ad95d5aa61af8b3c5b3243d3ab7cfdb9d559 Mon Sep 17 00:00:00 2001 From: Dominic Cooney Date: Sun, 23 May 2021 19:27:57 +0900 Subject: [PATCH 5/5] Mark dead BrowsingContextActor fields with underscores. Signed-off-by: Dominic Cooney --- .../devtools/actors/browsing_context.rs | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/components/devtools/actors/browsing_context.rs b/components/devtools/actors/browsing_context.rs index 5692fb167cd..e301abc98d7 100644 --- a/components/devtools/actors/browsing_context.rs +++ b/components/devtools/actors/browsing_context.rs @@ -125,14 +125,14 @@ pub(crate) struct BrowsingContextActor { pub title: RefCell, pub url: RefCell, pub console: String, - pub emulation: String, - pub inspector: String, - pub timeline: String, - pub profiler: String, - pub performance: String, - pub styleSheets: String, + pub _emulation: String, + pub _inspector: String, + pub _timeline: String, + pub _profiler: String, + pub _performance: String, + pub _styleSheets: String, pub thread: String, - pub tab: String, + pub _tab: String, pub streams: RefCell>, pub browsing_context_id: BrowsingContextId, pub active_pipeline: Cell, @@ -288,13 +288,13 @@ impl BrowsingContextActor { title: RefCell::new(String::from(title)), url: RefCell::new(url.into_string()), console: console, - emulation: emulation.name(), - inspector: inspector.name(), - timeline: timeline.name(), - profiler: profiler.name(), - performance: performance.name(), - styleSheets: styleSheets.name(), - tab: tabdesc.name(), + _emulation: emulation.name(), + _inspector: inspector.name(), + _timeline: timeline.name(), + _profiler: profiler.name(), + _performance: performance.name(), + _styleSheets: styleSheets.name(), + _tab: tabdesc.name(), thread: thread.name(), streams: RefCell::new(HashMap::new()), browsing_context_id: id,