diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-12-01 16:00:08 +0100 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-12-12 17:54:49 +0100 |
| commit | 34d91709b672d91ea9623ae4bc2275e8b003fc2c (patch) | |
| tree | 9b7b2c12d75a6ff4e8e9af725c778b09d1bba319 /src/librustc_interface | |
| parent | 404013e015d9a9f4835cda47e56aab5223f278ed (diff) | |
parse: refactor fun ret ty & param ty
Diffstat (limited to 'src/librustc_interface')
| -rw-r--r-- | src/librustc_interface/util.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc_interface/util.rs b/src/librustc_interface/util.rs index 8c225b83f40..ca7c4ba8786 100644 --- a/src/librustc_interface/util.rs +++ b/src/librustc_interface/util.rs @@ -712,8 +712,8 @@ impl<'a, 'b> ReplaceBodyWithLoop<'a, 'b> { ret } - fn should_ignore_fn(ret_ty: &ast::FnDecl) -> bool { - if let ast::FunctionRetTy::Ty(ref ty) = ret_ty.output { + fn should_ignore_fn(ret_ty: &ast::FunctionRetTy) -> bool { + if let ast::FunctionRetTy::Ty(ref ty) = ret_ty { fn involves_impl_trait(ty: &ast::Ty) -> bool { match ty.kind { ast::TyKind::ImplTrait(..) => true, @@ -742,7 +742,7 @@ impl<'a, 'b> ReplaceBodyWithLoop<'a, 'b> { }, Some(&ast::GenericArgs::Parenthesized(ref data)) => { any_involves_impl_trait(data.inputs.iter()) || - any_involves_impl_trait(data.output.iter()) + ReplaceBodyWithLoop::should_ignore_fn(&data.output) } } }), @@ -762,7 +762,7 @@ impl<'a, 'b> ReplaceBodyWithLoop<'a, 'b> { fn is_sig_const(sig: &ast::FnSig) -> bool { sig.header.constness.node == ast::Constness::Const || - ReplaceBodyWithLoop::should_ignore_fn(&sig.decl) + ReplaceBodyWithLoop::should_ignore_fn(&sig.decl.output) } } |
