mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 23:20:39 +00:00
Reword is_trait_item description
This commit is contained in:
parent
23d398b184
commit
295df88986
1 changed files with 3 additions and 3 deletions
|
@ -332,9 +332,9 @@ pub fn is_trait_method(cx: &LateContext<'_>, expr: &Expr<'_>, diag_item: Symbol)
|
|||
/// For checking method call expressions instead of path expressions, use
|
||||
/// [`is_trait_method`].
|
||||
///
|
||||
/// For example, to find if an expression like `u64::default` refers to an item
|
||||
/// of the trait `Default`, which is marked `#[rustc_diagnostic_item = "Default"]`,
|
||||
/// a `diag_item` of `sym::Default` should be used.
|
||||
/// For example, this can be used to find if an expression like `u64::default`
|
||||
/// refers to an item of the trait `Default`, which is associated with the
|
||||
/// `diag_item` of `sym::Default`.
|
||||
pub fn is_trait_item(cx: &LateContext<'_>, expr: &Expr<'_>, diag_item: Symbol) -> bool {
|
||||
if let hir::ExprKind::Path(ref qpath) = expr.kind {
|
||||
cx.qpath_res(qpath, expr.hir_id)
|
||||
|
|
Loading…
Reference in a new issue