From 58a2267c15d7214e8ef9548ce95f2aad4502fbd2 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Tue, 13 Nov 2018 15:50:31 +0100 Subject: [PATCH 1/4] hir: remove an unused hir_vec macro pattern --- src/librustc/hir/mod.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index f57e3ff913b38..dda94bd26bed1 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -58,7 +58,6 @@ macro_rules! hir_vec { ($($x:expr),*) => ( $crate::hir::HirVec::from(vec![$($x),*]) ); - ($($x:expr,)*) => (hir_vec![$($x),*]) } pub mod check_attr; From 5ea0e0d1aa47924ba60d21164b3612fb79716eb3 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Tue, 13 Nov 2018 16:15:16 +0100 Subject: [PATCH 2/4] hir: simplify fmt::Debug for hir::Path --- src/librustc/hir/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index dda94bd26bed1..2dd2deee26165 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -330,7 +330,7 @@ impl Path { impl fmt::Debug for Path { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "path({})", print::to_string(print::NO_ANN, |s| s.print_path(self, false))) + write!(f, "path({})", self) } } From 3d919297b9febda29b649d1862d39a96a4448812 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Tue, 13 Nov 2018 16:24:14 +0100 Subject: [PATCH 3/4] hir: remove an unused type alias --- src/librustc/hir/mod.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index 2dd2deee26165..595655589639d 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -27,7 +27,7 @@ use syntax_pos::{Span, DUMMY_SP, symbol::InternedString}; use syntax::source_map::{self, Spanned}; use rustc_target::spec::abi::Abi; use syntax::ast::{self, CrateSugar, Ident, Name, NodeId, DUMMY_NODE_ID, AsmDialect}; -use syntax::ast::{Attribute, Lit, StrStyle, FloatTy, IntTy, UintTy, MetaItem}; +use syntax::ast::{Attribute, Lit, StrStyle, FloatTy, IntTy, UintTy}; use syntax::attr::InlineAttr; use syntax::ext::hygiene::SyntaxContext; use syntax::ptr::P; @@ -697,8 +697,6 @@ pub struct WhereEqPredicate { pub rhs_ty: P, } -pub type CrateConfig = HirVec>; - /// The top-level data structure that stores the entire contents of /// the crate currently being compiled. /// From cf4f5c3b349d994bb2024c700956f043fc913fe6 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Tue, 13 Nov 2018 17:23:18 +0100 Subject: [PATCH 4/4] hir: simplify a match expression --- src/librustc/hir/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index 595655589639d..af67f8cec8ca8 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -1193,8 +1193,8 @@ impl StmtKind { pub fn id(&self) -> NodeId { match *self { - StmtKind::Decl(_, id) => id, - StmtKind::Expr(_, id) => id, + StmtKind::Decl(_, id) | + StmtKind::Expr(_, id) | StmtKind::Semi(_, id) => id, } }