Fix ICE #68025
This commit is contained in:
parent
c0e02ad724
commit
2ecc48ffa1
2 changed files with 14 additions and 2 deletions
|
@ -327,10 +327,10 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
|
|||
}
|
||||
|
||||
fn walk_callee(&mut self, call: &hir::Expr<'_>, callee: &hir::Expr<'_>) {
|
||||
let callee_ty = return_if_err!(self.mc.expr_ty_adjusted(callee));
|
||||
let callee_ty = self.mc.tables.expr_ty_adjusted(callee);
|
||||
debug!("walk_callee: callee={:?} callee_ty={:?}", callee, callee_ty);
|
||||
match callee_ty.kind {
|
||||
ty::FnDef(..) | ty::FnPtr(_) => {
|
||||
ty::FnDef(..) | ty::FnPtr(_) | ty::Closure(..) => {
|
||||
self.consume_expr(callee);
|
||||
}
|
||||
ty::Error => {}
|
||||
|
|
12
src/test/ui/closures/issue-68025.rs
Normal file
12
src/test/ui/closures/issue-68025.rs
Normal file
|
@ -0,0 +1,12 @@
|
|||
// check-pass
|
||||
|
||||
fn foo<F, G>(_: G, _: Box<F>)
|
||||
where
|
||||
F: Fn(),
|
||||
G: Fn(Box<F>),
|
||||
{
|
||||
}
|
||||
|
||||
fn main() {
|
||||
foo(|f| (*f)(), Box::new(|| {}));
|
||||
}
|
Loading…
Add table
Reference in a new issue