]> git.lizzy.rs Git - rust.git/blob - tests/ui/did_you_mean/recursion_limit.rs
Rollup merge of #106664 - chenyukang:yukang/fix-106597-remove-lseek, r=cuviper
[rust.git] / tests / ui / did_you_mean / recursion_limit.rs
1 // Test that the recursion limit can be changed and that the compiler
2 // suggests a fix. In this case, we have deeply nested types that will
3 // fail the `Send` check by overflow when the recursion limit is set
4 // very low.
5
6 #![allow(dead_code)]
7 #![recursion_limit="10"]
8
9 macro_rules! link {
10     ($id:ident, $t:ty) => {
11         enum $id { $id($t) }
12     }
13 }
14
15 link! { A, B }
16 link! { B, C }
17 link! { C, D }
18 link! { D, E }
19 link! { E, F }
20 link! { F, G }
21 link! { G, H }
22 link! { H, I }
23 link! { I, J }
24 link! { J, K }
25 link! { K, L }
26 link! { L, M }
27 link! { M, N }
28
29 enum N { N(usize) }
30
31 fn is_send<T:Send>() { }
32
33 fn main() {
34     is_send::<A>(); //~ ERROR overflow evaluating the requirement
35 }