Skip to content

Commit 7c16143

Browse files
committed
---
yaml --- r: 60706 b: refs/heads/auto c: 196851c h: refs/heads/master v: v3
1 parent b2bdeef commit 7c16143

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
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: cf34f9f9a9503ac8852f6ac7426388734eb867b5
17+
refs/heads/auto: 196851c4c92cf850d28bed749ab8c3034c04b9e3
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/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/auto/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)