Skip to content

Commit

Permalink
rust_ast::ast => rustc_ast
Browse files Browse the repository at this point in the history
  • Loading branch information
ryzokuken authored and JulianKnodt committed Aug 17, 2020
1 parent 8d185ca commit a888b02
Show file tree
Hide file tree
Showing 217 changed files with 303 additions and 304 deletions.
2 changes: 2 additions & 0 deletions src/librustc_ast/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ pub mod token;
pub mod tokenstream;
pub mod visit;

pub use self::ast::*;

use rustc_data_structures::stable_hasher::{HashStable, StableHasher};

/// Requirements for a `StableHashingContext` to be used in this crate.
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_ast_lowering/expr.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use super::{ImplTraitContext, LoweringContext, ParamMode, ParenthesizedGenericArgs};

use rustc_ast::ast::*;
use rustc_ast::attr;
use rustc_ast::ptr::P as AstP;
use rustc_ast::*;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stack::ensure_sufficient_stack;
use rustc_data_structures::thin_vec::ThinVec;
Expand Down Expand Up @@ -861,7 +861,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
e2: Option<&Expr>,
lims: RangeLimits,
) -> hir::ExprKind<'hir> {
use rustc_ast::ast::RangeLimits::*;
use rustc_ast::RangeLimits::*;

let path = match (e1, e2, lims) {
(None, None, HalfOpen) => sym::RangeFull,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_ast_lowering/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ use super::{AnonymousLifetimeMode, LoweringContext, ParamMode};
use super::{ImplTraitContext, ImplTraitPosition};
use crate::Arena;

use rustc_ast::ast::*;
use rustc_ast::node_id::NodeMap;
use rustc_ast::ptr::P;
use rustc_ast::visit::{self, AssocCtxt, FnCtxt, FnKind, Visitor};
use rustc_ast::*;
use rustc_data_structures::fx::FxHashSet;
use rustc_errors::struct_span_err;
use rustc_hir as hir;
Expand Down
3 changes: 1 addition & 2 deletions src/librustc_ast_lowering/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@
#![feature(or_patterns)]
#![recursion_limit = "256"]

use rustc_ast::ast;
use rustc_ast::ast::*;
use rustc_ast::node_id::NodeMap;
use rustc_ast::token::{self, DelimToken, Nonterminal, Token};
use rustc_ast::tokenstream::{DelimSpan, TokenStream, TokenTree};
use rustc_ast::visit::{self, AssocCtxt, Visitor};
use rustc_ast::walk_list;
use rustc_ast::{self as ast, *};
use rustc_ast_pretty::pprust;
use rustc_data_structures::captures::Captures;
use rustc_data_structures::fx::FxHashSet;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_ast_lowering/pat.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::{ImplTraitContext, LoweringContext, ParamMode};

use rustc_ast::ast::*;
use rustc_ast::ptr::P;
use rustc_ast::*;
use rustc_data_structures::stack::ensure_sufficient_stack;
use rustc_errors::Applicability;
use rustc_hir as hir;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_ast_lowering/path.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::{AnonymousLifetimeMode, ImplTraitContext, LoweringContext, ParamMode};
use super::{GenericArgsCtor, ParenthesizedGenericArgs};

use rustc_ast::ast::{self, *};
use rustc_ast::{self as ast, *};
use rustc_errors::{struct_span_err, Applicability};
use rustc_hir as hir;
use rustc_hir::def::{DefKind, PartialRes, Res};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_ast_passes/ast_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
// or type checking or some other kind of complex analysis.

use itertools::{Either, Itertools};
use rustc_ast::ast::*;
use rustc_ast::ptr::P;
use rustc_ast::visit::{self, AssocCtxt, FnCtxt, FnKind, Visitor};
use rustc_ast::walk_list;
use rustc_ast::*;
use rustc_ast_pretty::pprust;
use rustc_data_structures::fx::FxHashMap;
use rustc_errors::{error_code, pluralize, struct_span_err, Applicability};
Expand Down
5 changes: 3 additions & 2 deletions src/librustc_ast_passes/feature_gate.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use rustc_ast::ast::{self, AssocTyConstraint, AssocTyConstraintKind, NodeId};
use rustc_ast::ast::{GenericParam, GenericParamKind, PatKind, RangeEnd, VariantData};
use rustc_ast as ast;
use rustc_ast::visit::{self, AssocCtxt, FnCtxt, FnKind, Visitor};
use rustc_ast::{AssocTyConstraint, AssocTyConstraintKind, NodeId};
use rustc_ast::{GenericParam, GenericParamKind, PatKind, RangeEnd, VariantData};
use rustc_errors::struct_span_err;
use rustc_feature::{AttributeGate, BUILTIN_ATTRIBUTE_MAP};
use rustc_feature::{Features, GateIssue};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_ast_passes/node_count.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Simply gives a rough count of the number of nodes in an AST.

use rustc_ast::ast::*;
use rustc_ast::visit::*;
use rustc_ast::*;
use rustc_span::symbol::Ident;
use rustc_span::Span;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_ast_passes/show_span.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use std::str::FromStr;

use rustc_ast::ast;
use rustc_ast as ast;
use rustc_ast::visit;
use rustc_ast::visit::Visitor;

Expand Down
20 changes: 10 additions & 10 deletions src/librustc_ast_pretty/pprust.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
use crate::pp::Breaks::{Consistent, Inconsistent};
use crate::pp::{self, Breaks};

use rustc_ast::ast::{self, BlockCheckMode, PatKind, RangeEnd, RangeSyntax};
use rustc_ast::ast::{Attribute, GenericArg, MacArgs};
use rustc_ast::ast::{GenericBound, SelfKind, TraitBoundModifier};
use rustc_ast::ast::{InlineAsmOperand, InlineAsmRegOrRegClass};
use rustc_ast::ast::{InlineAsmOptions, InlineAsmTemplatePiece};
use rustc_ast::attr;
use rustc_ast::ptr::P;
use rustc_ast::token::{self, BinOpToken, CommentKind, DelimToken, Nonterminal, Token, TokenKind};
use rustc_ast::tokenstream::{TokenStream, TokenTree};
use rustc_ast::util::classify;
use rustc_ast::util::comments::{gather_comments, Comment, CommentStyle};
use rustc_ast::util::parser::{self, AssocOp, Fixity};
use rustc_ast::{self as ast, BlockCheckMode, PatKind, RangeEnd, RangeSyntax};
use rustc_ast::{GenericArg, MacArgs};
use rustc_ast::{GenericBound, SelfKind, TraitBoundModifier};
use rustc_ast::{InlineAsmOperand, InlineAsmRegOrRegClass};
use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece};
use rustc_span::edition::Edition;
use rustc_span::source_map::{SourceMap, Spanned};
use rustc_span::symbol::{kw, sym, Ident, IdentPrinter, Symbol};
Expand Down Expand Up @@ -902,7 +902,7 @@ impl<'a> State<'a> {
}
}

crate fn print_foreign_mod(&mut self, nmod: &ast::ForeignMod, attrs: &[Attribute]) {
crate fn print_foreign_mod(&mut self, nmod: &ast::ForeignMod, attrs: &[ast::Attribute]) {
self.print_inner_attributes(attrs);
for item in &nmod.items {
self.print_foreign_item(item);
Expand Down Expand Up @@ -1666,7 +1666,7 @@ impl<'a> State<'a> {
}
}

fn print_expr_vec(&mut self, exprs: &[P<ast::Expr>], attrs: &[Attribute]) {
fn print_expr_vec(&mut self, exprs: &[P<ast::Expr>], attrs: &[ast::Attribute]) {
self.ibox(INDENT_UNIT);
self.s.word("[");
self.print_inner_attributes_inline(attrs);
Expand All @@ -1679,7 +1679,7 @@ impl<'a> State<'a> {
&mut self,
element: &ast::Expr,
count: &ast::AnonConst,
attrs: &[Attribute],
attrs: &[ast::Attribute],
) {
self.ibox(INDENT_UNIT);
self.s.word("[");
Expand All @@ -1696,7 +1696,7 @@ impl<'a> State<'a> {
path: &ast::Path,
fields: &[ast::Field],
wth: &Option<P<ast::Expr>>,
attrs: &[Attribute],
attrs: &[ast::Attribute],
) {
self.print_path(path, true, 0);
self.s.word("{");
Expand Down Expand Up @@ -1736,7 +1736,7 @@ impl<'a> State<'a> {
self.s.word("}");
}

fn print_expr_tup(&mut self, exprs: &[P<ast::Expr>], attrs: &[Attribute]) {
fn print_expr_tup(&mut self, exprs: &[P<ast::Expr>], attrs: &[ast::Attribute]) {
self.popen();
self.print_inner_attributes_inline(attrs);
self.commasep_exprs(Inconsistent, &exprs[..]);
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_ast_pretty/pprust/tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::*;

use rustc_ast::ast;
use rustc_ast as ast;
use rustc_span::source_map::respan;
use rustc_span::symbol::Ident;
use rustc_span::with_default_session_globals;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_attr/builtin.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Parsing and validation of builtin attributes

use rustc_ast::ast::{self, Attribute, Lit, LitKind, MetaItem, MetaItemKind, NestedMetaItem};
use rustc_ast::{self as ast, Attribute, Lit, LitKind, MetaItem, MetaItemKind, NestedMetaItem};
use rustc_ast_pretty::pprust;
use rustc_errors::{struct_span_err, Applicability};
use rustc_feature::{find_gated_cfg, is_builtin_attr_name, Features, GatedCfg};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_builtin_macros/asm.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use rustc_ast::ast;
use rustc_ast as ast;
use rustc_ast::ptr::P;
use rustc_ast::token;
use rustc_ast::tokenstream::TokenStream;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_builtin_macros/assert.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use rustc_errors::{Applicability, DiagnosticBuilder};

use rustc_ast::ast::{self, *};
use rustc_ast::ptr::P;
use rustc_ast::token::{self, TokenKind};
use rustc_ast::tokenstream::{DelimSpan, TokenStream, TokenTree};
use rustc_ast::{self as ast, *};
use rustc_ast_pretty::pprust;
use rustc_expand::base::*;
use rustc_parse::parser::Parser;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_builtin_macros/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! a literal `true` or `false` based on whether the given cfg matches the
//! current compilation environment.

use rustc_ast::ast;
use rustc_ast as ast;
use rustc_ast::token;
use rustc_ast::tokenstream::TokenStream;
use rustc_attr as attr;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_builtin_macros/cfg_accessible.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Implementation of the `#[cfg_accessible(path)]` attribute macro.

use rustc_ast::ast;
use rustc_ast as ast;
use rustc_expand::base::{Annotatable, ExpandResult, ExtCtxt, MultiItemModifier};
use rustc_feature::AttributeTemplate;
use rustc_parse::validate_attr;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_builtin_macros/cmdline_attrs.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! Attributes injected into the crate root from command line using `-Z crate-attr`.

use rustc_ast::ast::{self, AttrItem, AttrStyle};
use rustc_ast::attr::mk_attr;
use rustc_ast::token;
use rustc_ast::{self as ast, AttrItem, AttrStyle};
use rustc_session::parse::ParseSess;
use rustc_span::FileName;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_builtin_macros/concat.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use rustc_ast::ast;
use rustc_ast as ast;
use rustc_ast::tokenstream::TokenStream;
use rustc_expand::base::{self, DummyResult};
use rustc_span::symbol::Symbol;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_builtin_macros/concat_idents.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use rustc_ast::ast;
use rustc_ast as ast;
use rustc_ast::ptr::P;
use rustc_ast::token::{self, Token};
use rustc_ast::tokenstream::{TokenStream, TokenTree};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_builtin_macros/deriving/bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::deriving::generic::ty::*;
use crate::deriving::generic::*;
use crate::deriving::path_std;

use rustc_ast::ast::MetaItem;
use rustc_ast::MetaItem;
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_builtin_macros/deriving/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use crate::deriving::generic::ty::*;
use crate::deriving::generic::*;
use crate::deriving::path_std;

use rustc_ast::ast::{self, Expr, GenericArg, Generics, ItemKind, MetaItem, VariantData};
use rustc_ast::ptr::P;
use rustc_ast::{self as ast, Expr, GenericArg, Generics, ItemKind, MetaItem, VariantData};
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::symbol::{kw, sym, Ident, Symbol};
use rustc_span::Span;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_builtin_macros/deriving/cmp/eq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use crate::deriving::generic::ty::*;
use crate::deriving::generic::*;
use crate::deriving::path_std;

use rustc_ast::ast::{self, Expr, GenericArg, MetaItem};
use rustc_ast::ptr::P;
use rustc_ast::{self as ast, Expr, GenericArg, MetaItem};
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::symbol::{sym, Ident, Symbol};
use rustc_span::Span;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_builtin_macros/deriving/cmp/ord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use crate::deriving::generic::ty::*;
use crate::deriving::generic::*;
use crate::deriving::path_std;

use rustc_ast::ast::{self, Expr, MetaItem};
use rustc_ast::ptr::P;
use rustc_ast::{self as ast, Expr, MetaItem};
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::symbol::{sym, Ident};
use rustc_span::Span;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_builtin_macros/deriving/cmp/partial_eq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use crate::deriving::generic::ty::*;
use crate::deriving::generic::*;
use crate::deriving::{path_local, path_std};

use rustc_ast::ast::{BinOpKind, Expr, MetaItem};
use rustc_ast::ptr::P;
use rustc_ast::{BinOpKind, Expr, MetaItem};
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::symbol::sym;
use rustc_span::Span;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_builtin_macros/deriving/cmp/partial_ord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use crate::deriving::generic::ty::*;
use crate::deriving::generic::*;
use crate::deriving::{path_local, path_std, pathvec_std};

use rustc_ast::ast::{self, BinOpKind, Expr, MetaItem};
use rustc_ast::ptr::P;
use rustc_ast::{self as ast, BinOpKind, Expr, MetaItem};
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::symbol::{sym, Ident, Symbol};
use rustc_span::Span;
Expand Down
3 changes: 1 addition & 2 deletions src/librustc_builtin_macros/deriving/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ use crate::deriving::generic::ty::*;
use crate::deriving::generic::*;
use crate::deriving::path_std;

use rustc_ast::ast;
use rustc_ast::ast::{Expr, MetaItem};
use rustc_ast::ptr::P;
use rustc_ast::{self as ast, Expr, MetaItem};
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::symbol::{sym, Ident};
use rustc_span::{Span, DUMMY_SP};
Expand Down
3 changes: 1 addition & 2 deletions src/librustc_builtin_macros/deriving/decodable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ use crate::deriving::generic::ty::*;
use crate::deriving::generic::*;
use crate::deriving::pathvec_std;

use rustc_ast::ast;
use rustc_ast::ast::{Expr, MetaItem, Mutability};
use rustc_ast::ptr::P;
use rustc_ast::{self as ast, Expr, MetaItem, Mutability};
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::symbol::{sym, Ident, Symbol};
use rustc_span::Span;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_builtin_macros/deriving/default.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use crate::deriving::generic::ty::*;
use crate::deriving::generic::*;

use rustc_ast::ast::{Expr, MetaItem};
use rustc_ast::ptr::P;
use rustc_ast::{Expr, MetaItem};
use rustc_errors::struct_span_err;
use rustc_expand::base::{Annotatable, DummyResult, ExtCtxt};
use rustc_span::symbol::{kw, sym};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_builtin_macros/deriving/encodable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ use crate::deriving::generic::ty::*;
use crate::deriving::generic::*;
use crate::deriving::pathvec_std;

use rustc_ast::ast::{Expr, ExprKind, MetaItem, Mutability};
use rustc_ast::ptr::P;
use rustc_ast::{Expr, ExprKind, MetaItem, Mutability};
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::symbol::{sym, Ident, Symbol};
use rustc_span::Span;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_builtin_macros/deriving/generic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ use std::cell::RefCell;
use std::iter;
use std::vec;

use rustc_ast::ast::{self, BinOpKind, EnumDef, Expr, Generics, PatKind};
use rustc_ast::ast::{GenericArg, GenericParamKind, VariantData};
use rustc_ast::ptr::P;
use rustc_ast::{self as ast, BinOpKind, EnumDef, Expr, Generics, PatKind};
use rustc_ast::{GenericArg, GenericParamKind, VariantData};
use rustc_attr as attr;
use rustc_data_structures::map_in_place::MapInPlace;
use rustc_expand::base::{Annotatable, ExtCtxt};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_builtin_macros/deriving/generic/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
pub use PtrTy::*;
pub use Ty::*;

use rustc_ast::ast::{self, Expr, GenericArg, GenericParamKind, Generics, SelfKind};
use rustc_ast::ptr::P;
use rustc_ast::{self as ast, Expr, GenericArg, GenericParamKind, Generics, SelfKind};
use rustc_expand::base::ExtCtxt;
use rustc_span::source_map::{respan, DUMMY_SP};
use rustc_span::symbol::{kw, Ident, Symbol};
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_builtin_macros/deriving/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use crate::deriving::generic::ty::*;
use crate::deriving::generic::*;
use crate::deriving::{self, path_std, pathvec_std};

use rustc_ast::ast::{Expr, MetaItem, Mutability};
use rustc_ast::ptr::P;
use rustc_ast::{Expr, MetaItem, Mutability};
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::symbol::sym;
use rustc_span::Span;
Expand Down
3 changes: 2 additions & 1 deletion src/librustc_builtin_macros/deriving/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
//! The compiler code necessary to implement the `#[derive]` extensions.

use rustc_ast::ast::{self, ItemKind, MetaItem};
use rustc_ast as ast;
use rustc_ast::ptr::P;
use rustc_ast::{ItemKind, MetaItem};
use rustc_expand::base::{Annotatable, ExpandResult, ExtCtxt, MultiItemModifier};
use rustc_span::symbol::{sym, Ident, Symbol};
use rustc_span::Span;
Expand Down
Loading

0 comments on commit a888b02

Please sign in to comment.