]> git.lizzy.rs Git - rust.git/blob - src/test/ui/did_you_mean/recursion_limit.rs
Auto merge of #39917 - alexcrichton:build-cargo, r=brson
[rust.git] / src / test / ui / did_you_mean / recursion_limit.rs
1 // Copyright 2014 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 // Test that the recursion limit can be changed and that the compiler
12 // suggests a fix. In this case, we have deeply nested types that will
13 // fail the `Send` check by overflow when the recursion limit is set
14 // very low.
15
16 #![allow(dead_code)]
17 #![recursion_limit="10"]
18
19 macro_rules! link {
20     ($id:ident, $t:ty) => {
21         enum $id { $id($t) }
22     }
23 }
24
25 link! { A, B }
26 link! { B, C }
27 link! { C, D }
28 link! { D, E }
29 link! { E, F }
30 link! { F, G }
31 link! { G, H }
32 link! { H, I }
33 link! { I, J }
34 link! { J, K }
35 link! { K, L }
36 link! { L, M }
37 link! { M, N }
38
39 enum N { N(usize) }
40
41 fn is_send<T:Send>() { }
42
43 fn main() {
44     is_send::<A>();
45 }