]> git.lizzy.rs Git - rust.git/blob - tests/ui/inference/lub-glb-with-unbound-infer-var.rs
Auto merge of #106827 - alexcrichton:update-llvm-to-15.0.7, r=cuviper
[rust.git] / tests / ui / inference / lub-glb-with-unbound-infer-var.rs
1 // run-pass
2 // Test for a specific corner case: when we compute the LUB of two fn
3 // types and their parameters have unbound variables. In that case, we
4 // wind up relating those two variables. This was causing an ICE in an
5 // in-progress PR.
6
7 fn main() {
8     let a_f: fn(_) = |_| ();
9     let b_f: fn(_) = |_| ();
10     let c_f = match 22 {
11         0 => a_f,
12         _ => b_f,
13     };
14     c_f(4);
15 }