Skip to content

Commit 83b1ea1

Browse files
committed
---
yaml --- r: 81854 b: refs/heads/master c: f6c9ff3 h: refs/heads/master v: v3
1 parent dc8ab56 commit 83b1ea1

File tree

184 files changed

+1006
-618
lines changed

Some content is hidden

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

184 files changed

+1006
-618
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 37481641b1101108eb394789dd2adf9e095e39d9
2+
refs/heads/master: f6c9ff392becd86ee22ad96cd66e137b65195f97
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6c08cc2db4f98e9f07ae7d50338396c4123c2f0a
55
refs/heads/try: 70152ff55722878cde684ee6462c14c65f2c4729

trunk/src/etc/combine-tests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ def scrub(b):
2929
if not ("xfail-test" in s or
3030
"xfail-fast" in s or
3131
"xfail-win32" in s):
32+
if not "pub fn main" in s and "fn main" in s:
33+
print("Warning: no public entry point in " + t)
3234
stage2_tests.append(t)
3335
f.close()
3436

trunk/src/libextra/arc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ struct MutexArcInner<T> { priv lock: Mutex, priv failed: bool, priv data: T }
162162

163163
/// An Arc with mutable data protected by a blocking mutex.
164164
#[no_freeze]
165-
struct MutexArc<T> { priv x: UnsafeArc<MutexArcInner<T>> }
165+
pub struct MutexArc<T> { priv x: UnsafeArc<MutexArcInner<T>> }
166166

167167

168168
impl<T:Send> Clone for MutexArc<T> {
@@ -343,7 +343,7 @@ struct RWArcInner<T> { priv lock: RWLock, priv failed: bool, priv data: T }
343343
* Unlike mutex_arcs, rw_arcs are safe, because they cannot be nested.
344344
*/
345345
#[no_freeze]
346-
struct RWArc<T> {
346+
pub struct RWArc<T> {
347347
priv x: UnsafeArc<RWArcInner<T>>,
348348
}
349349

trunk/src/libextra/test.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ use treemap::TreeMap;
3030

3131
use std::clone::Clone;
3232
use std::comm::{stream, SharedChan, GenericPort, GenericChan};
33-
use std::libc;
3433
use std::io;
3534
use std::result;
3635
use std::task;
@@ -125,8 +124,9 @@ pub type MetricDiff = TreeMap<~str,MetricChange>;
125124
pub fn test_main(args: &[~str], tests: ~[TestDescAndFn]) {
126125
let opts =
127126
match parse_opts(args) {
128-
Ok(o) => o,
129-
Err(msg) => fail!(msg)
127+
Some(Ok(o)) => o,
128+
Some(Err(msg)) => fail!(msg),
129+
None => return
130130
};
131131
if !run_tests_console(&opts, tests) { fail!("Some tests failed"); }
132132
}
@@ -189,7 +189,7 @@ fn optgroups() -> ~[getopts::groups::OptGroup] {
189189
"A.B")]
190190
}
191191

192-
fn usage(binary: &str, helpstr: &str) -> ! {
192+
fn usage(binary: &str, helpstr: &str) {
193193
#[fixed_stack_segment]; #[inline(never)];
194194

195195
let message = fmt!("Usage: %s [OPTIONS] [FILTER]", binary);
@@ -217,20 +217,19 @@ Test Attributes:
217217
tests. This may also be written as #[ignore(cfg(...))] to
218218
ignore the test on certain configurations.");
219219
}
220-
unsafe { libc::exit(0) }
221220
}
222221

223222
// Parses command line arguments into test options
224-
pub fn parse_opts(args: &[~str]) -> OptRes {
223+
pub fn parse_opts(args: &[~str]) -> Option<OptRes> {
225224
let args_ = args.tail();
226225
let matches =
227226
match groups::getopts(args_, optgroups()) {
228227
Ok(m) => m,
229-
Err(f) => return Err(f.to_err_msg())
228+
Err(f) => return Some(Err(f.to_err_msg()))
230229
};
231230

232-
if matches.opt_present("h") { usage(args[0], "h"); }
233-
if matches.opt_present("help") { usage(args[0], "help"); }
231+
if matches.opt_present("h") { usage(args[0], "h"); return None; }
232+
if matches.opt_present("help") { usage(args[0], "help"); return None; }
234233

235234
let filter =
236235
if matches.free.len() > 0 {
@@ -272,7 +271,7 @@ pub fn parse_opts(args: &[~str]) -> OptRes {
272271
logfile: logfile
273272
};
274273

275-
Ok(test_opts)
274+
Some(Ok(test_opts))
276275
}
277276

278277
pub fn opt_shard(maybestr: Option<~str>) -> Option<(uint,uint)> {
@@ -1228,7 +1227,7 @@ mod tests {
12281227
fn first_free_arg_should_be_a_filter() {
12291228
let args = ~[~"progname", ~"filter"];
12301229
let opts = match parse_opts(args) {
1231-
Ok(o) => o,
1230+
Some(Ok(o)) => o,
12321231
_ => fail!("Malformed arg in first_free_arg_should_be_a_filter")
12331232
};
12341233
assert!("filter" == opts.filter.clone().unwrap());
@@ -1238,7 +1237,7 @@ mod tests {
12381237
fn parse_ignored_flag() {
12391238
let args = ~[~"progname", ~"filter", ~"--ignored"];
12401239
let opts = match parse_opts(args) {
1241-
Ok(o) => o,
1240+
Some(Ok(o)) => o,
12421241
_ => fail!("Malformed arg in parse_ignored_flag")
12431242
};
12441243
assert!((opts.run_ignored));

trunk/src/libextra/workcache.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ impl WorkMap {
127127
}
128128
}
129129

130-
struct Database {
130+
pub struct Database {
131131
db_filename: Path,
132132
db_cache: TreeMap<~str, ~str>,
133133
db_dirty: bool
@@ -207,7 +207,7 @@ impl Drop for Database {
207207
}
208208
}
209209

210-
struct Logger {
210+
pub struct Logger {
211211
// FIXME #4432: Fill in
212212
a: ()
213213
}
@@ -223,10 +223,10 @@ impl Logger {
223223
}
224224
}
225225
226-
type FreshnessMap = TreeMap<~str,extern fn(&str,&str)->bool>;
226+
pub type FreshnessMap = TreeMap<~str,extern fn(&str,&str)->bool>;
227227
228228
#[deriving(Clone)]
229-
struct Context {
229+
pub struct Context {
230230
db: RWArc<Database>,
231231
logger: RWArc<Logger>,
232232
cfg: Arc<json::Object>,
@@ -239,13 +239,13 @@ struct Context {
239239
freshness: Arc<FreshnessMap>
240240
}
241241
242-
struct Prep<'self> {
242+
pub struct Prep<'self> {
243243
ctxt: &'self Context,
244244
fn_name: &'self str,
245245
declared_inputs: WorkMap,
246246
}
247247
248-
struct Exec {
248+
pub struct Exec {
249249
discovered_inputs: WorkMap,
250250
discovered_outputs: WorkMap
251251
}

trunk/src/librust/rust.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl ValidUsage {
4444

4545
enum Action {
4646
Call(extern "Rust" fn(args: &[~str]) -> ValidUsage),
47-
CallMain(&'static str, extern "Rust" fn(&[~str])),
47+
CallMain(&'static str, extern "Rust" fn(&[~str]) -> int),
4848
}
4949

5050
enum UsageSource<'self> {
@@ -185,18 +185,17 @@ fn cmd_run(args: &[~str]) -> ValidUsage {
185185
}
186186
}
187187

188-
fn invoke(prog: &str, args: &[~str], f: &fn(&[~str])) {
188+
fn invoke(prog: &str, args: &[~str], f: &fn(&[~str]) -> int) -> int {
189189
let mut osargs = ~[prog.to_owned()];
190190
osargs.push_all_move(args.to_owned());
191-
f(osargs);
191+
f(osargs)
192192
}
193193

194194
fn do_command(command: &Command, args: &[~str]) -> ValidUsage {
195195
match command.action {
196196
Call(f) => f(args),
197197
CallMain(prog, f) => {
198-
invoke(prog, args, f);
199-
Valid(0)
198+
Valid(invoke(prog, args, f))
200199
}
201200
}
202201
}

trunk/src/librustc/driver/driver.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ pub fn phase_2_configure_and_expand(sess: Session,
197197

198198
pub struct CrateAnalysis {
199199
exp_map2: middle::resolve::ExportMap2,
200+
exported_items: @middle::privacy::ExportedItems,
200201
ty_cx: ty::ctxt,
201202
maps: astencode::Maps,
202203
reachable: @mut HashSet<ast::NodeId>
@@ -258,8 +259,9 @@ pub fn phase_3_run_analysis_passes(sess: Session,
258259
middle::check_const::check_crate(sess, crate, ast_map, def_map,
259260
method_map, ty_cx));
260261

261-
time(time_passes, ~"privacy checking", ||
262-
middle::privacy::check_crate(ty_cx, &method_map, crate));
262+
let exported_items =
263+
time(time_passes, ~"privacy checking", ||
264+
middle::privacy::check_crate(ty_cx, &method_map, &exp_map2, crate));
263265

264266
time(time_passes, ~"effect checking", ||
265267
middle::effect::check_crate(ty_cx, method_map, crate));
@@ -301,6 +303,7 @@ pub fn phase_3_run_analysis_passes(sess: Session,
301303

302304
CrateAnalysis {
303305
exp_map2: exp_map2,
306+
exported_items: @exported_items,
304307
ty_cx: ty_cx,
305308
maps: astencode::Maps {
306309
root_map: root_map,

trunk/src/librustc/metadata/csearch.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ use syntax::diagnostic::expect;
2727
pub struct StaticMethodInfo {
2828
ident: ast::Ident,
2929
def_id: ast::DefId,
30-
purity: ast::purity
30+
purity: ast::purity,
31+
vis: ast::visibility,
3132
}
3233

3334
pub fn get_symbol(cstore: @mut cstore::CStore, def: ast::DefId) -> ~str {
@@ -52,7 +53,8 @@ pub fn each_lang_item(cstore: @mut cstore::CStore,
5253
/// Iterates over each child of the given item.
5354
pub fn each_child_of_item(cstore: @mut cstore::CStore,
5455
def_id: ast::DefId,
55-
callback: &fn(decoder::DefLike, ast::Ident)) {
56+
callback: &fn(decoder::DefLike, ast::Ident,
57+
ast::visibility)) {
5658
let crate_data = cstore::get_crate_data(cstore, def_id.crate);
5759
let get_crate_data: decoder::GetCrateDataCb = |cnum| {
5860
cstore::get_crate_data(cstore, cnum)
@@ -68,7 +70,8 @@ pub fn each_child_of_item(cstore: @mut cstore::CStore,
6870
pub fn each_top_level_item_of_crate(cstore: @mut cstore::CStore,
6971
cnum: ast::CrateNum,
7072
callback: &fn(decoder::DefLike,
71-
ast::Ident)) {
73+
ast::Ident,
74+
ast::visibility)) {
7275
let crate_data = cstore::get_crate_data(cstore, cnum);
7376
let get_crate_data: decoder::GetCrateDataCb = |cnum| {
7477
cstore::get_crate_data(cstore, cnum)

0 commit comments

Comments
 (0)