Merge remote-tracking branch 'upstream/master' into rustup
This commit is contained in:
commit
b5bf09e57a
156 changed files with 2118 additions and 522 deletions
|
|
@ -1,6 +1,6 @@
|
|||
use super::{DocHeaders, MISSING_ERRORS_DOC, MISSING_PANICS_DOC, MISSING_SAFETY_DOC, UNNECESSARY_SAFETY_DOC};
|
||||
use clippy_utils::diagnostics::{span_lint, span_lint_and_note};
|
||||
use clippy_utils::ty::{implements_trait, is_type_diagnostic_item};
|
||||
use clippy_utils::ty::{implements_trait_with_env, is_type_diagnostic_item};
|
||||
use clippy_utils::{is_doc_hidden, return_ty};
|
||||
use rustc_hir::{BodyId, FnSig, OwnerId, Safety};
|
||||
use rustc_lint::LateContext;
|
||||
|
|
@ -70,7 +70,14 @@ pub fn check(
|
|||
&& let typeck = cx.tcx.typeck_body(body_id)
|
||||
&& let body = cx.tcx.hir().body(body_id)
|
||||
&& let ret_ty = typeck.expr_ty(body.value)
|
||||
&& implements_trait(cx, ret_ty, future, &[])
|
||||
&& implements_trait_with_env(
|
||||
cx.tcx,
|
||||
ty::TypingEnv::non_body_analysis(cx.tcx, owner_id.def_id),
|
||||
ret_ty,
|
||||
future,
|
||||
Some(owner_id.def_id.to_def_id()),
|
||||
&[],
|
||||
)
|
||||
&& let ty::Coroutine(_, subs) = ret_ty.kind()
|
||||
&& is_type_diagnostic_item(cx, subs.as_coroutine().return_ty(), sym::Result)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -797,8 +797,8 @@ fn check_attrs(cx: &LateContext<'_>, valid_idents: &FxHashSet<String>, attrs: &[
|
|||
parser.into_offset_iter(),
|
||||
&doc,
|
||||
Fragments {
|
||||
fragments: &fragments,
|
||||
doc: &doc,
|
||||
fragments: &fragments,
|
||||
},
|
||||
))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ pub(super) fn check(
|
|||
// page. So associated items or impl blocks are not part of this list.
|
||||
ItemKind::Static(..)
|
||||
| ItemKind::Const(..)
|
||||
| ItemKind::Fn{ .. }
|
||||
| ItemKind::Fn { .. }
|
||||
| ItemKind::Macro(..)
|
||||
| ItemKind::Mod(..)
|
||||
| ItemKind::TyAlias(..)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue