2024-02-16 20:02:50 +00:00
|
|
|
//@ edition:2021
|
|
|
|
|
//@ run-rustfix
|
2023-05-01 01:34:01 -07:00
|
|
|
|
|
|
|
|
fn foo<T>(_: Box<T>) {}
|
|
|
|
|
fn bar<T>(_: impl Fn() -> Box<T>) {}
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
foo(Box::new(())); //~ ERROR mismatched types
|
|
|
|
|
bar(|| Box::new(())); //~ ERROR mismatched types
|
|
|
|
|
}
|