summaryrefslogtreecommitdiffstats
path: root/tests/ui/dropck/trivial-impl-bounds.rs
blob: a8f5d2c354bc979799634c2eb6e078fbe5acb944 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// revisions: good1 good2 good3
// check-pass

use std::ops::Drop;

struct Foo;

const X: usize = 1;

#[cfg(good1)]
impl Drop for Foo
where
    [(); X]:, // Trivial WF bound
{
    fn drop(&mut self) {}
}

#[cfg(good2)]
impl Drop for Foo
where
    for<'a> &'a (): Copy, // Trivial trait bound
{
    fn drop(&mut self) {}
}

#[cfg(good3)]
impl Drop for Foo
where
    for<'a> &'a (): 'a, // Trivial outlives bound
{
    fn drop(&mut self) {}
}

fn main() {}