blob: 0e1d8d5a2aae31ee1ad9fcfa45c3e2c27c2155a0 [file] [log] [blame]
fn fn_pointer_static() -> usize {
static FN: fn() -> usize = || 1;
FN() + 1
//~^ let_and_return
}
fn fn_pointer_const() -> usize {
const FN: fn() -> usize = || 1;
FN() + 1
//~^ let_and_return
}
fn deref_to_dyn_fn() -> usize {
struct Derefs;
impl std::ops::Deref for Derefs {
type Target = dyn Fn() -> usize;
fn deref(&self) -> &Self::Target {
&|| 2
}
}
static FN: Derefs = Derefs;
FN() + 1
//~^ let_and_return
}
fn main() {}