Update doctest

This commit is contained in:
Eric Holk 2023-12-04 16:37:45 -08:00
parent 09f0741449
commit ac4d0f240f
No known key found for this signature in database
GPG Key ID: 8EA6B43ED4CE0911

View File

@ -3,7 +3,7 @@ use std::{io, thread};
use crate::doc::{NEEDLESS_DOCTEST_MAIN, TEST_ATTR_IN_DOCTEST};
use clippy_utils::diagnostics::span_lint;
use rustc_ast::{Async, Fn, FnRetTy, Item, ItemKind};
use rustc_ast::{CoroutineKind, Fn, FnRetTy, Item, ItemKind};
use rustc_data_structures::sync::Lrc;
use rustc_errors::emitter::EmitterWriter;
use rustc_errors::Handler;
@ -69,7 +69,7 @@ pub fn check(
if !ignore {
get_test_spans(&item, &mut test_attr_spans);
}
let is_async = matches!(sig.header.asyncness, Async::Yes { .. });
let is_async = matches!(sig.header.coro_kind, CoroutineKind::Async { .. });
let returns_nothing = match &sig.decl.output {
FnRetTy::Default(..) => true,
FnRetTy::Ty(ty) if ty.kind.is_unit() => true,