rust/tests/run-pass/issue-91636.rs

21 lines
362 B
Rust
Raw Normal View History

2021-12-15 11:41:41 -06:00
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);
}