rust/tests/run-pass/issue-91636.rs
2021-12-15 19:11:08 +01:00

21 lines
362 B
Rust

type BuiltIn = for<'a> fn(&str);
struct Function {
inner: BuiltIn,
}
impl Function {
fn new(subr: BuiltIn) -> Self {
Self { inner: subr }
}
}
fn dummy(_: &str) {}
fn main() {
let func1 = Function::new(dummy);
let func2 = Function::new(dummy);
let inner: fn(&'static _) -> _ = func1.inner;
assert!(inner == func2.inner);
}