From 776bcd01ec965da7927d47d5470b2a0182fcd2f1 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Tue, 1 Oct 2019 13:58:37 +0000 Subject: [PATCH] servo: Merge #18327 - Upgrade to rustc 1.21.0-nightly (7eeac1b81 2017-08-30) (from servo:rustup); r=nox MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix this error in the new Rust Nightly: ```rust Compiling script v0.0.1 (file:///home/simon/servo2/components/script) error[E0599]: no method named `trace` found for type `&fn(&dom::node::Node) -> u16` in the current scope --> /home/simon/servo2/components/script/dom/treewalker.rs:464:10 | 464 | #[derive(JSTraceable)] | ^^^^^^^^^^^ | = note: JSTraceable is a function, perhaps you wish to call it = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `trace`, perhaps you need to implement it: candidate #1: `dom::bindings::trace::JSTraceable` error: aborting due to previous error error: Could not compile `script`. ``` ~I’ve tried to reproduce it in a minimal test case, but `impl SomeTrait for fn(A) -> B` did not apply for `fn(&u32) -> u32` even on Rust 1.19.0 stable. So I don’t know what changed.~ This is very likely https://github.com/servo/servo/pull/18327. Source-Repo: https://github.com/servo/servo Source-Revision: fd833d9f18cd9196502b9768ab0ac8c1498b2f68 UltraBlame original commit: 2093d5141fb21195b1f84894b2921bcace8c3cfd --- servo/components/script/dom/bindings/trace.rs | 38 +++++++++++++++++++ servo/components/script_plugins/utils.rs | 2 + servo/rust-toolchain | 2 +- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/servo/components/script/dom/bindings/trace.rs b/servo/components/script/dom/bindings/trace.rs index 68b1849afcd1..6a1baa9cbc8d 100644 --- a/servo/components/script/dom/bindings/trace.rs +++ b/servo/components/script/dom/bindings/trace.rs @@ -2740,6 +2740,44 @@ JSTracer unsafe impl < +' +a +A +B +> +JSTraceable +for +fn +( +& +A +) +- +> +B +{ +# +[ +inline +] +unsafe +fn +trace +( +& +self +_ +: +* +mut +JSTracer +) +{ +} +} +unsafe +impl +< T > JSTraceable diff --git a/servo/components/script_plugins/utils.rs b/servo/components/script_plugins/utils.rs index 1ca909c1a5e5..8a6f3de05259 100644 --- a/servo/components/script_plugins/utils.rs +++ b/servo/components/script_plugins/utils.rs @@ -190,6 +190,8 @@ i span . ctxt +( +) . outer ( diff --git a/servo/rust-toolchain b/servo/rust-toolchain index 3ff26df591da..1b21db110483 100644 --- a/servo/rust-toolchain +++ b/servo/rust-toolchain @@ -4,4 +4,4 @@ nightly - 08 - -30 +31