Skip to content

Commit 192e3c0

Browse files
committed
---
yaml --- r: 47087 b: refs/heads/try c: ec161ed h: refs/heads/master i: 47085: e2386f7 47083: acad414 47079: c6422cf 47071: 97ea808 v: v3
1 parent 216d193 commit 192e3c0

File tree

10 files changed

+193
-212
lines changed

10 files changed

+193
-212
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3bbcac322669cff3abde5be937cc4ec3860f3985
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
5-
refs/heads/try: c8d8f6cfec50cad6b35e3b5fc604abc01a26143e
5+
refs/heads/try: ec161edc16b0b3b3bdbd425e0bb085fc7fae15d4
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libcore/os.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,13 +565,17 @@ pub fn path_exists(p: &Path) -> bool {
565565
*
566566
* If the given path is relative, return it prepended with the current working
567567
* directory. If the given path is already an absolute path, return it
568-
* as is. This is a shortcut for calling os::getcwd().unsafe_join(p)
568+
* as is.
569569
*/
570570
// NB: this is here rather than in path because it is a form of environment
571571
// querying; what it does depends on the process working directory, not just
572572
// the input paths.
573573
pub fn make_absolute(p: &Path) -> Path {
574-
getcwd().unsafe_join(p)
574+
if p.is_absolute {
575+
copy *p
576+
} else {
577+
getcwd().push_many(p.components)
578+
}
575579
}
576580

577581

branches/try/src/libcore/path.rs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ pub trait GenericPath {
6464
pure fn push_many((&[~str])) -> Self;
6565
pure fn pop() -> Self;
6666

67-
pure fn unsafe_join((&Self)) -> Self;
68-
6967
pure fn normalize() -> Self;
7068
}
7169

@@ -487,15 +485,6 @@ impl GenericPath for PosixPath {
487485
self.push_many(other.components)
488486
}
489487

490-
pure fn unsafe_join(other: &PosixPath) -> PosixPath {
491-
if other.is_absolute {
492-
PosixPath { is_absolute: true,
493-
components: copy other.components }
494-
} else {
495-
self.push_rel(other)
496-
}
497-
}
498-
499488
pure fn push_many(cs: &[~str]) -> PosixPath {
500489
let mut v = copy self.components;
501490
for cs.each |e| {
@@ -696,25 +685,6 @@ impl GenericPath for WindowsPath {
696685
self.push_many(other.components)
697686
}
698687

699-
pure fn unsafe_join(other: &WindowsPath) -> WindowsPath {
700-
if !other.is_absolute {
701-
self.push_rel(other)
702-
} else {
703-
WindowsPath {
704-
host: match other.host {
705-
None => copy self.host,
706-
Some(copy x) => Some(x)
707-
},
708-
device: match other.device {
709-
None => copy self.device,
710-
Some(copy x) => Some(x)
711-
},
712-
is_absolute: true,
713-
components: copy other.components
714-
}
715-
}
716-
}
717-
718688
pure fn push_many(cs: &[~str]) -> WindowsPath {
719689
let mut v = copy self.components;
720690
for cs.each |e| {

branches/try/src/libcore/vec.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,6 +1865,7 @@ pub trait OwnedVector<T> {
18651865
fn consume(self, f: fn(uint, v: T));
18661866
fn filter(self, f: fn(t: &T) -> bool) -> ~[T];
18671867
fn partition(self, f: pure fn(&T) -> bool) -> (~[T], ~[T]);
1868+
fn grow_fn(&mut self, n: uint, op: iter::InitOp<T>);
18681869
}
18691870

18701871
impl<T> OwnedVector<T> for ~[T] {
@@ -1936,6 +1937,11 @@ impl<T> OwnedVector<T> for ~[T] {
19361937
fn partition(self, f: fn(&T) -> bool) -> (~[T], ~[T]) {
19371938
partition(self, f)
19381939
}
1940+
1941+
#[inline]
1942+
fn grow_fn(&mut self, n: uint, op: iter::InitOp<T>) {
1943+
grow_fn(self, n, op);
1944+
}
19391945
}
19401946

19411947
impl<T> Mutable for ~[T] {
@@ -1946,7 +1952,6 @@ impl<T> Mutable for ~[T] {
19461952
pub trait OwnedCopyableVector<T: Copy> {
19471953
fn push_all(&mut self, rhs: &[const T]);
19481954
fn grow(&mut self, n: uint, initval: &T);
1949-
fn grow_fn(&mut self, n: uint, op: iter::InitOp<T>);
19501955
fn grow_set(&mut self, index: uint, initval: &T, val: T);
19511956
}
19521957

@@ -1961,11 +1966,6 @@ impl<T: Copy> OwnedCopyableVector<T> for ~[T] {
19611966
grow(self, n, initval);
19621967
}
19631968

1964-
#[inline]
1965-
fn grow_fn(&mut self, n: uint, op: iter::InitOp<T>) {
1966-
grow_fn(self, n, op);
1967-
}
1968-
19691969
#[inline]
19701970
fn grow_set(&mut self, index: uint, initval: &T, val: T) {
19711971
grow_set(self, index, initval, val);

branches/try/src/libstd/deque.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ fn grow<T>(nelts: uint, lo: uint, elts: &mut [Option<T>]) -> ~[Option<T>] {
100100
assert nelts == elts.len();
101101
let mut rv = ~[];
102102

103-
do vec::grow_fn(&mut rv, nelts + 1) |i| {
103+
do rv.grow_fn(nelts + 1) |i| {
104104
let mut element = None;
105105
element <-> elts[(lo + i) % nelts];
106106
element

0 commit comments

Comments
 (0)