From 072ca3bd03d11a8f1582a9ad409790a6d189ef34 Mon Sep 17 00:00:00 2001 From: Tawhid Hannan Date: Sun, 22 Jan 2017 20:12:07 +0000 Subject: [PATCH] Added compiletest to verify TrustedPromise does not implement Clone --- components/script/test.rs | 1 + .../trustedpromise_mustnot_deriveclone.rs | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 tests/compiletest/plugin/compile-fail/trustedpromise_mustnot_deriveclone.rs diff --git a/components/script/test.rs b/components/script/test.rs index 83523c47817..9aeff2a22a5 100644 --- a/components/script/test.rs +++ b/components/script/test.rs @@ -9,6 +9,7 @@ pub use dom::headers::normalize_value; pub use dom::bindings::cell::DOMRefCell; pub use dom::bindings::js::JS; pub use dom::node::Node; +pub use dom::bindings::refcounted::TrustedPromise; pub mod area { pub use dom::htmlareaelement::{Area, Shape}; diff --git a/tests/compiletest/plugin/compile-fail/trustedpromise_mustnot_deriveclone.rs b/tests/compiletest/plugin/compile-fail/trustedpromise_mustnot_deriveclone.rs new file mode 100644 index 00000000000..08d684d4e4a --- /dev/null +++ b/tests/compiletest/plugin/compile-fail/trustedpromise_mustnot_deriveclone.rs @@ -0,0 +1,18 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * 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(plugin)] +#![plugin(plugins)] + +extern crate script; + +use script::test::TrustedPromise; + +fn cloneable() { +} + +fn main() { + cloneable::(); + //~^ ERROR the trait bound `script::test::TrustedPromise: std::clone::Clone` is not satisfied +}