From 836eb2521e9963ca7014635b3b1ce8ddc537dce6 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Thu, 30 Jun 2022 11:10:44 +0900 Subject: [PATCH] Move negative_impls test from run-pass to ui --- .../unstable-features}/negative_impls.rs | 1 + .../unstable-features/negative_impls.stderr | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+) rename tests/{run-pass => ui/unstable-features}/negative_impls.rs (93%) create mode 100644 tests/ui/unstable-features/negative_impls.stderr diff --git a/tests/run-pass/negative_impls.rs b/tests/ui/unstable-features/negative_impls.rs similarity index 93% rename from tests/run-pass/negative_impls.rs rename to tests/ui/unstable-features/negative_impls.rs index 1b259c72..96056423 100644 --- a/tests/run-pass/negative_impls.rs +++ b/tests/ui/unstable-features/negative_impls.rs @@ -1,4 +1,5 @@ #![feature(negative_impls)] +#![deny(suspicious_auto_trait_impls)] // https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/design.20meeting.3A.20backlog.20bonanza/near/269471299 // https://github.com/taiki-e/pin-project/issues/340 diff --git a/tests/ui/unstable-features/negative_impls.stderr b/tests/ui/unstable-features/negative_impls.stderr new file mode 100644 index 00000000..7cf30aa8 --- /dev/null +++ b/tests/ui/unstable-features/negative_impls.stderr @@ -0,0 +1,24 @@ +error: cross-crate traits with a default impl, like `Unpin`, should not be specialized + --> tests/ui/unstable-features/negative_impls.rs:17:1 + | +17 | impl Unpin for Foo {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: the lint level is defined here + --> tests/ui/unstable-features/negative_impls.rs:2:9 + | +2 | #![deny(suspicious_auto_trait_impls)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = warning: this will change its meaning in a future release! + = note: for more information, see issue #93367 + = note: `MyPhantomPinned` is not a generic parameter +note: try using the same sequence of generic parameters as the struct definition + --> tests/ui/unstable-features/negative_impls.rs:8:1 + | +8 | / struct Foo { +9 | | #[pin] +10 | | pinned: Pinned, +11 | | +12 | | unpinned: Unpinned, +13 | | } + | |_^