Skip to content

Commit 9f09020

Browse files
committed
---
yaml --- r: 62711 b: refs/heads/snap-stage3 c: 196851c h: refs/heads/master i: 62709: 87ea0e7 62707: 8e8c4cb 62703: b8e99ad v: v3
1 parent bae2d20 commit 9f09020

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: cf34f9f9a9503ac8852f6ac7426388734eb867b5
4+
refs/heads/snap-stage3: 196851c4c92cf850d28bed749ab8c3034c04b9e3
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/trans/base.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2329,7 +2329,9 @@ pub fn create_entry_wrapper(ccx: @CrateContext,
23292329
llvm::LLVMPositionBuilderAtEnd(bld, llbb);
23302330
23312331
let start_def_id = ccx.tcx.lang_items.start_fn();
2332-
if start_def_id.crate != ast::local_crate {
2332+
if start_def_id.crate == ast::local_crate {
2333+
ccx.sess.bug("start lang item is never in the local crate")
2334+
} else {
23332335
let start_fn_type = csearch::get_type(ccx.tcx,
23342336
start_def_id).ty;
23352337
trans_external_path(ccx, start_def_id, start_fn_type);
@@ -2346,7 +2348,8 @@ pub fn create_entry_wrapper(ccx: @CrateContext,
23462348
let (start_fn, args) = if use_start_lang_item {
23472349
let start_def_id = ccx.tcx.lang_items.start_fn();
23482350
let start_fn = if start_def_id.crate == ast::local_crate {
2349-
get_item_val(ccx, start_def_id.node)
2351+
ccx.sess.bug("start lang item is never in the local \
2352+
crate")
23502353
} else {
23512354
let start_fn_type = csearch::get_type(ccx.tcx,
23522355
start_def_id).ty;

branches/snap-stage3/src/libstd/os.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,11 @@ pub fn mkdir_recursive(p: &Path, mode: c_int) -> bool {
675675
/// Lists the contents of a directory
676676
#[allow(non_implicitly_copyable_typarams)]
677677
pub fn list_dir(p: &Path) -> ~[~str] {
678+
if p.components.is_empty() {
679+
// Not sure what the right behavior is here, but this
680+
// prevents a bounds check failure later
681+
return ~[];
682+
}
678683
unsafe {
679684
#[cfg(target_os = "linux")]
680685
#[cfg(target_os = "android")]
@@ -1596,6 +1601,12 @@ mod tests {
15961601
}
15971602
}
15981603
1604+
#[test]
1605+
fn list_dir_empty_path() {
1606+
let dirs = os::list_dir(&Path(""));
1607+
assert!(dirs.is_empty());
1608+
}
1609+
15991610
#[test]
16001611
fn path_is_dir() {
16011612
assert!((os::path_is_dir(&Path("."))));

0 commit comments

Comments
 (0)