Skip to main content

Module noop_method_call

Module noop_method_call 

Source

Re-exportsยง

use rustc_hir::def::DefKind; ๐Ÿ”’
use rustc_hir::Expr; ๐Ÿ”’
use rustc_hir::ExprKind; ๐Ÿ”’
use rustc_lint_defs::declare_lint; ๐Ÿ”’
use rustc_lint_defs::declare_lint_pass; ๐Ÿ”’
use rustc_middle::ty; ๐Ÿ”’
use rustc_middle::ty::Unnormalized; ๐Ÿ”’
use rustc_middle::ty::adjustment::Adjust; ๐Ÿ”’
use rustc_middle::ty::adjustment::DerefAdjustKind; ๐Ÿ”’
use rustc_span::sym; ๐Ÿ”’
use crate::context::LintContext; ๐Ÿ”’
use crate::diagnostics::NoopMethodCallDiag; ๐Ÿ”’
use crate::diagnostics::SuspiciousDoubleRefCloneDiag; ๐Ÿ”’
use crate::diagnostics::SuspiciousDoubleRefDerefDiag; ๐Ÿ”’
use crate::LateContext; ๐Ÿ”’
use crate::LateLintPass; ๐Ÿ”’

Structsยง

NoopMethodCall

Staticsยง

NOOP_METHOD_CALL
The noop_method_call lint detects specific calls to noop methods such as a calling <&T as Clone>::clone where T: !Clone.
SUSPICIOUS_DOUBLE_REF_OP
The suspicious_double_ref_op lint checks for usage of .clone()/.borrow()/.deref() on an &&T when T: !Deref/Borrow/Clone, which means the call will return the inner &T, instead of performing the operation on the underlying T and can be confusing.