summaryrefslogtreecommitdiffstats
path: root/tests/ui/type-alias-impl-trait/multiple_definitions.rs
blob: 9e6268e63cde0a544e70ec75180455c2e076cd59 (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
// check-pass

use std::marker::PhantomData;

pub struct ConcreteError {}
pub trait IoBase {}
struct X {}
impl IoBase for X {}

pub struct ClusterIterator<B, E, S = B> {
    pub fat: B,
    phantom_s: PhantomData<S>,
    phantom_e: PhantomData<E>,
}

pub struct FileSystem<IO: IoBase> {
    pub disk: IO,
}

impl<IO: IoBase> FileSystem<IO> {
    pub fn cluster_iter(&self) -> ClusterIterator<impl IoBase + '_, ConcreteError> {
        ClusterIterator {
            fat: X {},
            phantom_s: PhantomData::default(),
            phantom_e: PhantomData::default(),
        }
    }
}

fn main() {}