]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-25693.rs
Add 'src/tools/rust-analyzer/' from commit '977e12a0bdc3e329af179ef3a9d466af9eb613bb'
[rust.git] / src / test / ui / issues / issue-25693.rs
1 // run-pass
2 #![allow(unused_variables)]
3 pub trait Parameters { type SelfRef; }
4
5 struct RP<'a> { _marker: std::marker::PhantomData<&'a ()> }
6 struct BP;
7
8 impl<'a> Parameters for RP<'a> { type SelfRef = &'a X<RP<'a>>; }
9 impl Parameters for BP { type SelfRef = Box<X<BP>>; }
10
11 pub struct Y;
12 pub enum X<P: Parameters> {
13     Nothing,
14     SameAgain(P::SelfRef, Y)
15 }
16
17 fn main() {
18     let bnil: Box<X<BP>> = Box::new(X::Nothing);
19     let bx: Box<X<BP>> = Box::new(X::SameAgain(bnil, Y));
20     let rnil: X<RP> = X::Nothing;
21     let rx: X<RP> = X::SameAgain(&rnil, Y);
22 }