Skip to content

Commit f6356f7

Browse files
committed
---
yaml --- r: 49469 b: refs/heads/master c: e7dbe6c h: refs/heads/master i: 49467: 4c944d6 v: v3
1 parent 64b4494 commit f6356f7

File tree

11 files changed

+268
-205
lines changed

11 files changed

+268
-205
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: d8c0da39402818db2d41369826956538ba9672e1
2+
refs/heads/master: e7dbe6cd6f40b5360d6121ce9dba9803f2cf3233
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: f7a2371c176663d59062ec5158f39faecba45768
55
refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea

trunk/doc/tutorial.md

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -579,29 +579,20 @@ Structs are quite similar to C structs and are even laid out the same way in
579579
memory (so you can read from a Rust struct in C, and vice-versa). Use the dot
580580
operator to access struct fields, as in `mypoint.x`.
581581

582-
~~~~
583-
struct Point {
584-
x: float,
585-
y: float
586-
}
587-
~~~~
588-
589582
Inherited mutability means that any field of a struct may be mutable, if the
590583
struct is in a mutable slot (or a field of a struct in a mutable slot, and
591584
so forth).
592585

593-
With a value (say, `mypoint`) of such a type in a mutable location, you can do
594-
`mypoint.y += 1.0`. But in an immutable location, such an assignment to a
595-
struct without inherited mutability would result in a type error.
596-
597-
~~~~ {.xfail-test}
598-
# struct Point { x: float, y: float }
599-
let mut mypoint = Point { x: 1.0, y: 1.0 };
600-
let origin = Point { x: 0.0, y: 0.0 };
601-
602-
mypoint.y += 1.0; // mypoint is mutable, and its fields as well
603-
origin.y += 1.0; // ERROR: assigning to immutable field
604586
~~~~
587+
struct Stack {
588+
content: ~[int],
589+
head: uint
590+
}
591+
~~~~
592+
593+
With a value (say, `mystack`) of such a type in a mutable location, you can do
594+
`mystack.head += 1`. But in an immutable location, such an assignment to a
595+
struct without inherited mutability would result in a type error.
605596

606597
`match` patterns destructure structs. The basic syntax is
607598
`Name { fieldname: pattern, ... }`:

trunk/src/libcore/comm.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,6 @@ pub fn stream<T:Owned>() -> (Port<T>, Chan<T>) {
108108
109109
// Add an inherent method so that imports of GenericChan are not
110110
// required.
111-
#[cfg(stage1)]
112-
#[cfg(stage2)]
113-
#[cfg(stage3)]
114111
pub impl<T: Owned> Chan<T> {
115112
fn send(&self, x: T) { chan_send(self, x) }
116113
fn try_send(&self, x: T) -> bool { chan_try_send(self, x) }
@@ -148,9 +145,6 @@ fn chan_try_send<T:Owned>(self: &Chan<T>, x: T) -> bool {
148145
}
149146
150147
// Use an inherent impl so that imports are not required:
151-
#[cfg(stage1)]
152-
#[cfg(stage2)]
153-
#[cfg(stage3)]
154148
pub impl<T: Owned> Port<T> {
155149
fn recv(&self) -> T { port_recv(self) }
156150
fn try_recv(&self) -> Option<T> { port_try_recv(self) }
@@ -226,9 +220,6 @@ pub fn PortSet<T: Owned>() -> PortSet<T>{
226220
}
227221
228222
// Use an inherent impl so that imports are not required:
229-
#[cfg(stage1)]
230-
#[cfg(stage2)]
231-
#[cfg(stage3)]
232223
pub impl<T:Owned> PortSet<T> {
233224
fn recv(&self) -> T { port_set_recv(self) }
234225
fn try_recv(&self) -> Option<T> { port_set_try_recv(self) }
@@ -302,9 +293,6 @@ pure fn port_set_peek<T:Owned>(self: &PortSet<T>) -> bool {
302293
/// A channel that can be shared between many senders.
303294
pub type SharedChan<T> = unstable::Exclusive<Chan<T>>;
304295
305-
#[cfg(stage1)]
306-
#[cfg(stage2)]
307-
#[cfg(stage3)]
308296
pub impl<T: Owned> SharedChan<T> {
309297
fn send(&self, x: T) { shared_chan_send(self, x) }
310298
fn try_send(&self, x: T) -> bool { shared_chan_try_send(self, x) }

trunk/src/libcore/core.rc

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -212,34 +212,10 @@ pub use to_str::ToStr;
212212
pub use clone::Clone;
213213

214214

215-
/*
216-
* Export the log levels as global constants. Higher levels mean
217-
* more-verbosity. Error is the bottom level, default logging level is
218-
* warn-and-below.
219-
*/
220-
/// The error log level
221-
#[cfg(stage0)]
222-
pub const error : u32 = 1_u32;
223-
/// The warning log level
224-
#[cfg(stage0)]
225-
pub const warn : u32 = 2_u32;
226-
/// The info log level
227-
#[cfg(stage0)]
228-
pub const info : u32 = 3_u32;
229-
/// The debug log level
230-
#[cfg(stage0)]
231-
pub const debug : u32 = 4_u32;
232-
233-
234215
/* Unsupported interfaces */
235216

236217
// Private APIs
237218
pub mod unstable;
238-
// NOTE: Remove after snapshot
239-
#[cfg(stage0)]
240-
pub mod private {
241-
pub use super::unstable::extfmt;
242-
}
243219

244220
/* For internal use, not exported */
245221

@@ -255,15 +231,6 @@ pub mod rt;
255231
// can be resolved within libcore.
256232
#[doc(hidden)]
257233
pub mod core {
258-
#[cfg(stage0)]
259-
pub const error : u32 = 1_u32;
260-
#[cfg(stage0)]
261-
pub const warn : u32 = 2_u32;
262-
#[cfg(stage0)]
263-
pub const info : u32 = 3_u32;
264-
#[cfg(stage0)]
265-
pub const debug : u32 = 4_u32;
266-
267234
pub use cmp;
268235
pub use condition;
269236
pub use option;

trunk/src/libcore/io.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ pub trait Reader {
7575
fn tell(&self) -> uint;
7676
}
7777

78-
#[cfg(stage1)]
79-
#[cfg(stage2)]
80-
#[cfg(stage3)]
8178
impl Reader for @Reader {
8279
fn read(&self, bytes: &mut [u8], len: uint) -> uint {
8380
self.read(bytes, len)
@@ -658,9 +655,6 @@ pub trait Writer {
658655
fn get_type(&self) -> WriterType;
659656
}
660657
661-
#[cfg(stage1)]
662-
#[cfg(stage2)]
663-
#[cfg(stage3)]
664658
impl Writer for @Writer {
665659
fn write(&self, v: &[const u8]) { self.write(v) }
666660
fn seek(&self, a: int, b: SeekStyle) { self.seek(a, b) }

trunk/src/libcore/trie.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,15 @@ impl<T> Map<uint, T> for TrieMap<T> {
136136
}
137137
}
138138

139-
pub impl<T> TrieMap<T> {
139+
impl<T> TrieMap<T> {
140140
/// Create an empty TrieMap
141141
#[inline(always)]
142142
static pure fn new() -> TrieMap<T> {
143143
TrieMap{root: TrieNode::new(), length: 0}
144144
}
145+
}
145146

147+
impl<T> TrieMap<T> {
146148
/// Visit all keys in reverse order
147149
#[inline(always)]
148150
pure fn each_key_reverse(&self, f: &fn(&uint) -> bool) {

trunk/src/librustc/front/test.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -352,24 +352,6 @@ fn path_node_global(+ids: ~[ast::ident]) -> @ast::path {
352352
types: ~[] }
353353
}
354354

355-
#[cfg(stage0)]
356-
fn mk_tests(cx: &TestCtxt) -> @ast::item {
357-
358-
let ext_cx = cx.ext_cx;
359-
360-
// The vector of test_descs for this crate
361-
let test_descs = mk_test_descs(cx);
362-
363-
(quote_item!(
364-
pub const tests : &static/[self::std::test::TestDescAndFn] =
365-
$test_descs
366-
;
367-
)).get()
368-
}
369-
370-
#[cfg(stage1)]
371-
#[cfg(stage2)]
372-
#[cfg(stage3)]
373355
fn mk_tests(cx: &TestCtxt) -> @ast::item {
374356

375357
let ext_cx = cx.ext_cx;

trunk/src/librustc/middle/trans/expr.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,15 +1085,6 @@ fn trans_lvalue_unadjusted(bcx: block, expr: @ast::expr) -> DatumBlock {
10851085
ast::def_const(did) => {
10861086
let const_ty = expr_ty(bcx, ref_expr);
10871087
1088-
#[cfg(stage0)]
1089-
fn get_did(_ccx: @CrateContext, did: ast::def_id)
1090-
-> ast::def_id {
1091-
did
1092-
}
1093-
1094-
#[cfg(stage1)]
1095-
#[cfg(stage2)]
1096-
#[cfg(stage3)]
10971088
fn get_did(ccx: @CrateContext, did: ast::def_id)
10981089
-> ast::def_id {
10991090
if did.crate != ast::local_crate {
@@ -1103,24 +1094,6 @@ fn trans_lvalue_unadjusted(bcx: block, expr: @ast::expr) -> DatumBlock {
11031094
}
11041095
}
11051096
1106-
#[cfg(stage0)]
1107-
fn get_val(bcx: block, did: ast::def_id, const_ty: ty::t)
1108-
-> ValueRef {
1109-
let ccx = bcx.ccx();
1110-
if did.crate == ast::local_crate {
1111-
// The LLVM global has the type of its initializer,
1112-
// which may not be equal to the enum's type for
1113-
// non-C-like enums.
1114-
PointerCast(bcx, base::get_item_val(ccx, did.node),
1115-
T_ptr(type_of(bcx.ccx(), const_ty)))
1116-
} else {
1117-
base::trans_external_path(ccx, did, const_ty)
1118-
}
1119-
}
1120-
1121-
#[cfg(stage1)]
1122-
#[cfg(stage2)]
1123-
#[cfg(stage3)]
11241097
fn get_val(bcx: block, did: ast::def_id, const_ty: ty::t)
11251098
-> ValueRef {
11261099
// The LLVM global has the type of its initializer,

trunk/src/libstd/comm.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ pub struct DuplexStream<T, U> {
2626
}
2727

2828
// Allow these methods to be used without import:
29-
#[cfg(stage1)]
30-
#[cfg(stage2)]
31-
#[cfg(stage3)]
3229
pub impl<T:Owned,U:Owned> DuplexStream<T, U> {
3330
fn send(&self, x: T) {
3431
self.chan.send(x)

trunk/src/snapshots.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
S 2013-03-21 ed25a67
2+
freebsd-x86_64 5f0b08839ae3d1207808f0d57cbfdb00eff9c883
3+
linux-i386 54765a17c6b6d04a7013cada2a51d190462979b8
4+
linux-x86_64 c6cae795aecb8c4d5f17c73bfdd01d2b0ff32126
5+
macos-i386 bc05e17fc93187a1906f118ecdb258f09317f220
6+
macos-x86_64 c39838814f45e343d4f5754390aad22c41a34ba6
7+
winnt-i386 c4a858ef45ab2c9319e607640b2bbb3bc4b48093
8+
19
S 2013-02-27 a6d9689
210
freebsd-x86_64 683f329fe589af854f9a375405468691d98015ac
311
linux-i386 22f5c2a91941735007ed804586fc0f0e82fc3601

0 commit comments

Comments
 (0)