aboutsummaryrefslogtreecommitdiff
path: root/tests/ui/unstable-features/negative_impls.rs
blob: 96056423a0a438b073e9f1e5235bd19bd0193957 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#![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

#[pin_project::pin_project]
struct Foo<Pinned, Unpinned> {
    #[pin]
    pinned: Pinned,

    unpinned: Unpinned,
}

struct MyPhantomPinned {}
impl !Unpin for MyPhantomPinned {}
impl Unpin for Foo<MyPhantomPinned, ()> {}

fn is_unpin<T: Unpin>() {}

fn main() {
    is_unpin::<Foo<MyPhantomPinned, ()>>()
}