Skip to content

Commit 775cbe8

Browse files
committed
---
yaml --- r: 51711 b: refs/heads/incoming c: b07b36b h: refs/heads/master i: 51709: 149beb0 51707: 23a8784 51703: 6e58e68 51695: f5032d2 51679: 93ea810 51647: 6b707ad 51583: 3f51dd2 51455: 39612ca 51199: 3ac8141 v: v3
1 parent 6093ccd commit 775cbe8

File tree

206 files changed

+1314
-1264
lines changed

Some content is hidden

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

206 files changed

+1314
-1264
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 8eb2bab100b42f0ba751552d8eff00eb2134c55a
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: 8fe7fd6dd6abe0ab7949ba11c05baaf30f79bdc4
9+
refs/heads/incoming: b07b36bbf30c9b7c9120e34b518d47244e981019
1010
refs/heads/dist-snap: 8b98e5a296d95c5e832db0756828e5bec31c6f50
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ fi
575575
CFG_PREFIX=${CFG_PREFIX%/}
576576
CFG_HOST_TRIPLES="$(echo $CFG_HOST_TRIPLES | tr ',' ' ')"
577577
CFG_TARGET_TRIPLES="$(echo $CFG_TARGET_TRIPLES | tr ',' ' ')"
578-
CFG_SUPPORTED_TARGET_TRIPLES="$(grep ^CC_*=* $CFG_SRC_DIR/mk/platform.mk | sed -e 's/^CC_//' -e 's/\([^=]*\).*/\1/' | xargs)"
578+
CFG_SUPPORTED_TARGET_TRIPLES="$(grep ^CC_*=* $CFG_SRC_DIR/mk/platform.mk | sed 's,^[^_]*_,,' | sed 's/\([^=]*\).*/\1/' | xargs)"
579579

580580
# copy host-triples to target-triples so that hosts are a subset of targets
581581
V_TEMP=""

branches/incoming/doc/rust.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -830,12 +830,12 @@ An example of re-exporting:
830830
~~~~
831831
# fn main() { }
832832
mod quux {
833+
pub use quux::foo::*;
834+
833835
pub mod foo {
834836
pub fn bar() { }
835837
pub fn baz() { }
836838
}
837-
838-
pub use quux::foo::*;
839839
}
840840
~~~~
841841

@@ -1116,7 +1116,7 @@ static bit2: uint = 1 << 1;
11161116
static bits: [uint, ..2] = [bit1, bit2];
11171117
static string: &'static str = "bitstring";
11181118
1119-
struct BitsNStrings {
1119+
struct BitsNStrings<'self> {
11201120
mybits: [uint, ..2],
11211121
mystring: &'self str
11221122
}
@@ -2008,8 +2008,8 @@ then the expression completes.
20082008
Some examples of call expressions:
20092009

20102010
~~~~
2011-
# fn add(x: int, y: int) -> int { 0 }
20122011
# use core::from_str::FromStr::from_str;
2012+
# fn add(x: int, y: int) -> int { 0 }
20132013
20142014
let x: int = add(1, 2);
20152015
let pi = from_str::<f32>("3.14");

branches/incoming/doc/tutorial-borrowed-ptr.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ For example, we could write a subroutine like this:
485485

486486
~~~
487487
struct Point {x: float, y: float}
488-
fn get_x(p: &'r Point) -> &'r float { &p.x }
488+
fn get_x<'r>(p: &'r Point) -> &'r float { &p.x }
489489
~~~
490490

491491
Here, the function `get_x()` returns a pointer into the structure it
@@ -571,8 +571,8 @@ function:
571571
# Rectangle(Point, Size) // upper-left, dimensions
572572
# }
573573
# fn compute_area(shape: &Shape) -> float { 0f }
574-
fn select<T>(shape: &'r Shape, threshold: float,
575-
a: &'r T, b: &'r T) -> &'r T {
574+
fn select<'r, T>(shape: &'r Shape, threshold: float,
575+
a: &'r T, b: &'r T) -> &'r T {
576576
if compute_area(shape) > threshold {a} else {b}
577577
}
578578
~~~
@@ -591,12 +591,12 @@ example:
591591
# Rectangle(Point, Size) // upper-left, dimensions
592592
# }
593593
# fn compute_area(shape: &Shape) -> float { 0f }
594-
# fn select<T>(shape: &Shape, threshold: float,
595-
# a: &'r T, b: &'r T) -> &'r T {
594+
# fn select<'r, T>(shape: &Shape, threshold: float,
595+
# a: &'r T, b: &'r T) -> &'r T {
596596
# if compute_area(shape) > threshold {a} else {b}
597597
# }
598598
// -+ r
599-
fn select_based_on_unit_circle<T>( // |-+ B
599+
fn select_based_on_unit_circle<'r, T>( // |-+ B
600600
threshold: float, a: &'r T, b: &'r T) -> &'r T { // | |
601601
// | |
602602
let shape = Circle(Point {x: 0., y: 0.}, 1.); // | |
@@ -628,8 +628,8 @@ returned. Here is how the new `select()` might look:
628628
# Rectangle(Point, Size) // upper-left, dimensions
629629
# }
630630
# fn compute_area(shape: &Shape) -> float { 0f }
631-
fn select<T>(shape: &'tmp Shape, threshold: float,
632-
a: &'r T, b: &'r T) -> &'r T {
631+
fn select<'r, 'tmp, T>(shape: &'tmp Shape, threshold: float,
632+
a: &'r T, b: &'r T) -> &'r T {
633633
if compute_area(shape) > threshold {a} else {b}
634634
}
635635
~~~
@@ -647,8 +647,8 @@ concise to just omit the named lifetime for `shape` altogether:
647647
# Rectangle(Point, Size) // upper-left, dimensions
648648
# }
649649
# fn compute_area(shape: &Shape) -> float { 0f }
650-
fn select<T>(shape: &Shape, threshold: float,
651-
a: &'r T, b: &'r T) -> &'r T {
650+
fn select<'r, T>(shape: &Shape, threshold: float,
651+
a: &'r T, b: &'r T) -> &'r T {
652652
if compute_area(shape) > threshold {a} else {b}
653653
}
654654
~~~

branches/incoming/doc/tutorial.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2054,9 +2054,9 @@ name and a double colon. The compiler uses type inference to decide which
20542054
implementation to use.
20552055

20562056
~~~~
2057-
trait Shape { fn new(area: float) -> Self; }
20582057
# use core::float::consts::pi;
20592058
# use core::float::sqrt;
2059+
trait Shape { fn new(area: float) -> Self; }
20602060
struct Circle { radius: float }
20612061
struct Square { length: float }
20622062
@@ -2211,11 +2211,11 @@ trait Circle : Shape { fn radius(&self) -> float; }
22112211
Now, we can implement `Circle` on a type only if we also implement `Shape`.
22122212

22132213
~~~~
2214+
# use core::float::consts::pi;
2215+
# use core::float::sqrt;
22142216
# trait Shape { fn area(&self) -> float; }
22152217
# trait Circle : Shape { fn radius(&self) -> float; }
22162218
# struct Point { x: float, y: float }
2217-
# use core::float::consts::pi;
2218-
# use core::float::sqrt;
22192219
# fn square(x: float) -> float { x * x }
22202220
struct CircleStruct { center: Point, radius: float }
22212221
impl Circle for CircleStruct {
@@ -2247,10 +2247,10 @@ fn radius_times_area<T: Circle>(c: T) -> float {
22472247
Likewise, supertrait methods may also be called on trait objects.
22482248

22492249
~~~ {.xfail-test}
2250-
# trait Shape { fn area(&self) -> float; }
2251-
# trait Circle : Shape { fn radius(&self) -> float; }
22522250
# use core::float::consts::pi;
22532251
# use core::float::sqrt;
2252+
# trait Shape { fn area(&self) -> float; }
2253+
# trait Circle : Shape { fn radius(&self) -> float; }
22542254
# struct Point { x: float, y: float }
22552255
# struct CircleStruct { center: Point, radius: float }
22562256
# impl Circle for CircleStruct { fn radius(&self) -> float { sqrt(self.area() / pi) } }

branches/incoming/src/compiletest/compiletest.rc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ extern mod std(vers = "0.6");
2222

2323
use core::*;
2424

25-
pub mod procsrv;
26-
pub mod util;
27-
pub mod header;
28-
pub mod runtest;
29-
pub mod common;
30-
pub mod errors;
3125

3226
use std::getopts;
3327
use std::test;
@@ -43,6 +37,13 @@ use common::mode_debug_info;
4337
use common::mode;
4438
use util::logv;
4539

40+
pub mod procsrv;
41+
pub mod util;
42+
pub mod header;
43+
pub mod runtest;
44+
pub mod common;
45+
pub mod errors;
46+
4647
pub fn main() {
4748
let args = os::args();
4849
let config = parse_config(args);

branches/incoming/src/libcore/at_vec.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub mod rustrt {
3838

3939
/// Returns the number of elements the vector can hold without reallocating
4040
#[inline(always)]
41-
pub fn capacity<T>(v: @[const T]) -> uint {
41+
pub fn capacity<T>(v: @[T]) -> uint {
4242
unsafe {
4343
let repr: **raw::VecRepr =
4444
::cast::reinterpret_cast(&addr_of(&v));
@@ -60,7 +60,7 @@ pub fn capacity<T>(v: @[const T]) -> uint {
6060
*/
6161
#[inline(always)]
6262
pub fn build_sized<A>(size: uint, builder: &fn(push: &fn(v: A))) -> @[A] {
63-
let mut vec: @[const A] = @[];
63+
let mut vec: @[A] = @[];
6464
unsafe { raw::reserve(&mut vec, size); }
6565
builder(|+x| unsafe { raw::push(&mut vec, x) });
6666
return unsafe { transmute(vec) };
@@ -102,7 +102,7 @@ pub fn build_sized_opt<A>(size: Option<uint>,
102102

103103
// Appending
104104
#[inline(always)]
105-
pub fn append<T:Copy>(lhs: @[T], rhs: &[const T]) -> @[T] {
105+
pub fn append<T:Copy>(lhs: @[T], rhs: &const [T]) -> @[T] {
106106
do build_sized(lhs.len() + rhs.len()) |push| {
107107
for vec::each(lhs) |x| { push(*x); }
108108
for uint::range(0, rhs.len()) |i| { push(rhs[i]); }
@@ -174,9 +174,9 @@ pub mod traits {
174174
use kinds::Copy;
175175
use ops::Add;
176176

177-
impl<T:Copy> Add<&'self [const T],@[T]> for @[T] {
177+
impl<'self,T:Copy> Add<&'self const [T],@[T]> for @[T] {
178178
#[inline(always)]
179-
fn add(&self, rhs: & &'self [const T]) -> @[T] {
179+
fn add(&self, rhs: & &'self const [T]) -> @[T] {
180180
append(*self, (*rhs))
181181
}
182182
}
@@ -207,13 +207,13 @@ pub mod raw {
207207
* the vector is actually the specified size.
208208
*/
209209
#[inline(always)]
210-
pub unsafe fn set_len<T>(v: @[const T], new_len: uint) {
210+
pub unsafe fn set_len<T>(v: @[T], new_len: uint) {
211211
let repr: **VecRepr = ::cast::reinterpret_cast(&addr_of(&v));
212212
(**repr).unboxed.fill = new_len * sys::size_of::<T>();
213213
}
214214

215215
#[inline(always)]
216-
pub unsafe fn push<T>(v: &mut @[const T], initval: T) {
216+
pub unsafe fn push<T>(v: &mut @[T], initval: T) {
217217
let repr: **VecRepr = ::cast::reinterpret_cast(&v);
218218
let fill = (**repr).unboxed.fill;
219219
if (**repr).unboxed.alloc > fill {
@@ -225,7 +225,7 @@ pub mod raw {
225225
}
226226

227227
#[inline(always)] // really pretty please
228-
pub unsafe fn push_fast<T>(v: &mut @[const T], initval: T) {
228+
pub unsafe fn push_fast<T>(v: &mut @[T], initval: T) {
229229
let repr: **VecRepr = ::cast::reinterpret_cast(&v);
230230
let fill = (**repr).unboxed.fill;
231231
(**repr).unboxed.fill += sys::size_of::<T>();
@@ -234,7 +234,7 @@ pub mod raw {
234234
move_val_init(&mut(*p), initval);
235235
}
236236

237-
pub unsafe fn push_slow<T>(v: &mut @[const T], initval: T) {
237+
pub unsafe fn push_slow<T>(v: &mut @[T], initval: T) {
238238
reserve_at_least(&mut *v, v.len() + 1u);
239239
push_fast(v, initval);
240240
}
@@ -250,7 +250,7 @@ pub mod raw {
250250
* * v - A vector
251251
* * n - The number of elements to reserve space for
252252
*/
253-
pub unsafe fn reserve<T>(v: &mut @[const T], n: uint) {
253+
pub unsafe fn reserve<T>(v: &mut @[T], n: uint) {
254254
// Only make the (slow) call into the runtime if we have to
255255
if capacity(*v) < n {
256256
let ptr: **VecRepr = transmute(v);
@@ -274,7 +274,7 @@ pub mod raw {
274274
* * v - A vector
275275
* * n - The number of elements to reserve space for
276276
*/
277-
pub unsafe fn reserve_at_least<T>(v: &mut @[const T], n: uint) {
277+
pub unsafe fn reserve_at_least<T>(v: &mut @[T], n: uint) {
278278
reserve(v, uint::next_power_of_two(n));
279279
}
280280

branches/incoming/src/libcore/cast.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,19 @@ pub unsafe fn transmute<L, G>(thing: L) -> G {
6161

6262
/// Coerce an immutable reference to be mutable.
6363
#[inline(always)]
64-
pub unsafe fn transmute_mut<T>(ptr: &'a T) -> &'a mut T { transmute(ptr) }
64+
pub unsafe fn transmute_mut<'a,T>(ptr: &'a T) -> &'a mut T { transmute(ptr) }
6565

6666
/// Coerce a mutable reference to be immutable.
6767
#[inline(always)]
68-
pub unsafe fn transmute_immut<T>(ptr: &'a mut T) -> &'a T {
68+
pub unsafe fn transmute_immut<'a,T>(ptr: &'a mut T) -> &'a T {
6969
transmute(ptr)
7070
}
7171

7272
/// Coerce a borrowed pointer to have an arbitrary associated region.
7373
#[inline(always)]
74-
pub unsafe fn transmute_region<T>(ptr: &'a T) -> &'b T { transmute(ptr) }
74+
pub unsafe fn transmute_region<'a,'b,T>(ptr: &'a T) -> &'b T {
75+
transmute(ptr)
76+
}
7577

7678
/// Coerce an immutable reference to be mutable.
7779
#[inline(always)]
@@ -87,19 +89,19 @@ pub unsafe fn transmute_immut_unsafe<T>(ptr: *const T) -> *T {
8789

8890
/// Coerce a borrowed mutable pointer to have an arbitrary associated region.
8991
#[inline(always)]
90-
pub unsafe fn transmute_mut_region<T>(ptr: &'a mut T) -> &'b mut T {
92+
pub unsafe fn transmute_mut_region<'a,'b,T>(ptr: &'a mut T) -> &'b mut T {
9193
transmute(ptr)
9294
}
9395

9496
/// Transforms lifetime of the second pointer to match the first.
9597
#[inline(always)]
96-
pub unsafe fn copy_lifetime<S,T>(_ptr: &'a S, ptr: &T) -> &'a T {
98+
pub unsafe fn copy_lifetime<'a,S,T>(_ptr: &'a S, ptr: &T) -> &'a T {
9799
transmute_region(ptr)
98100
}
99101

100102
/// Transforms lifetime of the second pointer to match the first.
101103
#[inline(always)]
102-
pub unsafe fn copy_lifetime_vec<S,T>(_ptr: &'a [S], ptr: &T) -> &'a T {
104+
pub unsafe fn copy_lifetime_vec<'a,S,T>(_ptr: &'a [S], ptr: &T) -> &'a T {
103105
transmute_region(ptr)
104106
}
105107

branches/incoming/src/libcore/cleanup.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ use cast::transmute;
2222
* NB: These must match the representation in the C++ runtime.
2323
*/
2424

25-
type DropGlue = &'self fn(**TypeDesc, *c_void);
26-
type FreeGlue = &'self fn(**TypeDesc, *c_void);
25+
type DropGlue<'self> = &'self fn(**TypeDesc, *c_void);
26+
type FreeGlue<'self> = &'self fn(**TypeDesc, *c_void);
2727

2828
type TaskID = uintptr_t;
2929

@@ -38,12 +38,12 @@ struct MemoryRegion { priv opaque: () }
3838
#[cfg(target_arch="x86")]
3939
#[cfg(target_arch="arm")]
4040
struct Registers {
41-
data: [u32 * 16]
41+
data: [u32, ..16]
4242
}
4343

4444
#[cfg(target_arch="mips")]
4545
struct Registers {
46-
data: [u32 * 32]
46+
data: [u32, ..32]
4747
}
4848

4949
#[cfg(target_arch="x86")]
@@ -52,12 +52,12 @@ struct Registers {
5252
struct Context {
5353
regs: Registers,
5454
next: *Context,
55-
pad: [u32 * 3]
55+
pad: [u32, ..3]
5656
}
5757

5858
#[cfg(target_arch="x86_64")]
5959
struct Registers {
60-
data: [u64 * 22]
60+
data: [u64, ..22]
6161
}
6262

6363
#[cfg(target_arch="x86_64")]
@@ -80,7 +80,7 @@ struct Task {
8080
// Public fields
8181
refcount: intptr_t, // 0
8282
id: TaskID, // 4
83-
pad: [u32 * 2], // 8
83+
pad: [u32, ..2], // 8
8484
ctx: Context, // 16
8585
stack_segment: *StackSegment, // 96
8686
runtime_sp: uintptr_t, // 100

0 commit comments

Comments
 (0)