1
Fork 0

drive-by: Add is_async fn to hir::IsAsync

This commit is contained in:
Michael Goulet 2022-11-19 02:22:24 +00:00
parent fd3bfb3551
commit c4165f3a96
6 changed files with 17 additions and 13 deletions

View file

@ -688,9 +688,7 @@ fn report_trait_method_mismatch<'tcx>(
// Suggestion to change output type. We do not suggest in `async` functions
// to avoid complex logic or incorrect output.
match tcx.hir().expect_impl_item(impl_m.def_id.expect_local()).kind {
ImplItemKind::Fn(ref sig, _)
if sig.header.asyncness == hir::IsAsync::NotAsync =>
{
ImplItemKind::Fn(ref sig, _) if !sig.header.asyncness.is_async() => {
let msg = "change the output type to match the trait";
let ap = Applicability::MachineApplicable;
match sig.decl.output {