]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-25693.rs
Rollup merge of #86479 - exphp-forks:float-debug-exponential, r=yaahc
[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 }