Skip to content

Commit d2b0b11

Browse files
committed
auto merge of #9296 : alexcrichton/rust/snapshots, r=cmr
huzzah!
2 parents b43ee6c + 817576e commit d2b0b11

32 files changed

+32
-1663
lines changed

src/libextra/glob.rs

-39
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,6 @@ fn list_dir_sorted(path: &Path) -> ~[Path] {
137137
/**
138138
* A compiled Unix shell style pattern.
139139
*/
140-
#[cfg(stage0)]
141-
#[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, IterBytes)]
142-
pub struct Pattern {
143-
priv tokens: ~[PatternToken]
144-
}
145-
146-
/**
147-
* A compiled Unix shell style pattern.
148-
*/
149-
#[cfg(not(stage0))]
150140
#[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, IterBytes, Default)]
151141
pub struct Pattern {
152142
priv tokens: ~[PatternToken]
@@ -465,39 +455,10 @@ fn is_sep(c: char) -> bool {
465455
}
466456
}
467457
468-
/**
469-
* Configuration options to modify the behaviour of `Pattern::matches_with(..)`
470-
*/
471-
#[cfg(stage0)]
472-
#[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, IterBytes)]
473-
pub struct MatchOptions {
474-
475-
/**
476-
* Whether or not patterns should be matched in a case-sensitive manner. This
477-
* currently only considers upper/lower case relationships between ASCII characters,
478-
* but in future this might be extended to work with Unicode.
479-
*/
480-
case_sensitive: bool,
481-
482-
/**
483-
* If this is true then path-component separator characters (e.g. `/` on Posix)
484-
* must be matched by a literal `/`, rather than by `*` or `?` or `[...]`
485-
*/
486-
require_literal_separator: bool,
487-
488-
/**
489-
* If this is true then paths that contain components that start with a `.` will
490-
* not match unless the `.` appears literally in the pattern: `*`, `?` or `[...]`
491-
* will not match. This is useful because such files are conventionally considered
492-
* hidden on Unix systems and it might be desirable to skip them when listing files.
493-
*/
494-
require_literal_leading_dot: bool
495-
}
496458
497459
/**
498460
* Configuration options to modify the behaviour of `Pattern::matches_with(..)`
499461
*/
500-
#[cfg(not(stage0))]
501462
#[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, IterBytes, Default)]
502463
pub struct MatchOptions {
503464

src/libextra/rl.rs

+1-20
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,6 @@ use std::libc::{c_char, c_int};
1313
use std::{local_data, str, rt};
1414
use std::unstable::finally::Finally;
1515

16-
#[cfg(stage0)]
17-
pub mod rustrt {
18-
use std::libc::{c_char, c_int};
19-
20-
extern {
21-
fn linenoise(prompt: *c_char) -> *c_char;
22-
fn linenoiseHistoryAdd(line: *c_char) -> c_int;
23-
fn linenoiseHistorySetMaxLen(len: c_int) -> c_int;
24-
fn linenoiseHistorySave(file: *c_char) -> c_int;
25-
fn linenoiseHistoryLoad(file: *c_char) -> c_int;
26-
fn linenoiseSetCompletionCallback(callback: *u8);
27-
fn linenoiseAddCompletion(completions: *(), line: *c_char);
28-
29-
fn rust_take_linenoise_lock();
30-
fn rust_drop_linenoise_lock();
31-
}
32-
}
33-
34-
#[cfg(not(stage0))]
3516
pub mod rustrt {
3617
use std::libc::{c_char, c_int};
3718

@@ -109,7 +90,7 @@ pub fn read(prompt: &str) -> Option<~str> {
10990

11091
pub type CompletionCb = @fn(~str, @fn(~str));
11192

112-
static complete_key: local_data::Key<CompletionCb> = &local_data::Key;
93+
local_data_key!(complete_key: CompletionCb)
11394

11495
/// Bind to the main completion callback in the current task.
11596
///

src/librustc/back/link.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ pub mod jit {
190190

191191
// The stage1 compiler won't work, but that doesn't really matter. TLS
192192
// changed only very recently to allow storage of owned values.
193-
static engine_key: local_data::Key<~Engine> = &local_data::Key;
193+
local_data_key!(engine_key: ~Engine)
194194

195195
fn set_engine(engine: ~Engine) {
196196
local_data::set(engine_key, engine)

src/librustc/front/test.rs

-116
Original file line numberDiff line numberDiff line change
@@ -293,50 +293,6 @@ fn mk_std(cx: &TestCtxt) -> ast::view_item {
293293
}
294294
}
295295

296-
#[cfg(stage0)]
297-
fn mk_test_module(cx: &TestCtxt) -> @ast::item {
298-
299-
// Link to extra
300-
let view_items = ~[mk_std(cx)];
301-
302-
// A constant vector of test descriptors.
303-
let tests = mk_tests(cx);
304-
305-
// The synthesized main function which will call the console test runner
306-
// with our list of tests
307-
let ext_cx = cx.ext_cx;
308-
let mainfn = (quote_item!(
309-
pub fn main() {
310-
#[main];
311-
extra::test::test_main_static(::std::os::args(), TESTS);
312-
}
313-
)).unwrap();
314-
315-
let testmod = ast::_mod {
316-
view_items: view_items,
317-
items: ~[mainfn, tests],
318-
};
319-
let item_ = ast::item_mod(testmod);
320-
321-
// This attribute tells resolve to let us call unexported functions
322-
let resolve_unexported_attr =
323-
attr::mk_attr(attr::mk_word_item(@"!resolve_unexported"));
324-
325-
let item = ast::item {
326-
ident: cx.sess.ident_of("__test"),
327-
attrs: ~[resolve_unexported_attr],
328-
id: ast::DUMMY_NODE_ID,
329-
node: item_,
330-
vis: ast::public,
331-
span: dummy_sp(),
332-
};
333-
334-
debug!("Synthetic test module:\n%s\n",
335-
pprust::item_to_str(@item.clone(), cx.sess.intr()));
336-
337-
return @item;
338-
}
339-
#[cfg(not(stage0))]
340296
fn mk_test_module(cx: &TestCtxt) -> @ast::item {
341297

342298
// Link to extra
@@ -407,21 +363,6 @@ fn path_node_global(ids: ~[ast::Ident]) -> ast::Path {
407363
}
408364
}
409365

410-
#[cfg(stage0)]
411-
fn mk_tests(cx: &TestCtxt) -> @ast::item {
412-
413-
let ext_cx = cx.ext_cx;
414-
415-
// The vector of test_descs for this crate
416-
let test_descs = mk_test_descs(cx);
417-
418-
(quote_item!(
419-
pub static TESTS : &'static [self::extra::test::TestDescAndFn] =
420-
$test_descs
421-
;
422-
)).unwrap()
423-
}
424-
#[cfg(not(stage0))]
425366
fn mk_tests(cx: &TestCtxt) -> @ast::item {
426367
// The vector of test_descs for this crate
427368
let test_descs = mk_test_descs(cx);
@@ -461,63 +402,6 @@ fn mk_test_descs(cx: &TestCtxt) -> @ast::Expr {
461402
}
462403
}
463404

464-
#[cfg(stage0)]
465-
fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> @ast::Expr {
466-
let span = test.span;
467-
let path = test.path.clone();
468-
469-
let ext_cx = cx.ext_cx;
470-
471-
debug!("encoding %s", ast_util::path_name_i(path));
472-
473-
let name_lit: ast::lit =
474-
nospan(ast::lit_str(ast_util::path_name_i(path).to_managed()));
475-
476-
let name_expr = @ast::Expr {
477-
id: ast::DUMMY_NODE_ID,
478-
node: ast::ExprLit(@name_lit),
479-
span: span
480-
};
481-
482-
let fn_path = path_node_global(path);
483-
484-
let fn_expr = @ast::Expr {
485-
id: ast::DUMMY_NODE_ID,
486-
node: ast::ExprPath(fn_path),
487-
span: span,
488-
};
489-
490-
let t_expr = if test.bench {
491-
quote_expr!( self::extra::test::StaticBenchFn($fn_expr) )
492-
} else {
493-
quote_expr!( self::extra::test::StaticTestFn($fn_expr) )
494-
};
495-
496-
let ignore_expr = if test.ignore {
497-
quote_expr!( true )
498-
} else {
499-
quote_expr!( false )
500-
};
501-
502-
let fail_expr = if test.should_fail {
503-
quote_expr!( true )
504-
} else {
505-
quote_expr!( false )
506-
};
507-
508-
let e = quote_expr!(
509-
self::extra::test::TestDescAndFn {
510-
desc: self::extra::test::TestDesc {
511-
name: self::extra::test::StaticTestName($name_expr),
512-
ignore: $ignore_expr,
513-
should_fail: $fail_expr
514-
},
515-
testfn: $t_expr,
516-
}
517-
);
518-
e
519-
}
520-
#[cfg(not(stage0))]
521405
fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> @ast::Expr {
522406
let span = test.span;
523407
let path = test.path.clone();

src/librustc/middle/trans/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ use syntax::visit::Visitor;
9292

9393
pub use middle::trans::context::task_llcx;
9494

95-
static task_local_insn_key: local_data::Key<@~[&'static str]> = &local_data::Key;
95+
local_data_key!(task_local_insn_key: @~[&'static str])
9696

9797
pub fn with_insn_ctxt(blk: &fn(&[&'static str])) {
9898
let opt = local_data::get(task_local_insn_key, |k| k.map_move(|k| *k));

src/librustc/middle/trans/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ impl Drop for CrateContext {
287287
}
288288
}
289289

290-
static task_local_llcx_key: local_data::Key<@ContextRef> = &local_data::Key;
290+
local_data_key!(task_local_llcx_key: @ContextRef)
291291

292292
pub fn task_llcx() -> ContextRef {
293293
let opt = local_data::get(task_local_llcx_key, |k| k.map_move(|k| *k));

src/librusti/program.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ struct LocalVariable {
6060
}
6161

6262
type LocalCache = @mut HashMap<~str, @~[u8]>;
63-
static tls_key: local_data::Key<LocalCache> = &local_data::Key;
63+
local_data_key!(tls_key: LocalCache)
6464

6565
impl Program {
6666
pub fn new() -> Program {

src/libstd/c_str.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ pub enum NullByteResolution {
3030

3131
condition! {
3232
// This should be &[u8] but there's a lifetime issue (#5370).
33-
// NOTE: this super::NullByteResolution should be NullByteResolution
34-
// Change this next time the snapshot is updated.
35-
pub null_byte: (~[u8]) -> super::NullByteResolution;
33+
pub null_byte: (~[u8]) -> NullByteResolution;
3634
}
3735

3836
/// The representation of a C String.

src/libstd/logging.rs

-11
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,6 @@ pub fn console_off() {
3737
rt::logging::console_off();
3838
}
3939

40-
#[cfg(not(test), stage0)]
41-
#[lang="log_type"]
42-
#[allow(missing_doc)]
43-
pub fn log_type<T>(_level: u32, object: &T) {
44-
use sys;
45-
46-
// XXX: Bad allocation
47-
let msg = sys::log_str(object);
48-
newsched_log_str(msg);
49-
}
50-
5140
fn newsched_log_str(msg: ~str) {
5241
use rt::task::Task;
5342
use rt::local::Local;

src/libstd/os.rs

-12
Original file line numberDiff line numberDiff line change
@@ -148,18 +148,6 @@ pub mod win32 {
148148
}
149149
}
150150

151-
#[cfg(stage0)]
152-
mod macro_hack {
153-
#[macro_escape];
154-
macro_rules! externfn(
155-
(fn $name:ident ()) => (
156-
extern {
157-
fn $name();
158-
}
159-
)
160-
)
161-
}
162-
163151
/*
164152
Accessing environment variables is not generally threadsafe.
165153
Serialize access through a global lock.

0 commit comments

Comments
 (0)