Skip to content

Commit 6093ccd

Browse files
committed
---
yaml --- r: 51710 b: refs/heads/incoming c: 8fe7fd6 h: refs/heads/master v: v3
1 parent 149beb0 commit 6093ccd

File tree

199 files changed

+1244
-1292
lines changed

Some content is hidden

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

199 files changed

+1244
-1292
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: f41a510631ca8e41f16c8a0097a179d067ce4f7d
9+
refs/heads/incoming: 8fe7fd6dd6abe0ab7949ba11c05baaf30f79bdc4
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 's,^[^_]*_,,' | sed 's/\([^=]*\).*/\1/' | xargs)"
578+
CFG_SUPPORTED_TARGET_TRIPLES="$(grep ^CC_*=* $CFG_SRC_DIR/mk/platform.mk | sed -e 's/^CC_//' -e '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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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<'self> {
1119+
struct BitsNStrings {
11201120
mybits: [uint, ..2],
11211121
mystring: &'self str
11221122
}

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<'r>(p: &'r Point) -> &'r float { &p.x }
488+
fn get_x(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<'r, T>(shape: &'r Shape, threshold: float,
575-
a: &'r T, b: &'r T) -> &'r T {
574+
fn select<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<'r, T>(shape: &Shape, threshold: float,
595-
# a: &'r T, b: &'r T) -> &'r T {
594+
# fn select<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<'r, T>( // |-+ B
599+
fn select_based_on_unit_circle<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<'r, 'tmp, T>(shape: &'tmp Shape, threshold: float,
632-
a: &'r T, b: &'r T) -> &'r T {
631+
fn select<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<'r, T>(shape: &Shape, threshold: float,
651-
a: &'r T, b: &'r T) -> &'r T {
650+
fn select<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/src/compiletest/compiletest.rc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ 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;
2531

2632
use std::getopts;
2733
use std::test;
@@ -37,13 +43,6 @@ use common::mode_debug_info;
3743
use common::mode;
3844
use util::logv;
3945

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-
4746
pub fn main() {
4847
let args = os::args();
4948
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: @[T]) -> uint {
41+
pub fn capacity<T>(v: @[const 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: @[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: @[A] = @[];
63+
let mut vec: @[const 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<'self,T:Copy> Add<&'self const [T],@[T]> for @[T] {
177+
impl<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: @[T], new_len: uint) {
210+
pub unsafe fn set_len<T>(v: @[const 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 @[T], initval: T) {
216+
pub unsafe fn push<T>(v: &mut @[const 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 @[T], initval: T) {
228+
pub unsafe fn push_fast<T>(v: &mut @[const 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 @[T], initval: T) {
237+
pub unsafe fn push_slow<T>(v: &mut @[const 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 @[T], n: uint) {
253+
pub unsafe fn reserve<T>(v: &mut @[const 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 @[T], n: uint) {
277+
pub unsafe fn reserve_at_least<T>(v: &mut @[const T], n: uint) {
278278
reserve(v, uint::next_power_of_two(n));
279279
}
280280

branches/incoming/src/libcore/cast.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,17 @@ 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<'a,T>(ptr: &'a T) -> &'a mut T { transmute(ptr) }
64+
pub unsafe fn transmute_mut<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<'a,T>(ptr: &'a mut T) -> &'a T {
68+
pub unsafe fn transmute_immut<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<'a,'b,T>(ptr: &'a T) -> &'b T {
75-
transmute(ptr)
76-
}
74+
pub unsafe fn transmute_region<T>(ptr: &'a T) -> &'b T { transmute(ptr) }
7775

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

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

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

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

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> = &'self fn(**TypeDesc, *c_void);
26-
type FreeGlue<'self> = &'self fn(**TypeDesc, *c_void);
25+
type DropGlue = &'self fn(**TypeDesc, *c_void);
26+
type FreeGlue = &'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

branches/incoming/src/libcore/condition.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ pub struct Handler<T, U> {
2222
prev: Option<@Handler<T, U>>,
2323
}
2424

25-
pub struct Condition<'self, T, U> {
25+
pub struct Condition<T, U> {
2626
name: &'static str,
2727
key: task::local_data::LocalDataKey<'self, Handler<T, U>>
2828
}
2929

30-
pub impl<'self, T, U> Condition<'self, T, U> {
30+
pub impl<T, U> Condition<'self, T, U> {
3131
fn trap(&self, h: &'self fn(T) -> U) -> Trap<'self, T, U> {
3232
unsafe {
3333
let p : *RustClosure = ::cast::transmute(&h);
@@ -66,12 +66,12 @@ pub impl<'self, T, U> Condition<'self, T, U> {
6666
}
6767
}
6868

69-
struct Trap<'self, T, U> {
69+
struct Trap<T, U> {
7070
cond: &'self Condition<'self, T, U>,
7171
handler: @Handler<T, U>
7272
}
7373

74-
pub impl<'self, T, U> Trap<'self, T, U> {
74+
pub impl<T, U> Trap<'self, T, U> {
7575
fn in<V>(&self, inner: &'self fn() -> V) -> V {
7676
unsafe {
7777
let _g = Guard { cond: self.cond };
@@ -82,12 +82,12 @@ pub impl<'self, T, U> Trap<'self, T, U> {
8282
}
8383
}
8484

85-
struct Guard<'self, T, U> {
85+
struct Guard<T, U> {
8686
cond: &'self Condition<'self, T, U>
8787
}
8888

8989
#[unsafe_destructor]
90-
impl<'self, T, U> Drop for Guard<'self, T, U> {
90+
impl<T, U> Drop for Guard<'self, T, U> {
9191
fn finalize(&self) {
9292
unsafe {
9393
debug!("Guard: popping handler from TLS");

0 commit comments

Comments
 (0)