Skip to content

libsyntax cleanup episode 1 #7365

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
4 changes: 1 addition & 3 deletions src/libsyntax/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use core::prelude::*;

use core::to_bytes;
use std::to_bytes;

#[deriving(Eq)]
pub enum Abi {
Expand Down
12 changes: 5 additions & 7 deletions src/libsyntax/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,16 @@

// The Rust abstract syntax tree.

use core::prelude::*;

use codemap::{span, spanned};
use abi::AbiSet;
use opt_vec::OptVec;
use parse::token::{interner_get, str_to_ident};

use core::hashmap::HashMap;
use core::option::Option;
use core::to_bytes::IterBytes;
use core::to_bytes;
use core::to_str::ToStr;
use std::hashmap::HashMap;
use std::option::Option;
use std::to_bytes::IterBytes;
use std::to_bytes;
use std::to_str::ToStr;
use extra::serialize::{Encodable, Decodable, Encoder, Decoder};


Expand Down
8 changes: 3 additions & 5 deletions src/libsyntax/ast_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use core::prelude::*;

use abi::AbiSet;
use ast::*;
use ast;
Expand All @@ -22,9 +20,9 @@ use print::pprust;
use visit;
use syntax::parse::token::special_idents;

use core::cmp;
use core::hashmap::HashMap;
use core::vec;
use std::cmp;
use std::hashmap::HashMap;
use std::vec;

pub enum path_elt {
path_mod(ident),
Expand Down
16 changes: 7 additions & 9 deletions src/libsyntax/ast_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,20 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use core::prelude::*;

use ast::*;
use ast;
use ast_util;
use codemap::{span, spanned};
use core::cast;
use core::local_data;
use opt_vec;
use parse::token;
use visit;

use core::hashmap::HashMap;
use core::int;
use core::option;
use core::to_bytes;
use std::hashmap::HashMap;
use std::int;
use std::option;
use std::to_bytes;
use std::cast;
use std::local_data;

pub fn path_name_i(idents: &[ident]) -> ~str {
// FIXME: Bad copies (#2543 -- same for everything else that says "bad")
Expand Down Expand Up @@ -793,7 +791,7 @@ pub fn getLast(arr: &~[Mrk]) -> uint {
mod test {
use ast::*;
use super::*;
use core::io;
use std::io;

#[test] fn xorpush_test () {
let mut s = ~[];
Expand Down
8 changes: 3 additions & 5 deletions src/libsyntax/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// Functions dealing with attributes and meta_items

use core::prelude::*;
use extra;

use ast;
use codemap::{spanned, dummy_spanned};
Expand All @@ -19,10 +19,8 @@ use codemap::BytePos;
use diagnostic::span_handler;
use parse::comments::{doc_comment_style, strip_doc_comment_decoration};

use core::hashmap::HashSet;
use core::vec;
use extra;

use std::hashmap::HashSet;
use std::vec;
/* Constructors */

pub fn mk_name_value_item_str(name: @str, value: @str)
Expand Down
8 changes: 3 additions & 5 deletions src/libsyntax/codemap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ source code snippets, etc.

*/

use core::prelude::*;

use core::cmp;
use core::to_bytes;
use core::uint;
use std::cmp;
use std::to_bytes;
use std::uint;
use extra::serialize::{Encodable, Decodable, Encoder, Decoder};

pub trait Pos {
Expand Down
8 changes: 3 additions & 5 deletions src/libsyntax/diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use core::prelude::*;

use codemap::{Pos, span};
use codemap;

use core::io;
use core::uint;
use core::vec;
use std::io;
use std::uint;
use std::vec;
use extra::term;

pub type Emitter = @fn(cmsp: Option<(@codemap::CodeMap, span)>,
Expand Down
5 changes: 2 additions & 3 deletions src/libsyntax/ext/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@
* Inline assembly support.
*/

use core::prelude::*;

use core::vec;
use ast;
use codemap::span;
use ext::base;
use ext::base::*;
use parse;
use parse::token;

use std::vec;

enum State {
Asm,
Outputs,
Expand Down
8 changes: 3 additions & 5 deletions src/libsyntax/ext/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use core::prelude::*;

use core::vec;
use ast;
use ast::Name;
use codemap;
Expand All @@ -22,7 +19,8 @@ use parse;
use parse::token;
use parse::token::{ident_to_str, intern, str_to_ident};

use core::hashmap::HashMap;
use std::vec;
use std::hashmap::HashMap;

// new-style macro! tt code:
//
Expand Down Expand Up @@ -535,7 +533,7 @@ fn satisfies_pred<K : Eq + Hash + IterBytes,V>(map : &mut HashMap<K,V>,
#[cfg(test)]
mod test {
use super::MapChain;
use core::hashmap::HashMap;
use std::hashmap::HashMap;

#[test] fn testenv () {
let mut a = HashMap::new();
Expand Down
2 changes: 0 additions & 2 deletions src/libsyntax/ext/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use core::prelude::*;

use abi::AbiSet;
use ast::ident;
use ast;
Expand Down
2 changes: 0 additions & 2 deletions src/libsyntax/ext/concat_idents.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use core::prelude::*;

use ast;
use codemap::span;
use ext::base::*;
Expand Down
2 changes: 0 additions & 2 deletions src/libsyntax/ext/deriving/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use core::prelude::*;

use ast::{meta_item, item, expr};
use codemap::span;
use ext::base::ExtCtxt;
Expand Down
2 changes: 0 additions & 2 deletions src/libsyntax/ext/deriving/cmp/eq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use core::prelude::*;

use ast::{meta_item, item, expr};
use codemap::span;
use ext::base::ExtCtxt;
Expand Down
2 changes: 0 additions & 2 deletions src/libsyntax/ext/deriving/cmp/ord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use core::prelude::*;

use ast;
use ast::{meta_item, item, expr};
use codemap::span;
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/ext/deriving/cmp/totaleq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use core::prelude::*;
use std::prelude::*;

use ast::{meta_item, item, expr};
use codemap::span;
Expand Down
4 changes: 1 addition & 3 deletions src/libsyntax/ext/deriving/cmp/totalord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use core::prelude::*;

use ast::{meta_item, item, expr};
use codemap::span;
use ext::base::ExtCtxt;
use ext::build::AstBuilder;
use ext::deriving::generic::*;
use core::cmp::{Ordering, Equal, Less, Greater};
use std::cmp::{Ordering, Equal, Less, Greater};

pub fn expand_deriving_totalord(cx: @ExtCtxt,
span: span,
Expand Down
5 changes: 2 additions & 3 deletions src/libsyntax/ext/deriving/decodable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ The compiler code necessary for #[deriving(Decodable)]. See
encodable.rs for more.
*/

use core::prelude::*;
use core::vec;
use core::uint;
use std::vec;
use std::uint;

use ast::{meta_item, item, expr, m_mutbl};
use codemap::span;
Expand Down
2 changes: 0 additions & 2 deletions src/libsyntax/ext/deriving/encodable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ would yield functions like:
}
*/

use core::prelude::*;

use ast::{meta_item, item, expr, m_imm, m_mutbl};
use codemap::span;
use ext::base::ExtCtxt;
Expand Down
8 changes: 3 additions & 5 deletions src/libsyntax/ext/deriving/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ StaticEnum(<ast::enum_def of C>, ~[(<ident of C0>, Left(1)),

*/

use core::prelude::*;

use ast;
use ast::{enum_def, expr, ident, Generics, struct_def};

Expand All @@ -172,8 +170,8 @@ use ext::build::AstBuilder;
use codemap::{span,respan};
use opt_vec;

use core::uint;
use core::vec;
use std::uint;
use std::vec;

pub use self::ty::*;
mod ty;
Expand All @@ -195,7 +193,7 @@ pub struct TraitDef<'self> {
pub struct MethodDef<'self> {
/// name of the method
name: &'self str,
/// List of generics, e.g. `R: core::rand::Rng`
/// List of generics, e.g. `R: std::rand::Rng`
generics: LifetimeBounds<'self>,

/// Whether there is a self argument (outer Option) i.e. whether
Expand Down
2 changes: 0 additions & 2 deletions src/libsyntax/ext/deriving/iter_bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use core::prelude::*;

use ast::{meta_item, item, expr, and};
use codemap::span;
use ext::base::ExtCtxt;
Expand Down
2 changes: 0 additions & 2 deletions src/libsyntax/ext/deriving/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ library.

*/

use core::prelude::*;

use ast::{enum_def, ident, item, Generics, meta_item, struct_def};
use ext::base::ExtCtxt;
use ext::build::AstBuilder;
Expand Down
4 changes: 1 addition & 3 deletions src/libsyntax/ext/deriving/rand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use core::prelude::*;

use ast;
use ast::{meta_item, item, expr, ident};
use codemap::span;
use ext::base::ExtCtxt;
use ext::build::{AstBuilder, Duplicate};
use ext::deriving::generic::*;

use core::vec;
use std::vec;

pub fn expand_deriving_rand(cx: @ExtCtxt,
span: span,
Expand Down
2 changes: 0 additions & 2 deletions src/libsyntax/ext/deriving/to_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use core::prelude::*;

use ast;
use ast::{meta_item, item, expr};
use codemap::span;
Expand Down
4 changes: 1 addition & 3 deletions src/libsyntax/ext/deriving/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ A mini version of ast::Ty, which is easier to use, and features an
explicit `Self` type to use when specifying impls to be derived.
*/

use core::prelude::*;

use ast;
use ast::{expr,Generics,ident};
use ext::base::ExtCtxt;
Expand All @@ -29,7 +27,7 @@ pub enum PtrTy<'self> {
Borrowed(Option<&'self str>, ast::mutability), // &['lifetime] [mut]
}

/// A path, e.g. `::core::option::Option::<int>` (global). Has support
/// A path, e.g. `::std::option::Option::<int>` (global). Has support
/// for type parameters and a lifetime.
pub struct Path<'self> {
path: ~[&'self str],
Expand Down
4 changes: 1 addition & 3 deletions src/libsyntax/ext/deriving/zero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use core::prelude::*;

use ast::{meta_item, item, expr};
use codemap::span;
use ext::base::ExtCtxt;
use ext::build::AstBuilder;
use ext::deriving::generic::*;

use core::vec;
use std::vec;

pub fn expand_deriving_zero(cx: @ExtCtxt,
span: span,
Expand Down
Loading