Fix FP in REDUNDANT_CLOSURE with divergent functions
This commit is contained in:
parent
f98e3ecb37
commit
7095b5df31
2 changed files with 18 additions and 1 deletions
|
|
@ -61,7 +61,8 @@ fn check_closure(cx: &LateContext, expr: &Expr) {
|
|||
match fn_ty.sty {
|
||||
// Is it an unsafe function? They don't implement the closure traits
|
||||
ty::TyFnDef(_, _, fn_ty) | ty::TyFnPtr(fn_ty) => {
|
||||
if fn_ty.unsafety == Unsafety::Unsafe {
|
||||
if fn_ty.unsafety == Unsafety::Unsafe ||
|
||||
fn_ty.sig.skip_binder().output == ty::FnOutput::FnDiverging {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue