summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/auxiliary/issue-30123-aux.rs
blob: 07c743eb2aa34c57ea3e5fb0621af79863d8ac9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use std::marker::PhantomData;

pub struct Directed;
pub struct Undirected;

pub struct Graph<N, E, Ty = Directed> {
    nodes: Vec<PhantomData<N>>,
    edges: Vec<PhantomData<E>>,
    ty: PhantomData<Ty>,
}


impl<N, E> Graph<N, E, Directed> {
    pub fn new() -> Self {
        Graph{nodes: Vec::new(), edges: Vec::new(), ty: PhantomData}
    }
}

impl<N, E> Graph<N, E, Undirected> {
    pub fn new_undirected() -> Self {
        Graph{nodes: Vec::new(), edges: Vec::new(), ty: PhantomData}
    }
}