Skip to content

Commit c532e03

Browse files
committed
librustc: Change std to extra throughout libsyntax and librustc
1 parent f3723cf commit c532e03

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+111
-100
lines changed

src/libextra/std.rc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,16 @@ pub mod test;
119119
pub mod serialize;
120120

121121
// A curious inner-module that's not exported that contains the binding
122-
// 'std' so that macro-expanded references to std::serialize and such
123-
// can be resolved within libcore.
122+
// 'extra' so that macro-expanded references to std::serialize and such
123+
// can be resolved within libextra.
124124
#[doc(hidden)] // FIXME #3538
125125
pub mod std {
126126
pub use serialize;
127127
pub use test;
128128
}
129+
#[doc(hidden)] // FIXME #3538
130+
pub mod extra {
131+
pub use serialize;
132+
pub use test;
133+
}
134+

src/librustc/back/link.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ pub mod jit {
125125

126126
// We need to tell JIT where to resolve all linked
127127
// symbols from. The equivalent of -lstd, -lcore, etc.
128-
// By default the JIT will resolve symbols from the std and
128+
// By default the JIT will resolve symbols from the extra and
129129
// core linked into rustc. We don't want that,
130-
// incase the user wants to use an older std library.
130+
// incase the user wants to use an older extra library.
131131

132132
let cstore = sess.cstore;
133133
for cstore::get_used_crate_files(cstore).each |cratepath| {

src/librustc/driver/driver.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ use core::io;
3030
use core::os;
3131
use core::str;
3232
use core::vec;
33-
use std::getopts::groups::{optopt, optmulti, optflag, optflagopt, getopts};
34-
use std::getopts::{opt_present};
35-
use std::getopts;
33+
use extra::getopts::groups::{optopt, optmulti, optflag, optflagopt, getopts};
34+
use extra::getopts::{opt_present};
35+
use extra::getopts;
3636
use syntax::ast;
3737
use syntax::abi;
3838
use syntax::attr;
@@ -200,7 +200,7 @@ pub fn compile_rest(sess: Session,
200200
crate = time(time_passes, ~"intrinsic injection", ||
201201
front::intrinsic_inject::inject_intrinsic(sess, crate));
202202

203-
crate = time(time_passes, ~"std injection", ||
203+
crate = time(time_passes, ~"extra injection", ||
204204
front::std_inject::maybe_inject_libstd_ref(sess, crate));
205205

206206
let ast_map = time(time_passes, ~"ast indexing", ||
@@ -923,8 +923,8 @@ mod test {
923923
use driver::driver::{build_configuration, build_session};
924924
use driver::driver::{build_session_options, optgroups, str_input};
925925

926-
use std::getopts::groups::getopts;
927-
use std::getopts;
926+
use extra::getopts::groups::getopts;
927+
use extra::getopts;
928928
use syntax::attr;
929929
use syntax::diagnostic;
930930

src/librustc/front/test.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,13 @@ We're going to be building a module that looks more or less like:
258258
259259
mod __test {
260260
#[!resolve_unexported]
261-
extern mod std (name = "std", vers = "...");
261+
extern mod extra (name = "extra", vers = "...");
262262
fn main() {
263263
#[main];
264-
std::test::test_main_static(::os::args(), tests)
264+
extra::test::test_main_static(::os::args(), tests)
265265
}
266266
267-
static tests : &'static [std::test::TestDescAndFn] = &[
267+
static tests : &'static [extra::test::TestDescAndFn] = &[
268268
... the list of tests in the crate ...
269269
];
270270
}
@@ -276,7 +276,7 @@ fn mk_std(cx: &TestCtxt) -> @ast::view_item {
276276
let vers = nospan(vers);
277277
let mi = ast::meta_name_value(@~"vers", vers);
278278
let mi = nospan(mi);
279-
let id_std = cx.sess.ident_of("std");
279+
let id_std = cx.sess.ident_of("extra");
280280
let vi = if is_std(cx) {
281281
ast::view_item_use(
282282
~[@nospan(ast::view_path_simple(id_std,
@@ -297,7 +297,7 @@ fn mk_std(cx: &TestCtxt) -> @ast::view_item {
297297

298298
fn mk_test_module(cx: &TestCtxt) -> @ast::item {
299299

300-
// Link to std
300+
// Link to extra
301301
let view_items = ~[mk_std(cx)];
302302

303303
// A constant vector of test descriptors.
@@ -309,7 +309,7 @@ fn mk_test_module(cx: &TestCtxt) -> @ast::item {
309309
let mainfn = (quote_item!(
310310
pub fn main() {
311311
#[main];
312-
std::test::test_main_static(::os::args(), tests);
312+
extra::test::test_main_static(::os::args(), tests);
313313
}
314314
)).get();
315315

@@ -366,7 +366,7 @@ fn mk_tests(cx: &TestCtxt) -> @ast::item {
366366
let test_descs = mk_test_descs(cx);
367367

368368
(quote_item!(
369-
pub static tests : &'static [self::std::test::TestDescAndFn] =
369+
pub static tests : &'static [self::extra::test::TestDescAndFn] =
370370
$test_descs
371371
;
372372
)).get()
@@ -376,7 +376,7 @@ fn is_std(cx: &TestCtxt) -> bool {
376376
let is_std = {
377377
let items = attr::find_linkage_metas(cx.crate.node.attrs);
378378
match attr::last_meta_item_value_str_by_name(items, "name") {
379-
Some(@~"std") => true,
379+
Some(@~"extra") => true,
380380
_ => false
381381
}
382382
};
@@ -437,9 +437,9 @@ fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> @ast::expr {
437437
};
438438

439439
let t_expr = if test.bench {
440-
quote_expr!( self::std::test::StaticBenchFn($fn_expr) )
440+
quote_expr!( self::extra::test::StaticBenchFn($fn_expr) )
441441
} else {
442-
quote_expr!( self::std::test::StaticTestFn($fn_expr) )
442+
quote_expr!( self::extra::test::StaticTestFn($fn_expr) )
443443
};
444444

445445
let ignore_expr = if test.ignore {
@@ -455,9 +455,9 @@ fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> @ast::expr {
455455
};
456456

457457
let e = quote_expr!(
458-
self::std::test::TestDescAndFn {
459-
desc: self::std::test::TestDesc {
460-
name: self::std::test::StaticTestName($name_expr),
458+
self::extra::test::TestDescAndFn {
459+
desc: self::extra::test::TestDesc {
460+
name: self::extra::test::StaticTestName($name_expr),
461461
ignore: $ignore_expr,
462462
should_fail: $fail_expr
463463
},

src/librustc/metadata/csearch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use metadata::decoder;
1818
use metadata;
1919
use middle::{ty, resolve};
2020

21-
use reader = std::ebml::reader;
21+
use reader = extra::ebml::reader;
2222
use syntax::ast;
2323
use syntax::ast_map;
2424
use syntax::diagnostic::expect;

src/librustc/metadata/cstore.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use metadata::cstore;
1818
use metadata::decoder;
1919

2020
use core::hashmap::HashMap;
21-
use std;
21+
use extra;
2222
use syntax::ast;
2323
use syntax::parse::token::ident_interner;
2424

@@ -152,7 +152,7 @@ pub fn get_dep_hashes(cstore: &CStore) -> ~[~str] {
152152
});
153153
}
154154

155-
let sorted = do std::sort::merge_sort(result) |a, b| {
155+
let sorted = do extra::sort::merge_sort(result) |a, b| {
156156
(a.name, a.vers, a.hash) <= (b.name, b.vers, b.hash)
157157
};
158158

src/librustc/metadata/decoder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ use core::io;
3030
use core::option;
3131
use core::str;
3232
use core::vec;
33-
use std::ebml::reader;
34-
use std::ebml;
35-
use std::serialize::Decodable;
33+
use extra::ebml::reader;
34+
use extra::ebml;
35+
use extra::serialize::Decodable;
3636
use syntax::ast_map;
3737
use syntax::attr;
3838
use syntax::diagnostic::span_handler;

src/librustc/metadata/encoder.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ use middle::ty;
2222
use middle;
2323
use util::ppaux::ty_to_str;
2424

25-
use std::flate;
25+
use extra::flate;
2626
use core::hash::HashUtil;
2727
use core::hashmap::HashMap;
28-
use std::serialize::Encodable;
29-
use std;
28+
use extra::serialize::Encodable;
29+
use extra;
3030
use syntax::abi::AbiSet;
3131
use syntax::ast::*;
3232
use syntax::ast;
@@ -39,7 +39,7 @@ use syntax::{ast_util, visit};
3939
use syntax::opt_vec::OptVec;
4040
use syntax::opt_vec;
4141
use syntax;
42-
use writer = std::ebml::writer;
42+
use writer = extra::ebml::writer;
4343

4444
// used by astencode:
4545
type abbrev_map = @mut HashMap<ty::t, tyencode::ty_abbrev>;
@@ -1288,7 +1288,7 @@ fn encode_crate_deps(ecx: @EncodeContext,
12881288
};
12891289

12901290
// Sort by cnum
1291-
std::sort::quick_sort(deps, |kv1, kv2| kv1.cnum <= kv2.cnum);
1291+
extra::sort::quick_sort(deps, |kv1, kv2| kv1.cnum <= kv2.cnum);
12921292

12931293
// Sanity-check the crate numbers
12941294
let mut expected_cnum = 1;

src/librustc/metadata/loader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use syntax::parse::token::ident_interner;
2323
use syntax::print::pprust;
2424
use syntax::{ast, attr};
2525

26-
use std::flate;
26+
use extra::flate;
2727
use core::os::consts::{macos, freebsd, linux, android, win32};
2828

2929
pub enum os {

src/librustc/middle/astencode.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ use middle::{ty, typeck, moves};
2525
use middle;
2626
use util::ppaux::ty_to_str;
2727

28-
use std::ebml::reader;
29-
use std::ebml;
30-
use std::serialize;
31-
use std::serialize::{Encoder, Encodable, EncoderHelpers, DecoderHelpers};
32-
use std::serialize::{Decoder, Decodable};
28+
use extra::ebml::reader;
29+
use extra::ebml;
30+
use extra::serialize;
31+
use extra::serialize::{Encoder, Encodable, EncoderHelpers, DecoderHelpers};
32+
use extra::serialize::{Decoder, Decodable};
3333
use syntax::ast;
3434
use syntax::ast_map;
3535
use syntax::ast_util::inlined_item_utils;
@@ -39,7 +39,7 @@ use syntax::codemap;
3939
use syntax::fold::*;
4040
use syntax::fold;
4141
use syntax;
42-
use writer = std::ebml::writer;
42+
use writer = extra::ebml::writer;
4343

4444
#[cfg(test)] use syntax::parse;
4545
#[cfg(test)] use syntax::print::pprust;

src/librustc/middle/check_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use middle::typeck::method_map;
1919
use middle::moves;
2020
use util::ppaux::ty_to_str;
2121

22-
use std::sort;
22+
use extra::sort;
2323
use syntax::ast::*;
2424
use syntax::ast_util::{unguarded_pat, walk_pat};
2525
use syntax::codemap::{span, dummy_sp, spanned};

src/librustc/middle/lint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use middle::pat_util;
1717
use util::ppaux::{ty_to_str};
1818

1919
use core::hashmap::HashMap;
20-
use std::smallintmap::SmallIntMap;
20+
use extra::smallintmap::SmallIntMap;
2121
use syntax::attr;
2222
use syntax::codemap::span;
2323
use syntax::codemap;

src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ use util::ppaux::{Repr, ty_to_str};
6767
use core::hash;
6868
use core::hashmap::{HashMap, HashSet};
6969
use core::libc::c_uint;
70-
use std::time;
70+
use extra::time;
7171
use syntax::ast::ident;
7272
use syntax::ast_map::{path, path_elt_to_str, path_name};
7373
use syntax::ast_util::{local_def, path_to_ident};

src/librustc/middle/trans/glue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ use util::ppaux;
3636
use util::ppaux::ty_to_short_str;
3737

3838
use core::libc::c_uint;
39-
use std::time;
39+
use extra::time;
4040
use syntax::ast;
4141

4242
pub fn trans_free(cx: block, v: ValueRef) -> block {

src/librustc/middle/trans/type_use.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ use middle::typeck;
3636
use core::option::{Some, None};
3737
use core::uint;
3838
use core::vec;
39-
use std::list::{List, Cons, Nil};
40-
use std::list;
39+
use extra::list::{List, Cons, Nil};
40+
use extra::list;
4141
use syntax::ast;
4242
use syntax::ast::*;
4343
use syntax::ast_map;

src/librustc/middle/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use util::enum_set::{EnumSet, CLike};
3030
use core::ptr::to_unsafe_ptr;
3131
use core::to_bytes;
3232
use core::hashmap::{HashMap, HashSet};
33-
use std::smallintmap::SmallIntMap;
33+
use extra::smallintmap::SmallIntMap;
3434
use syntax::ast::*;
3535
use syntax::ast_util::is_local;
3636
use syntax::ast_util;

src/librustc/middle/typeck/check/method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ use middle::typeck::check::regionmanip::replace_bound_regions_in_fn_sig;
9696
use util::common::indenter;
9797

9898
use core::hashmap::HashSet;
99-
use std::list::Nil;
99+
use extra::list::Nil;
100100
use syntax::ast::{def_id, sty_value, sty_region, sty_box};
101101
use syntax::ast::{sty_uniq, sty_static, node_id};
102102
use syntax::ast::{m_const, m_mutbl, m_imm};

src/librustc/middle/typeck/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ use util::ppaux;
112112
use core::cast::transmute;
113113
use core::hashmap::HashMap;
114114
use core::util::replace;
115-
use std::list::Nil;
115+
use extra::list::Nil;
116116
use syntax::abi::AbiSet;
117117
use syntax::ast::{provided, required};
118118
use syntax::ast;

src/librustc/middle/typeck/check/regionmanip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use util::common::indenter;
1919
use util::ppaux::region_to_str;
2020
use util::ppaux;
2121

22-
use std::list::Cons;
22+
use extra::list::Cons;
2323

2424
// Helper functions related to manipulating region types.
2525

src/librustc/middle/typeck/infer/glb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use syntax::codemap::span;
3030
use util::common::{indent, indenter};
3131
use util::ppaux::mt_to_str;
3232

33-
use std::list;
33+
use extra::list;
3434

3535
pub struct Glb(CombineFields); // "greatest lower bound" (common subtype)
3636

src/librustc/middle/typeck/infer/lattice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ use middle::typeck::infer::sub::Sub;
4646
use middle::typeck::infer::to_str::InferStr;
4747
use util::common::indenter;
4848

49-
use std::list;
49+
use extra::list;
5050

5151
pub trait LatticeValue {
5252
fn sub(cf: &CombineFields, a: &Self, b: &Self) -> ures;

src/librustc/middle/typeck/infer/lub.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use middle::typeck::isr_alist;
2424
use util::common::indent;
2525
use util::ppaux::mt_to_str;
2626

27-
use std::list;
27+
use extra::list;
2828
use syntax::abi::AbiSet;
2929
use syntax::ast;
3030
use syntax::ast::{Many, Once, extern_fn, m_const, impure_fn};

src/librustc/middle/typeck/infer/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ use middle::typeck::isr_alist;
267267
use util::common::indent;
268268
use util::ppaux::{bound_region_to_str, ty_to_str, trait_ref_to_str};
269269

270-
use std::list::Nil;
271-
use std::smallintmap::SmallIntMap;
270+
use extra::list::Nil;
271+
use extra::smallintmap::SmallIntMap;
272272
use syntax::ast::{m_imm, m_mutbl};
273273
use syntax::ast;
274274
use syntax::codemap;

src/librustc/middle/typeck/infer/sub.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ use middle::typeck::infer::to_str::InferStr;
2323
use util::common::{indent, indenter};
2424
use util::ppaux::bound_region_to_str;
2525

26-
use std::list::Nil;
27-
use std::list;
26+
use extra::list::Nil;
27+
use extra::list;
2828
use syntax::abi::AbiSet;
2929
use syntax::ast;
3030
use syntax::ast::{Onceness, m_const, purity};

0 commit comments

Comments
 (0)