Skip to content

Commit b6f6218

Browse files
committed
Auto merge of #4126 - phansch:rustup, r=Manishearth
Rustup to rust-lang/rust#60740 rust-lang/rust#60740 changelog: none
2 parents 64c1d3b + 635a2fa commit b6f6218

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

clippy_lints/src/const_static_lifetime.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl StaticConst {
4747
if let Some(lifetime) = *optional_lifetime {
4848
match borrow_type.ty.node {
4949
TyKind::Path(..) | TyKind::Slice(..) | TyKind::Array(..) | TyKind::Tup(..) => {
50-
if lifetime.ident.name == syntax::symbol::keywords::StaticLifetime.name() {
50+
if lifetime.ident.name == syntax::symbol::kw::StaticLifetime {
5151
let snip = snippet(cx, borrow_type.ty.span, "<type>");
5252
let sugg = format!("&{}", snip);
5353
span_lint_and_then(

clippy_lints/src/lifetimes.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintC
66
use rustc::{declare_lint_pass, declare_tool_lint};
77
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
88
use syntax::source_map::Span;
9-
use syntax::symbol::keywords;
9+
use syntax::symbol::kw;
1010

1111
use crate::reexport::*;
1212
use crate::utils::{last_path_segment, span_lint};
@@ -476,8 +476,8 @@ struct BodyLifetimeChecker {
476476
impl<'tcx> Visitor<'tcx> for BodyLifetimeChecker {
477477
// for lifetimes as parameters of generics
478478
fn visit_lifetime(&mut self, lifetime: &'tcx Lifetime) {
479-
if lifetime.name.ident().name != keywords::Invalid.name()
480-
&& lifetime.name.ident().name != syntax::symbol::keywords::StaticLifetime.name()
479+
if lifetime.name.ident().name != kw::Invalid
480+
&& lifetime.name.ident().name != kw::StaticLifetime
481481
{
482482
self.lifetimes_used_in_body = true;
483483
}

clippy_lints/src/use_self.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustc::ty;
88
use rustc::ty::{DefIdTree, Ty};
99
use rustc::{declare_lint_pass, declare_tool_lint};
1010
use rustc_errors::Applicability;
11-
use syntax_pos::symbol::keywords::SelfUpper;
11+
use syntax_pos::symbol::kw;
1212

1313
use crate::utils::span_lint_and_sugg;
1414

@@ -220,7 +220,7 @@ struct UseSelfVisitor<'a, 'tcx: 'a> {
220220

221221
impl<'a, 'tcx> Visitor<'tcx> for UseSelfVisitor<'a, 'tcx> {
222222
fn visit_path(&mut self, path: &'tcx Path, _id: HirId) {
223-
if path.segments.last().expect(SEGMENTS_MSG).ident.name != SelfUpper.name() {
223+
if path.segments.last().expect(SEGMENTS_MSG).ident.name != kw::SelfUpper {
224224
if self.item_path.res == path.res {
225225
span_use_self_lint(self.cx, path);
226226
} else if let Res::Def(DefKind::Ctor(def::CtorOf::Struct, CtorKind::Fn), ctor_did) = path.res {

clippy_lints/src/utils/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ use syntax::ast::{self, LitKind};
4545
use syntax::attr;
4646
use syntax::ext::hygiene::ExpnFormat;
4747
use syntax::source_map::{Span, DUMMY_SP};
48-
use syntax::symbol::{keywords, Symbol};
48+
use syntax::symbol::{kw, Symbol};
4949

5050
use crate::reexport::*;
5151

@@ -839,7 +839,7 @@ pub fn remove_blocks(expr: &Expr) -> &Expr {
839839

840840
pub fn is_self(slf: &Arg) -> bool {
841841
if let PatKind::Binding(.., name, _) = slf.pat.node {
842-
name.name == keywords::SelfLower.name()
842+
name.name == kw::SelfLower
843843
} else {
844844
false
845845
}

0 commit comments

Comments
 (0)