Skip to content

Commit 9f6b448

Browse files
author
James Miller
committed
---
yaml --- r: 73450 b: refs/heads/dist-snap c: 2c2346e h: refs/heads/master v: v3
1 parent bf430e6 commit 9f6b448

File tree

3 files changed

+15
-27
lines changed

3 files changed

+15
-27
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: b50030718cf28f2a5a81857a26b57442734fe854
10-
refs/heads/dist-snap: 510d0f221c5a9ca7671149fe7e7bb802592edc06
10+
refs/heads/dist-snap: 2c2346e3d4f999b95a56444d978c3ea792828263
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1694,7 +1694,20 @@ pub fn create_llargs_for_fn_args(cx: fn_ctxt,
16941694
vec::from_fn(args.len(), |i| {
16951695
unsafe {
16961696
let arg_n = first_real_arg + i;
1697-
llvm::LLVMGetParam(cx.llfn, arg_n as c_uint)
1697+
let arg = &args[i];
1698+
let llarg = llvm::LLVMGetParam(cx.llfn, arg_n as c_uint);
1699+
1700+
// Mark `&mut T` as no-alias, as the borrowck pass ensures it's true
1701+
match arg.ty.node {
1702+
ast::ty_rptr(_, mt) => {
1703+
if mt.mutbl == ast::m_mutbl {
1704+
llvm::LLVMAddAttribute(llarg, lib::llvm::NoAliasAttribute as c_uint);
1705+
}
1706+
}
1707+
_ => {}
1708+
}
1709+
1710+
llarg
16981711
}
16991712
})
17001713
}

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

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -675,11 +675,6 @@ 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() && !p.is_absolute() {
679-
// Not sure what the right behavior is here, but this
680-
// prevents a bounds check failure later
681-
return ~[];
682-
}
683678
unsafe {
684679
#[cfg(target_os = "linux")]
685680
#[cfg(target_os = "android")]
@@ -1601,26 +1596,6 @@ mod tests {
16011596
}
16021597
}
16031598
1604-
#[test]
1605-
fn list_dir_empty_path() {
1606-
let dirs = os::list_dir(&Path(""));
1607-
assert!(dirs.is_empty());
1608-
}
1609-
1610-
#[test]
1611-
#[cfg(not(windows))]
1612-
fn list_dir_root() {
1613-
let dirs = os::list_dir(&Path("/"));
1614-
assert!(dirs.len() > 1);
1615-
}
1616-
#[test]
1617-
#[cfg(windows)]
1618-
fn list_dir_root() {
1619-
let dirs = os::list_dir(&Path("C:\\"));
1620-
assert!(dirs.len() > 1);
1621-
}
1622-
1623-
16241599
#[test]
16251600
fn path_is_dir() {
16261601
assert!((os::path_is_dir(&Path("."))));

0 commit comments

Comments
 (0)