]> git.lizzy.rs Git - rust.git/blob - tests/ui/rfc-2093-infer-outlives/privacy.rs
Rollup merge of #106958 - jyn514:labels, r=m-ou-se
[rust.git] / tests / ui / rfc-2093-infer-outlives / privacy.rs
1 // Test that we do not get a privacy error here.  Initially, we did,
2 // because we inferred an outlives predciate of `<Foo<'a> as
3 // Private>::Out: 'a`, but the private trait is -- well -- private,
4 // and hence it was not something that a pub trait could refer to.
5 //
6 // run-pass
7
8 #![allow(dead_code)]
9
10 pub struct Foo<'a> {
11     field: Option<&'a <Foo<'a> as Private>::Out>
12 }
13
14 trait Private {
15     type Out: ?Sized;
16 }
17
18 impl<T: ?Sized> Private for T { type Out = Self; }
19
20 fn main() { }