about summary refs log tree commit diff
path: root/tests/mir-opt/build_correct_coerce.rs
blob: b6c861636dcaa5d886b67a76ec67d0b3b2df0a7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// skip-filecheck

// Validate that we record the target for the `as` coercion as `for<'a> fn(&'a (), &'a ())`,
// and not `for<'a, 'b>(&'a (), &'b ())`. We previously did the latter due to a bug in
// the code that records adjustments in HIR typeck.

fn foo<'a, 'b>(_: &'a (), _: &'b ()) {}

// EMIT_MIR build_correct_coerce.main.built.after.mir
fn main() {
    let x = foo as for<'a> fn(&'a (), &'a ());
}