mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-16 05:58:41 +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
|
/// For checking method call expressions instead of path expressions, use
|
||||||
/// [`is_trait_method`].
|
/// [`is_trait_method`].
|
||||||
///
|
///
|
||||||
/// For example, to find if an expression like `u64::default` refers to an item
|
/// For example, this can be used to find if an expression like `u64::default`
|
||||||
/// of the trait `Default`, which is marked `#[rustc_diagnostic_item = "Default"]`,
|
/// refers to an item of the trait `Default`, which is associated with the
|
||||||
/// a `diag_item` of `sym::Default` should be used.
|
/// `diag_item` of `sym::Default`.
|
||||||
pub fn is_trait_item(cx: &LateContext<'_>, expr: &Expr<'_>, diag_item: Symbol) -> bool {
|
pub fn is_trait_item(cx: &LateContext<'_>, expr: &Expr<'_>, diag_item: Symbol) -> bool {
|
||||||
if let hir::ExprKind::Path(ref qpath) = expr.kind {
|
if let hir::ExprKind::Path(ref qpath) = expr.kind {
|
||||||
cx.qpath_res(qpath, expr.hir_id)
|
cx.qpath_res(qpath, expr.hir_id)
|
||||||
|
|
Loading…
Add table
Reference in a new issue