]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-52992.rs
Moved and renamed ui issue tests.
[rust.git] / src / test / ui / issues / issue-52992.rs
1 // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // Regression test for an NLL-related ICE (#52992) -- computing
12 // implied bounds was causing outlives relations that were not
13 // properly handled.
14 //
15 // compile-pass
16
17 #![feature(nll)]
18
19 fn main() {}
20
21 fn fail<'a>() -> Struct<'a, Generic<()>> {
22     Struct(&Generic(()))
23 }
24
25 struct Struct<'a, T>(&'a T) where
26     T: Trait + 'a,
27     T::AT: 'a; // only fails with this bound
28
29 struct Generic<T>(T);
30
31 trait Trait {
32     type AT;
33 }
34
35 impl<T> Trait for Generic<T> {
36     type AT = T; // only fails with a generic AT
37 }