Skip to content

Register new snapshots #9296

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

Merged
merged 1 commit into from
Sep 18, 2013
Merged
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
39 changes: 0 additions & 39 deletions src/libextra/glob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,6 @@ fn list_dir_sorted(path: &Path) -> ~[Path] {
/**
* A compiled Unix shell style pattern.
*/
#[cfg(stage0)]
#[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, IterBytes)]
pub struct Pattern {
priv tokens: ~[PatternToken]
}

/**
* A compiled Unix shell style pattern.
*/
#[cfg(not(stage0))]
#[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, IterBytes, Default)]
pub struct Pattern {
priv tokens: ~[PatternToken]
Expand Down Expand Up @@ -465,39 +455,10 @@ fn is_sep(c: char) -> bool {
}
}

/**
* Configuration options to modify the behaviour of `Pattern::matches_with(..)`
*/
#[cfg(stage0)]
#[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, IterBytes)]
pub struct MatchOptions {

/**
* Whether or not patterns should be matched in a case-sensitive manner. This
* currently only considers upper/lower case relationships between ASCII characters,
* but in future this might be extended to work with Unicode.
*/
case_sensitive: bool,

/**
* If this is true then path-component separator characters (e.g. `/` on Posix)
* must be matched by a literal `/`, rather than by `*` or `?` or `[...]`
*/
require_literal_separator: bool,

/**
* If this is true then paths that contain components that start with a `.` will
* not match unless the `.` appears literally in the pattern: `*`, `?` or `[...]`
* will not match. This is useful because such files are conventionally considered
* hidden on Unix systems and it might be desirable to skip them when listing files.
*/
require_literal_leading_dot: bool
}

/**
* Configuration options to modify the behaviour of `Pattern::matches_with(..)`
*/
#[cfg(not(stage0))]
#[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, IterBytes, Default)]
pub struct MatchOptions {

Expand Down
21 changes: 1 addition & 20 deletions src/libextra/rl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,6 @@ use std::libc::{c_char, c_int};
use std::{local_data, str, rt};
use std::unstable::finally::Finally;

#[cfg(stage0)]
pub mod rustrt {
use std::libc::{c_char, c_int};

extern {
fn linenoise(prompt: *c_char) -> *c_char;
fn linenoiseHistoryAdd(line: *c_char) -> c_int;
fn linenoiseHistorySetMaxLen(len: c_int) -> c_int;
fn linenoiseHistorySave(file: *c_char) -> c_int;
fn linenoiseHistoryLoad(file: *c_char) -> c_int;
fn linenoiseSetCompletionCallback(callback: *u8);
fn linenoiseAddCompletion(completions: *(), line: *c_char);

fn rust_take_linenoise_lock();
fn rust_drop_linenoise_lock();
}
}

#[cfg(not(stage0))]
pub mod rustrt {
use std::libc::{c_char, c_int};

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

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

static complete_key: local_data::Key<CompletionCb> = &local_data::Key;
local_data_key!(complete_key: CompletionCb)

/// Bind to the main completion callback in the current task.
///
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ pub mod jit {

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

fn set_engine(engine: ~Engine) {
local_data::set(engine_key, engine)
Expand Down
116 changes: 0 additions & 116 deletions src/librustc/front/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,50 +293,6 @@ fn mk_std(cx: &TestCtxt) -> ast::view_item {
}
}

#[cfg(stage0)]
fn mk_test_module(cx: &TestCtxt) -> @ast::item {

// Link to extra
let view_items = ~[mk_std(cx)];

// A constant vector of test descriptors.
let tests = mk_tests(cx);

// The synthesized main function which will call the console test runner
// with our list of tests
let ext_cx = cx.ext_cx;
let mainfn = (quote_item!(
pub fn main() {
#[main];
extra::test::test_main_static(::std::os::args(), TESTS);
}
)).unwrap();

let testmod = ast::_mod {
view_items: view_items,
items: ~[mainfn, tests],
};
let item_ = ast::item_mod(testmod);

// This attribute tells resolve to let us call unexported functions
let resolve_unexported_attr =
attr::mk_attr(attr::mk_word_item(@"!resolve_unexported"));

let item = ast::item {
ident: cx.sess.ident_of("__test"),
attrs: ~[resolve_unexported_attr],
id: ast::DUMMY_NODE_ID,
node: item_,
vis: ast::public,
span: dummy_sp(),
};

debug!("Synthetic test module:\n%s\n",
pprust::item_to_str(@item.clone(), cx.sess.intr()));

return @item;
}
#[cfg(not(stage0))]
fn mk_test_module(cx: &TestCtxt) -> @ast::item {

// Link to extra
Expand Down Expand Up @@ -407,21 +363,6 @@ fn path_node_global(ids: ~[ast::Ident]) -> ast::Path {
}
}

#[cfg(stage0)]
fn mk_tests(cx: &TestCtxt) -> @ast::item {

let ext_cx = cx.ext_cx;

// The vector of test_descs for this crate
let test_descs = mk_test_descs(cx);

(quote_item!(
pub static TESTS : &'static [self::extra::test::TestDescAndFn] =
$test_descs
;
)).unwrap()
}
#[cfg(not(stage0))]
fn mk_tests(cx: &TestCtxt) -> @ast::item {
// The vector of test_descs for this crate
let test_descs = mk_test_descs(cx);
Expand Down Expand Up @@ -461,63 +402,6 @@ fn mk_test_descs(cx: &TestCtxt) -> @ast::Expr {
}
}

#[cfg(stage0)]
fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> @ast::Expr {
let span = test.span;
let path = test.path.clone();

let ext_cx = cx.ext_cx;

debug!("encoding %s", ast_util::path_name_i(path));

let name_lit: ast::lit =
nospan(ast::lit_str(ast_util::path_name_i(path).to_managed()));

let name_expr = @ast::Expr {
id: ast::DUMMY_NODE_ID,
node: ast::ExprLit(@name_lit),
span: span
};

let fn_path = path_node_global(path);

let fn_expr = @ast::Expr {
id: ast::DUMMY_NODE_ID,
node: ast::ExprPath(fn_path),
span: span,
};

let t_expr = if test.bench {
quote_expr!( self::extra::test::StaticBenchFn($fn_expr) )
} else {
quote_expr!( self::extra::test::StaticTestFn($fn_expr) )
};

let ignore_expr = if test.ignore {
quote_expr!( true )
} else {
quote_expr!( false )
};

let fail_expr = if test.should_fail {
quote_expr!( true )
} else {
quote_expr!( false )
};

let e = quote_expr!(
self::extra::test::TestDescAndFn {
desc: self::extra::test::TestDesc {
name: self::extra::test::StaticTestName($name_expr),
ignore: $ignore_expr,
should_fail: $fail_expr
},
testfn: $t_expr,
}
);
e
}
#[cfg(not(stage0))]
fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> @ast::Expr {
let span = test.span;
let path = test.path.clone();
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/trans/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ use syntax::visit::Visitor;

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

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

pub fn with_insn_ctxt(blk: &fn(&[&'static str])) {
let opt = local_data::get(task_local_insn_key, |k| k.map_move(|k| *k));
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/trans/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ impl Drop for CrateContext {
}
}

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

pub fn task_llcx() -> ContextRef {
let opt = local_data::get(task_local_llcx_key, |k| k.map_move(|k| *k));
Expand Down
2 changes: 1 addition & 1 deletion src/librusti/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct LocalVariable {
}

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

impl Program {
pub fn new() -> Program {
Expand Down
4 changes: 1 addition & 3 deletions src/libstd/c_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ pub enum NullByteResolution {

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

/// The representation of a C String.
Expand Down
11 changes: 0 additions & 11 deletions src/libstd/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,6 @@ pub fn console_off() {
rt::logging::console_off();
}

#[cfg(not(test), stage0)]
#[lang="log_type"]
#[allow(missing_doc)]
pub fn log_type<T>(_level: u32, object: &T) {
use sys;

// XXX: Bad allocation
let msg = sys::log_str(object);
newsched_log_str(msg);
}

fn newsched_log_str(msg: ~str) {
use rt::task::Task;
use rt::local::Local;
Expand Down
12 changes: 0 additions & 12 deletions src/libstd/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,18 +148,6 @@ pub mod win32 {
}
}

#[cfg(stage0)]
mod macro_hack {
#[macro_escape];
macro_rules! externfn(
(fn $name:ident ()) => (
extern {
fn $name();
}
)
)
}

/*
Accessing environment variables is not generally threadsafe.
Serialize access through a global lock.
Expand Down
Loading