Skip to content

Commit

Permalink
Move negative_impls test from run-pass to ui
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jun 30, 2022
1 parent b60499f commit 836eb25
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down
24 changes: 24 additions & 0 deletions tests/ui/unstable-features/negative_impls.stderr
Original file line number Diff line number Diff line change
@@ -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<MyPhantomPinned, ()> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
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 <https://github.com/rust-lang/rust/issues/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<Pinned, Unpinned> {
9 | | #[pin]
10 | | pinned: Pinned,
11 | |
12 | | unpinned: Unpinned,
13 | | }
| |_^

0 comments on commit 836eb25

Please sign in to comment.