Skip to content

Commit f3064e7

Browse files
committed
---
yaml --- r: 29851 b: refs/heads/incoming c: 74c69e1 h: refs/heads/master i: 29849: 6a2a06e 29847: b9396ed v: v3
1 parent dc3c441 commit f3064e7

Some content is hidden

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

68 files changed

+458
-428
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: 8be0f665bcda9f5e4077d0be6ebc6aa382e72319
9+
refs/heads/incoming: 74c69e1053188d92b86bc8b28cbf1af87d31ea2d
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libcore/at_vec.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export unsafe;
1515
#[abi = "cdecl"]
1616
extern mod rustrt {
1717
fn vec_reserve_shared_actual(++t: *sys::TypeDesc,
18-
++v: **vec::unsafe::vec_repr,
18+
++v: **vec::unsafe::VecRepr,
1919
++n: libc::size_t);
2020
}
2121

@@ -25,13 +25,13 @@ extern mod rusti {
2525
}
2626

2727
/// A function used to initialize the elements of a vector
28-
type init_op<T> = fn(uint) -> T;
28+
type InitOp<T> = fn(uint) -> T;
2929

3030
/// Returns the number of elements the vector can hold without reallocating
3131
#[inline(always)]
3232
pure fn capacity<T>(&&v: @[const T]) -> uint {
3333
unsafe {
34-
let repr: **unsafe::vec_repr =
34+
let repr: **unsafe::VecRepr =
3535
::unsafe::reinterpret_cast(addr_of(v));
3636
(**repr).alloc / sys::size_of::<T>()
3737
}
@@ -103,7 +103,7 @@ pure fn map<T, U>(v: &[T], f: fn(T) -> U) -> @[U] {
103103
* Creates an immutable vector of size `n_elts` and initializes the elements
104104
* to the value returned by the function `op`.
105105
*/
106-
pure fn from_fn<T>(n_elts: uint, op: init_op<T>) -> @[T] {
106+
pure fn from_fn<T>(n_elts: uint, op: InitOp<T>) -> @[T] {
107107
do build_sized(n_elts) |push| {
108108
let mut i: uint = 0u;
109109
while i < n_elts { push(op(i)); i += 1u; }
@@ -133,8 +133,8 @@ impl<T: copy> @[T]: add<&[const T],@[T]> {
133133

134134

135135
mod unsafe {
136-
type vec_repr = vec::unsafe::vec_repr;
137-
type slice_repr = vec::unsafe::slice_repr;
136+
type VecRepr = vec::unsafe::VecRepr;
137+
type SliceRepr = vec::unsafe::SliceRepr;
138138

139139
/**
140140
* Sets the length of a vector
@@ -145,13 +145,13 @@ mod unsafe {
145145
*/
146146
#[inline(always)]
147147
unsafe fn set_len<T>(&&v: @[const T], new_len: uint) {
148-
let repr: **vec_repr = ::unsafe::reinterpret_cast(addr_of(v));
148+
let repr: **VecRepr = ::unsafe::reinterpret_cast(addr_of(v));
149149
(**repr).fill = new_len * sys::size_of::<T>();
150150
}
151151

152152
#[inline(always)]
153153
unsafe fn push<T>(&v: @[const T], +initval: T) {
154-
let repr: **vec_repr = ::unsafe::reinterpret_cast(addr_of(v));
154+
let repr: **VecRepr = ::unsafe::reinterpret_cast(addr_of(v));
155155
let fill = (**repr).fill;
156156
if (**repr).alloc > fill {
157157
push_fast(v, initval);
@@ -163,7 +163,7 @@ mod unsafe {
163163
// This doesn't bother to make sure we have space.
164164
#[inline(always)] // really pretty please
165165
unsafe fn push_fast<T>(&v: @[const T], +initval: T) {
166-
let repr: **vec_repr = ::unsafe::reinterpret_cast(addr_of(v));
166+
let repr: **VecRepr = ::unsafe::reinterpret_cast(addr_of(v));
167167
let fill = (**repr).fill;
168168
(**repr).fill += sys::size_of::<T>();
169169
let p = ptr::addr_of((**repr).data);
@@ -190,7 +190,7 @@ mod unsafe {
190190
unsafe fn reserve<T>(&v: @[const T], n: uint) {
191191
// Only make the (slow) call into the runtime if we have to
192192
if capacity(v) < n {
193-
let ptr = addr_of(v) as **vec_repr;
193+
let ptr = addr_of(v) as **VecRepr;
194194
rustrt::vec_reserve_shared_actual(sys::get_type_desc::<T>(),
195195
ptr, n as libc::size_t);
196196
}

branches/incoming/src/libcore/comm.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* ~~~
2828
*/
2929

30-
import either::either;
30+
import either::Either;
3131
import libc::size_t;
3232

3333
export port;
@@ -222,7 +222,7 @@ fn peek_(p: *rust_port) -> bool {
222222

223223
/// Receive on one of two ports
224224
fn select2<A: send, B: send>(p_a: port<A>, p_b: port<B>)
225-
-> either<A, B> {
225+
-> Either<A, B> {
226226
let ports = ~[(**p_a).po, (**p_b).po];
227227
let yield = 0u, yieldp = ptr::addr_of(yield);
228228

@@ -246,9 +246,9 @@ fn select2<A: send, B: send>(p_a: port<A>, p_b: port<B>)
246246
assert resport != ptr::null();
247247

248248
if resport == (**p_a).po {
249-
either::left(recv(p_a))
249+
either::Left(recv(p_a))
250250
} else if resport == (**p_b).po {
251-
either::right(recv(p_b))
251+
either::Right(recv(p_b))
252252
} else {
253253
fail ~"unexpected result from rust_port_select";
254254
}
@@ -355,11 +355,11 @@ fn test_select2_available() {
355355

356356
send(ch_a, ~"a");
357357

358-
assert select2(po_a, po_b) == either::left(~"a");
358+
assert select2(po_a, po_b) == either::Left(~"a");
359359

360360
send(ch_b, ~"b");
361361
362-
assert select2(po_a, po_b) == either::right(~"b");
362+
assert select2(po_a, po_b) == either::Right(~"b");
363363
}
364364
365365
#[test]
@@ -375,14 +375,14 @@ fn test_select2_rendezvous() {
375375
send(ch_a, ~"a");
376376
};
377377

378-
assert select2(po_a, po_b) == either::left(~"a");
378+
assert select2(po_a, po_b) == either::Left(~"a");
379379

380380
do task::spawn {
381381
for iter::repeat(10u) { task::yield() }
382382
send(ch_b, ~"b");
383383
};
384384
385-
assert select2(po_a, po_b) == either::right(~"b");
385+
assert select2(po_a, po_b) == either::Right(~"b");
386386
}
387387
}
388388
@@ -413,8 +413,8 @@ fn test_select2_stress() {
413413
let mut bs = 0;
414414
for iter::repeat(msgs * times * 2u) {
415415
match select2(po_a, po_b) {
416-
either::left(~"a") => as += 1,
417-
either::right(~"b") => bs += 1,
416+
either::Left(~"a") => as += 1,
417+
either::Right(~"b") => bs += 1,
418418
_ => fail ~"test_select_2_stress failed"
419419
}
420420
}

branches/incoming/src/libcore/core.rc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export priv;
6868
// Built-in-type support modules
6969

7070
/// Operations and constants for `int`
71+
#[warn(non_camel_case_types)]
7172
#[path = "int-template"]
7273
mod int {
7374
import inst::{ hash, pow };
@@ -77,34 +78,39 @@ mod int {
7778
}
7879

7980
/// Operations and constants for `i8`
81+
#[warn(non_camel_case_types)]
8082
#[path = "int-template"]
8183
mod i8 {
8284
#[path = "i8.rs"]
8385
mod inst;
8486
}
8587

8688
/// Operations and constants for `i16`
89+
#[warn(non_camel_case_types)]
8790
#[path = "int-template"]
8891
mod i16 {
8992
#[path = "i16.rs"]
9093
mod inst;
9194
}
9295

9396
/// Operations and constants for `i32`
97+
#[warn(non_camel_case_types)]
9498
#[path = "int-template"]
9599
mod i32 {
96100
#[path = "i32.rs"]
97101
mod inst;
98102
}
99103

100104
/// Operations and constants for `i64`
105+
#[warn(non_camel_case_types)]
101106
#[path = "int-template"]
102107
mod i64 {
103108
#[path = "i64.rs"]
104109
mod inst;
105110
}
106111

107112
/// Operations and constants for `uint`
113+
#[warn(non_camel_case_types)]
108114
#[path = "uint-template"]
109115
mod uint {
110116
import inst::{
@@ -119,6 +125,7 @@ mod uint {
119125
}
120126

121127
/// Operations and constants for `u8`
128+
#[warn(non_camel_case_types)]
122129
#[path = "uint-template"]
123130
mod u8 {
124131
import inst::is_ascii;
@@ -129,36 +136,49 @@ mod u8 {
129136
}
130137

131138
/// Operations and constants for `u16`
139+
#[warn(non_camel_case_types)]
132140
#[path = "uint-template"]
133141
mod u16 {
134142
#[path = "u16.rs"]
135143
mod inst;
136144
}
137145

138146
/// Operations and constants for `u32`
147+
#[warn(non_camel_case_types)]
139148
#[path = "uint-template"]
140149
mod u32 {
141150
#[path = "u32.rs"]
142151
mod inst;
143152
}
144153

145154
/// Operations and constants for `u64`
155+
#[warn(non_camel_case_types)]
146156
#[path = "uint-template"]
147157
mod u64 {
148158
#[path = "u64.rs"]
149159
mod inst;
150160
}
151161

152162

163+
#[warn(non_camel_case_types)]
153164
mod box;
165+
#[warn(non_camel_case_types)]
154166
mod char;
167+
#[warn(non_camel_case_types)]
155168
mod float;
169+
#[warn(non_camel_case_types)]
156170
mod f32;
171+
#[warn(non_camel_case_types)]
157172
mod f64;
173+
#[warn(non_camel_case_types)]
158174
mod str;
175+
#[warn(non_camel_case_types)]
159176
mod ptr;
177+
#[warn(non_camel_case_types)]
160178
mod vec;
179+
#[warn(non_camel_case_types)]
161180
mod at_vec;
181+
#[warn(non_camel_case_types)]
162182
mod bool;
163183
#[warn(non_camel_case_types)]
164184
mod tuple;
@@ -173,7 +193,9 @@ mod cmp;
173193
mod num;
174194
#[warn(non_camel_case_types)]
175195
mod hash;
196+
#[warn(non_camel_case_types)]
176197
mod either;
198+
#[warn(non_camel_case_types)]
177199
mod iter;
178200
#[warn(non_camel_case_types)]
179201
mod logging;
@@ -193,18 +215,23 @@ mod util;
193215

194216
// Data structure modules
195217

218+
#[warn(non_camel_case_types)]
196219
mod dvec;
197220
#[path="iter-trait"]
221+
#[warn(non_camel_case_types)]
198222
mod dvec_iter {
199223
#[path = "dvec.rs"]
200224
mod inst;
201225
}
226+
#[warn(non_camel_case_types)]
202227
mod dlist;
203228
#[path="iter-trait"]
229+
#[warn(non_camel_case_types)]
204230
mod dlist_iter {
205231
#[path ="dlist.rs"]
206232
mod inst;
207233
}
234+
#[warn(non_camel_case_types)]
208235
mod send_map;
209236

210237
// Concurrency

branches/incoming/src/libcore/core.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@ import option::{some, none};
66
import option = option::option;
77
import Path = path::Path;
88
import tuple::{TupleOps, ExtendedTupleOps};
9-
import str::{str_slice, unique_str};
10-
import vec::{const_vector, copyable_vector, immutable_vector};
11-
import vec::{immutable_copyable_vector, iter_trait_extensions};
12-
import iter::{base_iter, extended_iter, copyable_iter, times, timesi};
9+
import str::{StrSlice, UniqueStr};
10+
import vec::{ConstVector, CopyableVector, ImmutableVector};
11+
import vec::{ImmutableCopyableVector, IterTraitExtensions};
12+
import iter::{BaseIter, ExtendedIter, CopyableIter, Times, TimesIx};
1313
import num::Num;
14-
import ptr::ptr;
14+
import ptr::Ptr;
1515
import to_str::ToStr;
1616

1717
export Path, option, some, none, unreachable;
1818
export extensions;
1919
// The following exports are the extension impls for numeric types
20-
export Num, times, timesi;
20+
export Num, Times, TimesIx;
2121
// The following exports are the common traits
22-
export str_slice, unique_str;
23-
export const_vector, copyable_vector, immutable_vector;
24-
export immutable_copyable_vector, iter_trait_extensions;
25-
export base_iter, copyable_iter, extended_iter;
22+
export StrSlice, UniqueStr;
23+
export ConstVector, CopyableVector, ImmutableVector;
24+
export ImmutableCopyableVector, IterTraitExtensions;
25+
export BaseIter, CopyableIter, ExtendedIter;
2626
export TupleOps, ExtendedTupleOps;
27-
export ptr;
27+
export Ptr;
2828
export ToStr;
2929

3030
// The following exports are the core operators and kinds

0 commit comments

Comments
 (0)