]> git.lizzy.rs Git - rust.git/blob - tests/ui/issues/issue-23992.rs
Rollup merge of #107091 - clubby789:infer-ftl-missing-dollar, r=compiler-errors
[rust.git] / tests / ui / issues / issue-23992.rs
1 // run-pass
2 pub struct Outer<T: Trait>(T);
3 pub struct Inner<'a> { value: &'a bool }
4
5 pub trait Trait {
6     type Error;
7     fn ready(self) -> Self::Error;
8 }
9
10 impl<'a> Trait for Inner<'a> {
11     type Error = Outer<Inner<'a>>;
12     fn ready(self) -> Outer<Inner<'a>> { Outer(self) }
13 }
14
15 fn main() {
16     let value = true;
17     let inner = Inner { value: &value };
18     assert_eq!(inner.ready().0.value, &value);
19 }