Merge pull request #3501 from matthiaskrgr/rustup
rustup clippy build with latest rustc
This commit is contained in:
@@ -14,7 +14,7 @@ use crate::rustc::ty;
|
|||||||
use crate::rustc::{declare_tool_lint, lint_array};
|
use crate::rustc::{declare_tool_lint, lint_array};
|
||||||
use crate::rustc_errors::Applicability;
|
use crate::rustc_errors::Applicability;
|
||||||
use crate::syntax::ast::NodeId;
|
use crate::syntax::ast::NodeId;
|
||||||
use crate::syntax_pos::symbol::keywords::SelfType;
|
use crate::syntax_pos::symbol::keywords::SelfUpper;
|
||||||
use crate::utils::{in_macro, span_lint_and_sugg};
|
use crate::utils::{in_macro, span_lint_and_sugg};
|
||||||
use if_chain::if_chain;
|
use if_chain::if_chain;
|
||||||
|
|
||||||
@@ -226,7 +226,7 @@ struct UseSelfVisitor<'a, 'tcx: 'a> {
|
|||||||
|
|
||||||
impl<'a, 'tcx> Visitor<'tcx> for UseSelfVisitor<'a, 'tcx> {
|
impl<'a, 'tcx> Visitor<'tcx> for UseSelfVisitor<'a, 'tcx> {
|
||||||
fn visit_path(&mut self, path: &'tcx Path, _id: HirId) {
|
fn visit_path(&mut self, path: &'tcx Path, _id: HirId) {
|
||||||
if self.item_path.def == path.def && path.segments.last().expect(SEGMENTS_MSG).ident.name != SelfType.name() {
|
if self.item_path.def == path.def && path.segments.last().expect(SEGMENTS_MSG).ident.name != SelfUpper.name() {
|
||||||
span_use_self_lint(self.cx, path);
|
span_use_self_lint(self.cx, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -970,7 +970,7 @@ pub fn opt_def_id(def: Def) -> Option<DefId> {
|
|||||||
|
|
||||||
pub fn is_self(slf: &Arg) -> bool {
|
pub fn is_self(slf: &Arg) -> bool {
|
||||||
if let PatKind::Binding(_, _, name, _) = slf.pat.node {
|
if let PatKind::Binding(_, _, name, _) = slf.pat.node {
|
||||||
name.name == keywords::SelfValue.name()
|
name.name == keywords::SelfLower.name()
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user