Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A handful of hir tweaks #55930

Merged
merged 4 commits into from
Nov 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/librustc/hir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -331,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)
}
}

Expand Down Expand Up @@ -698,8 +697,6 @@ pub struct WhereEqPredicate {
pub rhs_ty: P<Ty>,
}

pub type CrateConfig = HirVec<P<MetaItem>>;

/// The top-level data structure that stores the entire contents of
/// the crate currently being compiled.
///
Expand Down Expand Up @@ -1196,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,
}
}
Expand Down