]> git.lizzy.rs Git - rust.git/blob - tests/ui/type_length_limit.rs
Rollup merge of #107740 - oli-obk:lock_tcx, r=petrochenkov
[rust.git] / tests / ui / type_length_limit.rs
1 // build-fail
2 // error-pattern: reached the type-length limit while instantiating
3 // compile-flags: -Copt-level=0
4 // normalize-stderr-test: ".nll/" -> "/"
5
6 // Test that the type length limit can be changed.
7 // The exact type depends on optimizations, so disable them.
8
9 #![allow(dead_code)]
10 #![type_length_limit="8"]
11
12 macro_rules! link {
13     ($id:ident, $t:ty) => {
14         pub type $id = ($t, $t, $t);
15     }
16 }
17
18 link! { A1, B1 }
19 link! { B1, C1 }
20 link! { C1, D1 }
21 link! { D1, E1 }
22 link! { E1, A }
23 link! { A, B }
24 link! { B, C }
25 link! { C, D }
26 link! { D, E }
27 link! { E, F }
28 link! { F, G<Option<i32>, Option<i32>> }
29
30 pub struct G<T, K>(std::marker::PhantomData::<(T, K)>);
31
32 fn main() {
33     drop::<Option<A>>(None);
34 }