Track per-obligation recursion depth only if there is inference
This commit is contained in:
parent
8f43b85954
commit
31c8d10342
2 changed files with 46 additions and 8 deletions
31
tests/ui/traits/next-solver/coerce-depth.rs
Normal file
31
tests/ui/traits/next-solver/coerce-depth.rs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
//@ check-pass
|
||||
//@ compile-flags: -Znext-solver
|
||||
|
||||
// Ensure that a stack of coerce predicates doesn't end up overflowing when they get procesed
|
||||
// in *reverse* order, which may require O(N) iterations of the fulfillment loop.
|
||||
|
||||
#![recursion_limit = "16"]
|
||||
|
||||
fn main() {
|
||||
match 0 {
|
||||
0 => None,
|
||||
1 => None,
|
||||
2 => None,
|
||||
3 => None,
|
||||
4 => None,
|
||||
5 => None,
|
||||
6 => None,
|
||||
7 => None,
|
||||
8 => None,
|
||||
9 => None,
|
||||
10 => None,
|
||||
11 => None,
|
||||
12 => None,
|
||||
13 => None,
|
||||
14 => None,
|
||||
15 => None,
|
||||
16 => None,
|
||||
17 => None,
|
||||
_ => Some(1u32),
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue