Skip to content

Commit a863ba1

Browse files
authored
Merge pull request #2640 from mikerite/fix_compilation_20180406
Fix compilation for nightly 2018-04-06
2 parents 044b3d9 + fe8068c commit a863ba1

10 files changed

+18
-18
lines changed

clippy_lints/src/attrs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
132132
if_chain! {
133133
if let NestedMetaItemKind::MetaItem(ref mi) = item.node;
134134
if let MetaItemKind::NameValue(ref lit) = mi.node;
135-
if mi.name() == "since";
135+
if mi.ident.name == "since";
136136
then {
137137
check_semver(cx, item.span, lit);
138138
}
@@ -328,7 +328,7 @@ fn check_semver(cx: &LateContext, span: Span, lit: &Lit) {
328328

329329
fn is_word(nmi: &NestedMetaItem, expected: &str) -> bool {
330330
if let NestedMetaItemKind::MetaItem(ref mi) = nmi.node {
331-
mi.is_word() && mi.name() == expected
331+
mi.is_word() && mi.ident.name == expected
332332
} else {
333333
false
334334
}

clippy_lints/src/const_static_lifetime.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl StaticConst {
5656
span_lint_and_then(
5757
cx,
5858
CONST_STATIC_LIFETIME,
59-
lifetime.span,
59+
lifetime.ident.span,
6060
"Constants have by default a `'static` lifetime",
6161
|db| {
6262
db.span_suggestion(ty.span, "consider removing `'static`", sugg);

clippy_lints/src/enum_variants.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ impl LintPass for EnumVariantNames {
119119
}
120120

121121
fn var2str(var: &Variant) -> InternedString {
122-
var.node.name.name.as_str()
122+
var.node.ident.name.as_str()
123123
}
124124

125125
/// Returns the number of chars that match from the start

clippy_lints/src/misc_early.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ impl EarlyLintPass for MiscEarly {
195195
span_lint(
196196
cx,
197197
BUILTIN_TYPE_SHADOW,
198-
ty.span,
198+
ty.ident.span,
199199
&format!("This generic shadows the built-in type `{}`", name),
200200
);
201201
}
@@ -209,7 +209,7 @@ impl EarlyLintPass for MiscEarly {
209209
let type_name = npat.segments
210210
.last()
211211
.expect("A path must have at least one segment")
212-
.identifier
212+
.ident
213213
.name;
214214

215215
for field in pfields {
@@ -267,8 +267,8 @@ impl EarlyLintPass for MiscEarly {
267267
let mut registered_names: HashMap<String, Span> = HashMap::new();
268268

269269
for arg in &decl.inputs {
270-
if let PatKind::Ident(_, sp_ident, None) = arg.pat.node {
271-
let arg_name = sp_ident.node.to_string();
270+
if let PatKind::Ident(_, ident, None) = arg.pat.node {
271+
let arg_name = ident.name.to_string();
272272

273273
if arg_name.starts_with('_') {
274274
if let Some(correspondence) = registered_names.get(&arg_name[1..]) {
@@ -328,13 +328,13 @@ impl EarlyLintPass for MiscEarly {
328328
if let StmtKind::Local(ref local) = w[0].node;
329329
if let Option::Some(ref t) = local.init;
330330
if let ExprKind::Closure(_, _, _, _, _) = t.node;
331-
if let PatKind::Ident(_, sp_ident, _) = local.pat.node;
331+
if let PatKind::Ident(_, ident, _) = local.pat.node;
332332
if let StmtKind::Semi(ref second) = w[1].node;
333333
if let ExprKind::Assign(_, ref call) = second.node;
334334
if let ExprKind::Call(ref closure, _) = call.node;
335335
if let ExprKind::Path(_, ref path) = closure.node;
336336
then {
337-
if sp_ident.node == (&path.segments[0]).identifier {
337+
if ident == (&path.segments[0]).ident {
338338
span_lint(
339339
cx,
340340
REDUNDANT_CLOSURE_CALL,

clippy_lints/src/non_expressive_names.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ struct SimilarNamesNameVisitor<'a: 'b, 'tcx: 'a, 'b>(&'b mut SimilarNamesLocalVi
104104
impl<'a, 'tcx: 'a, 'b> Visitor<'tcx> for SimilarNamesNameVisitor<'a, 'tcx, 'b> {
105105
fn visit_pat(&mut self, pat: &'tcx Pat) {
106106
match pat.node {
107-
PatKind::Ident(_, id, _) => self.check_name(id.span, id.node.name),
107+
PatKind::Ident(_, ident, _) => self.check_name(ident.span, ident.name),
108108
PatKind::Struct(_, ref fields, _) => for field in fields {
109109
if !field.node.is_shorthand {
110110
self.visit_pat(&field.node.pat);

clippy_lints/src/returns.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use rustc::lint::*;
22
use syntax::ast;
3-
use syntax::codemap::{Span, Spanned};
3+
use syntax::codemap::Span;
44
use syntax::visit::FnKind;
55

66
use utils::{in_external_macro, in_macro, match_path_ast, snippet_opt, span_lint_and_then, span_note_and_lint};
@@ -112,9 +112,9 @@ impl ReturnPass {
112112
if local.ty.is_none();
113113
if !local.attrs.iter().any(attr_is_cfg);
114114
if let Some(ref initexpr) = local.init;
115-
if let ast::PatKind::Ident(_, Spanned { node: id, .. }, _) = local.pat.node;
115+
if let ast::PatKind::Ident(_, ident, _) = local.pat.node;
116116
if let ast::ExprKind::Path(_, ref path) = retexpr.node;
117-
if match_path_ast(path, &[&id.name.as_str()]);
117+
if match_path_ast(path, &[&ident.name.as_str()]);
118118
if !in_external_macro(cx, initexpr.span);
119119
then {
120120
span_note_and_lint(cx,

clippy_lints/src/unsafe_removed_from_name.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fn check_use_tree(use_tree: &UseTree, cx: &EarlyContext, span: &Span) {
4949
.segments
5050
.last()
5151
.expect("use paths cannot be empty")
52-
.identifier;
52+
.ident;
5353
unsafe_to_safe_check(old_name, new_name, cx, span);
5454
}
5555
UseTreeKind::Simple(None) |

clippy_lints/src/utils/author.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ fn has_attr(attrs: &[Attribute]) -> bool {
471471
attrs.iter().any(|attr| {
472472
attr.check_name("clippy") && attr.meta_item_list().map_or(false, |list| {
473473
list.len() == 1 && match list[0].node {
474-
ast::NestedMetaItemKind::MetaItem(ref it) => it.name == "author",
474+
ast::NestedMetaItemKind::MetaItem(ref it) => it.ident.name == "author",
475475
ast::NestedMetaItemKind::Literal(_) => false,
476476
}
477477
})

clippy_lints/src/utils/conf.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn file_from_args(
1313
args: &[codemap::Spanned<ast::NestedMetaItemKind>],
1414
) -> Result<Option<path::PathBuf>, (&'static str, codemap::Span)> {
1515
for arg in args.iter().filter_map(|a| a.meta_item()) {
16-
if arg.name() == "conf_file" {
16+
if arg.ident.name == "conf_file" {
1717
return match arg.node {
1818
ast::MetaItemKind::Word | ast::MetaItemKind::List(_) => {
1919
Err(("`conf_file` must be a named value", arg.span))

clippy_lints/src/utils/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ pub fn match_path_ast(path: &ast::Path, segments: &[&str]) -> bool {
237237
.iter()
238238
.rev()
239239
.zip(segments.iter().rev())
240-
.all(|(a, b)| a.identifier.name == *b)
240+
.all(|(a, b)| a.ident.name == *b)
241241
}
242242

243243
/// Get the definition associated to a path.

0 commit comments

Comments
 (0)