about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-03-11 00:24:15 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-03-16 23:14:42 +0300
commit2fd4cbb3f283b903f55444bb585d38a2539f4e8d (patch)
treed2509e198c34af3e41cce2dbde186635384a418a
parent0cf96131f444f15a2a4ac80f46a86f35fad8309a (diff)
downloadrust-2fd4cbb3f283b903f55444bb585d38a2539f4e8d.tar.gz
rust-2fd4cbb3f283b903f55444bb585d38a2539f4e8d.zip
Fix rebase
-rw-r--r--src/librustc/lint/mod.rs2
-rw-r--r--src/librustc_lint/builtin.rs2
-rw-r--r--src/libsyntax/parse/attr.rs2
3 files changed, 2 insertions, 4 deletions
diff --git a/src/librustc/lint/mod.rs b/src/librustc/lint/mod.rs
index c01b0ae2ccc..b1ff66eb64f 100644
--- a/src/librustc/lint/mod.rs
+++ b/src/librustc/lint/mod.rs
@@ -724,7 +724,7 @@ pub fn struct_lint_level<'a>(sess: &'a Session,
 pub fn maybe_lint_level_root(tcx: TyCtxt<'_, '_, '_>, id: hir::HirId) -> bool {
     let attrs = tcx.hir().attrs_by_hir_id(id);
     for attr in attrs {
-        if Level::from_str(&attr.name().as_str()).is_some() {
+        if attr.ident_str().and_then(Level::from_str).is_some() {
             return true;
         }
     }
diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs
index eb2bf21c42e..80c5eeeeac3 100644
--- a/src/librustc_lint/builtin.rs
+++ b/src/librustc_lint/builtin.rs
@@ -831,7 +831,7 @@ impl UnusedDocComment {
 
             let span = sugared_span.take().unwrap_or_else(|| attr.span);
 
-            if attr.name() == "doc" {
+            if attr.check_name("doc") {
                 let mut err = cx.struct_span_lint(UNUSED_DOC_COMMENTS, span, "unused doc comment");
 
                 err.span_label(
diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs
index e5571757e82..4211268f33e 100644
--- a/src/libsyntax/parse/attr.rs
+++ b/src/libsyntax/parse/attr.rs
@@ -267,8 +267,6 @@ impl<'a> Parser<'a> {
 
     /// matches meta_item_inner : (meta_item | UNSUFFIXED_LIT) ;
     fn parse_meta_item_inner(&mut self) -> PResult<'a, ast::NestedMetaItem> {
-        let lo = self.span;
-
         match self.parse_unsuffixed_lit() {
             Ok(lit) => {
                 return Ok(ast::NestedMetaItem::Literal(lit))