Open arnaudgolfouse opened 2 months ago
The following code generate incorrect coma:
pub fn f() { let _ = |&x: &i32| x; }
Indeed the line use M_result_in_spec__f__blabla_Type as Closure'0 is present inside module M_result_in_spec__f__blabla_Type.
use M_result_in_spec__f__blabla_Type as Closure'0
M_result_in_spec__f__blabla_Type
A bit weird: giving the closure to a function directly does not triggers the error:
fn takes_closure<F: Fn(&i32) -> i32>(f: F) {} pub fn f() { takes_closure(|&x: &i32| x); }
Ah, this is not only for patterns, it also happens here:
pub fn f() { let clos = #[ensures(result == x.1)] |x: &(i32, i32)| x.1; }
The following code generate incorrect coma:
Indeed the line
use M_result_in_spec__f__blabla_Type as Closure'0
is present inside moduleM_result_in_spec__f__blabla_Type
.A bit weird: giving the closure to a function directly does not triggers the error: