about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-08-16 04:49:53 +0000
committerbors <bors@rust-lang.org>2019-08-16 04:49:53 +0000
commit348d398b1caeda66a85c9992e79a04e0ccbe3291 (patch)
tree95239cca279a4707afdb894bfab3afb88cca8de2
parentf95c87ecea0a885c8dd16c19a38dc3b46ab0754b (diff)
parent65b906a8fced2f0fb8c56f8f6209e258406d8a36 (diff)
downloadrust-348d398b1caeda66a85c9992e79a04e0ccbe3291.tar.gz
rust-348d398b1caeda66a85c9992e79a04e0ccbe3291.zip
Auto merge of #4395 - lzutao:rustup-63586, r=phansch
Rustup "Remove `Spanned` from `{ast,hir}::FieldPat`"

Rustup https://github.com/rust-lang/rust/pull/63586

changelog: none
-rw-r--r--clippy_lints/src/copies.rs2
-rw-r--r--clippy_lints/src/dbg_macro.rs4
-rw-r--r--clippy_lints/src/misc_early.rs6
-rw-r--r--clippy_lints/src/non_expressive_names.rs4
-rw-r--r--clippy_lints/src/shadow.rs8
-rw-r--r--clippy_lints/src/utils/inspector.rs6
-rw-r--r--clippy_lints/src/utils/mod.rs2
-rw-r--r--clippy_lints/src/write.rs20
8 files changed, 26 insertions, 26 deletions
diff --git a/clippy_lints/src/copies.rs b/clippy_lints/src/copies.rs
index 3894b56c049..64239bb4dd4 100644
--- a/clippy_lints/src/copies.rs
+++ b/clippy_lints/src/copies.rs
@@ -300,7 +300,7 @@ fn bindings<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, pat: &Pat) -> FxHashMap<LocalI
             },
             PatKind::Struct(_, ref fields, _) => {
                 for pat in fields {
-                    bindings_impl(cx, &pat.node.pat, map);
+                    bindings_impl(cx, &pat.pat, map);
                 }
             },
             PatKind::Tuple(ref fields, _) => {
diff --git a/clippy_lints/src/dbg_macro.rs b/clippy_lints/src/dbg_macro.rs
index ff76b35fa21..1dcdaac9b86 100644
--- a/clippy_lints/src/dbg_macro.rs
+++ b/clippy_lints/src/dbg_macro.rs
@@ -31,8 +31,8 @@ declare_lint_pass!(DbgMacro => [DBG_MACRO]);
 
 impl EarlyLintPass for DbgMacro {
     fn check_mac(&mut self, cx: &EarlyContext<'_>, mac: &ast::Mac) {
-        if mac.node.path == sym!(dbg) {
-            if let Some(sugg) = tts_span(mac.node.tts.clone()).and_then(|span| snippet_opt(cx, span)) {
+        if mac.path == sym!(dbg) {
+            if let Some(sugg) = tts_span(mac.tts.clone()).and_then(|span| snippet_opt(cx, span)) {
                 span_lint_and_sugg(
                     cx,
                     DBG_MACRO,
diff --git a/clippy_lints/src/misc_early.rs b/clippy_lints/src/misc_early.rs
index 7d6f29c521b..b998d3f8a33 100644
--- a/clippy_lints/src/misc_early.rs
+++ b/clippy_lints/src/misc_early.rs
@@ -234,7 +234,7 @@ impl EarlyLintPass for MiscEarlyLints {
                 .name;
 
             for field in pfields {
-                if let PatKind::Wild = field.node.pat.node {
+                if let PatKind::Wild = field.pat.node {
                     wilds += 1;
                 }
             }
@@ -252,7 +252,7 @@ impl EarlyLintPass for MiscEarlyLints {
                 let mut normal = vec![];
 
                 for field in pfields {
-                    match field.node.pat.node {
+                    match field.pat.node {
                         PatKind::Wild => {},
                         _ => {
                             if let Ok(n) = cx.sess().source_map().span_to_snippet(field.span) {
@@ -262,7 +262,7 @@ impl EarlyLintPass for MiscEarlyLints {
                     }
                 }
                 for field in pfields {
-                    if let PatKind::Wild = field.node.pat.node {
+                    if let PatKind::Wild = field.pat.node {
                         wilds -= 1;
                         if wilds > 0 {
                             span_lint(
diff --git a/clippy_lints/src/non_expressive_names.rs b/clippy_lints/src/non_expressive_names.rs
index a8c45166a8b..fc614b08a1f 100644
--- a/clippy_lints/src/non_expressive_names.rs
+++ b/clippy_lints/src/non_expressive_names.rs
@@ -131,8 +131,8 @@ impl<'a, 'tcx, 'b> Visitor<'tcx> for SimilarNamesNameVisitor<'a, 'tcx, 'b> {
             PatKind::Ident(_, ident, _) => self.check_ident(ident),
             PatKind::Struct(_, ref fields, _) => {
                 for field in fields {
-                    if !field.node.is_shorthand {
-                        self.visit_pat(&field.node.pat);
+                    if !field.is_shorthand {
+                        self.visit_pat(&field.pat);
                     }
                 }
             },
diff --git a/clippy_lints/src/shadow.rs b/clippy_lints/src/shadow.rs
index 0e75f85cccb..b30f8d415b1 100644
--- a/clippy_lints/src/shadow.rs
+++ b/clippy_lints/src/shadow.rs
@@ -190,20 +190,20 @@ fn check_pat<'a, 'tcx>(
             if let Some(init_struct) = init {
                 if let ExprKind::Struct(_, ref efields, _) = init_struct.node {
                     for field in pfields {
-                        let name = field.node.ident.name;
+                        let name = field.ident.name;
                         let efield = efields
                             .iter()
                             .find_map(|f| if f.ident.name == name { Some(&*f.expr) } else { None });
-                        check_pat(cx, &field.node.pat, efield, span, bindings);
+                        check_pat(cx, &field.pat, efield, span, bindings);
                     }
                 } else {
                     for field in pfields {
-                        check_pat(cx, &field.node.pat, init, span, bindings);
+                        check_pat(cx, &field.pat, init, span, bindings);
                     }
                 }
             } else {
                 for field in pfields {
-                    check_pat(cx, &field.node.pat, None, span, bindings);
+                    check_pat(cx, &field.pat, None, span, bindings);
                 }
             }
         },
diff --git a/clippy_lints/src/utils/inspector.rs b/clippy_lints/src/utils/inspector.rs
index 809590c88bf..309b5165c69 100644
--- a/clippy_lints/src/utils/inspector.rs
+++ b/clippy_lints/src/utils/inspector.rs
@@ -420,11 +420,11 @@ fn print_pat(cx: &LateContext<'_, '_>, pat: &hir::Pat, indent: usize) {
             println!("{}ignore leftover fields: {}", ind, ignore);
             println!("{}fields:", ind);
             for field in fields {
-                println!("{}  field name: {}", ind, field.node.ident.name);
-                if field.node.is_shorthand {
+                println!("{}  field name: {}", ind, field.ident.name);
+                if field.is_shorthand {
                     println!("{}  in shorthand notation", ind);
                 }
-                print_pat(cx, &field.node.pat, indent + 1);
+                print_pat(cx, &field.pat, indent + 1);
             }
         },
         hir::PatKind::TupleStruct(ref path, ref fields, opt_dots_position) => {
diff --git a/clippy_lints/src/utils/mod.rs b/clippy_lints/src/utils/mod.rs
index 9e45c453ae9..9981799ed1d 100644
--- a/clippy_lints/src/utils/mod.rs
+++ b/clippy_lints/src/utils/mod.rs
@@ -783,7 +783,7 @@ pub fn is_refutable(cx: &LateContext<'_, '_>, pat: &Pat) -> bool {
             if is_enum_variant(cx, qpath, pat.hir_id) {
                 true
             } else {
-                are_refutable(cx, fields.iter().map(|field| &*field.node.pat))
+                are_refutable(cx, fields.iter().map(|field| &*field.pat))
             }
         },
         PatKind::TupleStruct(ref qpath, ref pats, _) => {
diff --git a/clippy_lints/src/write.rs b/clippy_lints/src/write.rs
index 3608c0e6125..bcf688c1914 100644
--- a/clippy_lints/src/write.rs
+++ b/clippy_lints/src/write.rs
@@ -183,9 +183,9 @@ declare_lint_pass!(Write => [
 
 impl EarlyLintPass for Write {
     fn check_mac(&mut self, cx: &EarlyContext<'_>, mac: &Mac) {
-        if mac.node.path == sym!(println) {
+        if mac.path == sym!(println) {
             span_lint(cx, PRINT_STDOUT, mac.span, "use of `println!`");
-            if let (Some(fmt_str), _) = check_tts(cx, &mac.node.tts, false) {
+            if let (Some(fmt_str), _) = check_tts(cx, &mac.tts, false) {
                 if fmt_str.contents.is_empty() {
                     span_lint_and_sugg(
                         cx,
@@ -198,9 +198,9 @@ impl EarlyLintPass for Write {
                     );
                 }
             }
-        } else if mac.node.path == sym!(print) {
+        } else if mac.path == sym!(print) {
             span_lint(cx, PRINT_STDOUT, mac.span, "use of `print!`");
-            if let (Some(fmt_str), _) = check_tts(cx, &mac.node.tts, false) {
+            if let (Some(fmt_str), _) = check_tts(cx, &mac.tts, false) {
                 if check_newlines(&fmt_str) {
                     span_lint_and_then(
                         cx,
@@ -211,7 +211,7 @@ impl EarlyLintPass for Write {
                             err.multipart_suggestion(
                                 "use `println!` instead",
                                 vec![
-                                    (mac.node.path.span, String::from("println")),
+                                    (mac.path.span, String::from("println")),
                                     (fmt_str.newline_span(), String::new()),
                                 ],
                                 Applicability::MachineApplicable,
@@ -220,8 +220,8 @@ impl EarlyLintPass for Write {
                     );
                 }
             }
-        } else if mac.node.path == sym!(write) {
-            if let (Some(fmt_str), _) = check_tts(cx, &mac.node.tts, true) {
+        } else if mac.path == sym!(write) {
+            if let (Some(fmt_str), _) = check_tts(cx, &mac.tts, true) {
                 if check_newlines(&fmt_str) {
                     span_lint_and_then(
                         cx,
@@ -232,7 +232,7 @@ impl EarlyLintPass for Write {
                             err.multipart_suggestion(
                                 "use `writeln!()` instead",
                                 vec![
-                                    (mac.node.path.span, String::from("writeln")),
+                                    (mac.path.span, String::from("writeln")),
                                     (fmt_str.newline_span(), String::new()),
                                 ],
                                 Applicability::MachineApplicable,
@@ -241,8 +241,8 @@ impl EarlyLintPass for Write {
                     )
                 }
             }
-        } else if mac.node.path == sym!(writeln) {
-            if let (Some(fmt_str), expr) = check_tts(cx, &mac.node.tts, true) {
+        } else if mac.path == sym!(writeln) {
+            if let (Some(fmt_str), expr) = check_tts(cx, &mac.tts, true) {
                 if fmt_str.contents.is_empty() {
                     let mut applicability = Applicability::MachineApplicable;
                     let suggestion = expr.map_or_else(