Skip to content

Commit 4896a9c

Browse files
committed
Auto merge of #4792 - lzutao:rustup-65916, r=Manishearth
rustup rust-lang/rust#65916 cc rust-lang/rust#65916 changelog: none
2 parents 4be144a + 1a442d8 commit 4896a9c

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

clippy_lints/src/exit.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Exit {
3232
if let Some(def_id) = qpath_res(cx, path, path_expr.hir_id).opt_def_id();
3333
if match_def_path(cx, def_id, &paths::EXIT);
3434
then {
35-
let mut parent = cx.tcx.hir().get_parent_item(e.hir_id);
36-
if let Some(Node::Item(Item{ident, kind: ItemKind::Fn(..), ..})) = cx.tcx.hir().find(parent) {
35+
let parent = cx.tcx.hir().get_parent_item(e.hir_id);
36+
if let Some(Node::Item(Item{kind: ItemKind::Fn(..), ..})) = cx.tcx.hir().find(parent) {
3737
// If the next item up is a function we check if it is an entry point
3838
// and only then emit a linter warning
3939
let def_id = cx.tcx.hir().local_def_id(parent);

clippy_lints/src/utils/sugg.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::borrow::Cow;
1212
use std::convert::TryInto;
1313
use std::fmt::Display;
1414
use syntax::ast;
15-
use syntax::parse::token;
15+
use syntax::token;
1616
use syntax::print::pprust::token_kind_to_string;
1717
use syntax::source_map::{CharPos, Span};
1818
use syntax::util::parser::AssocOp;
@@ -440,7 +440,7 @@ fn associativity(op: &AssocOp) -> Associativity {
440440

441441
/// Converts a `hir::BinOp` to the corresponding assigning binary operator.
442442
fn hirbinop2assignop(op: hir::BinOp) -> AssocOp {
443-
use syntax::parse::token::BinOpToken::*;
443+
use syntax::token::BinOpToken::*;
444444

445445
AssocOp::AssignOp(match op.node {
446446
hir::BinOpKind::Add => Plus,
@@ -468,7 +468,7 @@ fn hirbinop2assignop(op: hir::BinOp) -> AssocOp {
468468
/// Converts an `ast::BinOp` to the corresponding assigning binary operator.
469469
fn astbinop2assignop(op: ast::BinOp) -> AssocOp {
470470
use syntax::ast::BinOpKind::*;
471-
use syntax::parse::token::BinOpToken;
471+
use syntax::token::BinOpToken;
472472

473473
AssocOp::AssignOp(match op.node {
474474
Add => BinOpToken::Plus,

clippy_lints/src/write.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ use rustc::{declare_lint_pass, declare_tool_lint};
44
use rustc_errors::Applicability;
55
use std::borrow::Cow;
66
use syntax::ast::*;
7-
use syntax::parse::{parser, token};
7+
use syntax::parse::parser;
8+
use syntax::token;
89
use syntax::tokenstream::TokenStream;
910
use syntax_pos::{BytePos, Span};
1011

0 commit comments

Comments
 (0)