Skip to content

Commit 1681b64

Browse files
committed
---
yaml --- r: 93174 b: refs/heads/try c: c1ef1ce h: refs/heads/master v: v3
1 parent 2f79e94 commit 1681b64

Some content is hidden

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

100 files changed

+945
-407
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: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: 6e7bbdacb9bf04c1f5bf2c3aad487122d8377b7f
5+
refs/heads/try: c1ef1ce9472cbff969cfd4051ac1379e9cbee394
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/doc/rust.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3168,7 +3168,7 @@ Raw pointers (`*`)
31683168
: Raw pointers are pointers without safety or liveness guarantees.
31693169
Raw pointers are written `*content`,
31703170
for example `*int` means a raw pointer to an integer.
3171-
Copying or dropping a raw pointer is has no effect on the lifecycle of any other value.
3171+
Copying or dropping a raw pointer has no effect on the lifecycle of any other value.
31723172
Dereferencing a raw pointer or converting it to any other pointer type is an [`unsafe` operation](#unsafe-functions).
31733173
Raw pointers are generally discouraged in Rust code;
31743174
they exist to support interoperability with foreign code,
@@ -3395,16 +3395,23 @@ a [temporary](#lvalues-rvalues-and-temporaries), or a local variable.
33953395
A _local variable_ (or *stack-local* allocation) holds a value directly,
33963396
allocated within the stack's memory. The value is a part of the stack frame.
33973397

3398-
Local variables are immutable unless declared with `let mut`. The
3399-
`mut` keyword applies to all local variables declared within that
3400-
declaration (so `let mut (x, y) = ...` declares two mutable variables, `x` and
3401-
`y`).
3398+
Local variables are immutable unless declared otherwise like: `let mut x = ...`.
34023399

34033400
Function parameters are immutable unless declared with `mut`. The
34043401
`mut` keyword applies only to the following parameter (so `|mut x, y|`
34053402
and `fn f(mut x: ~int, y: ~int)` declare one mutable variable `x` and
34063403
one immutable variable `y`).
34073404

3405+
Methods that take either `self` or `~self` can optionally place them in a
3406+
mutable slot by prefixing them with `mut` (similar to regular arguments):
3407+
3408+
~~~
3409+
trait Changer {
3410+
fn change(mut self) -> Self;
3411+
fn modify(mut ~self) -> ~Self;
3412+
}
3413+
~~~
3414+
34083415
Local variables are not initialized when allocated; the entire frame worth of
34093416
local variables are allocated at once, on frame-entry, in an uninitialized
34103417
state. Subsequent statements within a function may or may not initialize the

branches/try/doc/tutorial.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -151,22 +151,6 @@ declaration to appear at the top level of the file: all statements must
151151
live inside a function. Rust programs can also be compiled as
152152
libraries, and included in other programs.
153153

154-
## Using the rust tool
155-
156-
While using `rustc` directly to generate your executables, and then
157-
running them manually is a perfectly valid way to test your code,
158-
for smaller projects, prototypes, or if you're a beginner, it might be
159-
more convenient to use the `rust` tool.
160-
161-
The `rust` tool provides central access to the other rust tools,
162-
as well as handy shortcuts for directly running source files.
163-
For example, if you have a file `foo.rs` in your current directory,
164-
`rust run foo.rs` would attempt to compile it and, if successful,
165-
directly run the resulting binary.
166-
167-
To get a list of all available commands, simply call `rust` without any
168-
argument.
169-
170154
## Editing Rust code
171155

172156
There are vim highlighting and indentation scripts in the Rust source

branches/try/mk/platform.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ CFG_LIB_GLOB_x86_64-apple-darwin=lib$(1)-*.dylib
204204
CFG_LIB_DSYM_GLOB_x86_64-apple-darwin=lib$(1)-*.dylib.dSYM
205205
CFG_GCCISH_CFLAGS_x86_64-apple-darwin := -Wall -Werror -g -fPIC -m64 -arch x86_64
206206
CFG_GCCISH_CXXFLAGS_x86_64-apple-darwin := -fno-rtti
207-
CFG_GCCISH_LINK_FLAGS_x86_64-apple-darwin := -dynamiclib -pthread -framework CoreServices -Wl,-no_compact_unwind -m64
207+
CFG_GCCISH_LINK_FLAGS_x86_64-apple-darwin := -dynamiclib -pthread -framework CoreServices -m64
208208
CFG_GCCISH_DEF_FLAG_x86_64-apple-darwin := -Wl,-exported_symbols_list,
209209
CFG_GCCISH_PRE_LIB_FLAGS_x86_64-apple-darwin :=
210210
CFG_GCCISH_POST_LIB_FLAGS_x86_64-apple-darwin :=
@@ -230,7 +230,7 @@ CFG_LIB_GLOB_i686-apple-darwin=lib$(1)-*.dylib
230230
CFG_LIB_DSYM_GLOB_i686-apple-darwin=lib$(1)-*.dylib.dSYM
231231
CFG_GCCISH_CFLAGS_i686-apple-darwin := -Wall -Werror -g -fPIC -m32 -arch i386
232232
CFG_GCCISH_CXXFLAGS_i686-apple-darwin := -fno-rtti
233-
CFG_GCCISH_LINK_FLAGS_i686-apple-darwin := -dynamiclib -pthread -framework CoreServices -Wl,-no_compact_unwind -m32
233+
CFG_GCCISH_LINK_FLAGS_i686-apple-darwin := -dynamiclib -pthread -framework CoreServices -m32
234234
CFG_GCCISH_DEF_FLAG_i686-apple-darwin := -Wl,-exported_symbols_list,
235235
CFG_GCCISH_PRE_LIB_FLAGS_i686-apple-darwin :=
236236
CFG_GCCISH_POST_LIB_FLAGS_i686-apple-darwin :=

branches/try/mk/tests.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ $(3)/stage$(1)/test/rustpkgtest-$(2)$$(X_$(2)): \
370370
$$(SREQ$(1)_T_$(2)_H_$(3)) \
371371
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBSYNTAX_$(2)) \
372372
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_LIBRUSTC_$(2)) \
373+
$$(HBIN$(1)_H_$(3))/rustpkg$$(X_$(2)) \
373374
$$(TBIN$(1)_T_$(2)_H_$(3))/rustpkg$$(X_$(2)) \
374375
$$(TBIN$(1)_T_$(2)_H_$(3))/rustc$$(X_$(2))
375376
@$$(call E, compile_and_link: $$@)

branches/try/src/libextra/arc.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -521,15 +521,15 @@ fn borrow_rwlock<T:Freeze + Send>(state: *mut RWArcInner<T>) -> *RWLock {
521521

522522
/// The "write permission" token used for RWArc.write_downgrade().
523523
pub struct RWWriteMode<'self, T> {
524-
data: &'self mut T,
525-
token: sync::RWLockWriteMode<'self>,
526-
poison: PoisonOnFail,
524+
priv data: &'self mut T,
525+
priv token: sync::RWLockWriteMode<'self>,
526+
priv poison: PoisonOnFail,
527527
}
528528

529529
/// The "read permission" token used for RWArc.write_downgrade().
530530
pub struct RWReadMode<'self, T> {
531-
data: &'self T,
532-
token: sync::RWLockReadMode<'self>,
531+
priv data: &'self T,
532+
priv token: sync::RWLockReadMode<'self>,
533533
}
534534

535535
impl<'self, T:Freeze + Send> RWWriteMode<'self, T> {

branches/try/src/libextra/base64.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ pub enum CharacterSet {
2222
/// Contains configuration parameters for `to_base64`.
2323
pub struct Config {
2424
/// Character set to use
25-
char_set: CharacterSet,
25+
priv char_set: CharacterSet,
2626
/// True to pad output with `=` characters
27-
pad: bool,
27+
priv pad: bool,
2828
/// `Some(len)` to wrap lines at `len`, `None` to disable line wrapping
29-
line_length: Option<uint>
29+
priv line_length: Option<uint>
3030
}
3131

3232
/// Configuration for RFC 4648 standard base64 encoding

branches/try/src/libextra/bitv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,9 @@ enum Op {Union, Intersect, Assign, Difference}
226226
#[deriving(Clone)]
227227
pub struct Bitv {
228228
/// Internal representation of the bit vector (small or large)
229-
rep: BitvVariant,
229+
priv rep: BitvVariant,
230230
/// The number of valid bits in the internal representation
231-
nbits: uint
231+
priv nbits: uint
232232
}
233233

234234
fn die() -> ! {

branches/try/src/libextra/ebml.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl Doc {
5050
}
5151

5252
pub struct TaggedDoc {
53-
tag: uint,
53+
priv tag: uint,
5454
doc: Doc,
5555
}
5656

branches/try/src/libextra/fileinput.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ struct FileInput_ {
155155
// "self.fi" -> "self." and renaming FileInput_. Documentation above
156156
// will likely have to be updated to use `let mut in = ...`.
157157
pub struct FileInput {
158-
fi: @mut FileInput_
158+
priv fi: @mut FileInput_
159159
}
160160

161161
impl FileInput {

branches/try/src/libextra/getopts.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ pub struct Opt {
119119
/// How often it can occur
120120
occur: Occur,
121121
/// Which options it aliases
122-
aliases: ~[Opt],
122+
priv aliases: ~[Opt],
123123
}
124124

125125
/// Describes wether an option is given at all or has a value.
@@ -134,9 +134,9 @@ enum Optval {
134134
#[deriving(Clone, Eq)]
135135
pub struct Matches {
136136
/// Options that matched
137-
opts: ~[Opt],
137+
priv opts: ~[Opt],
138138
/// Values of the Options that matched
139-
vals: ~[~[Optval]],
139+
priv vals: ~[~[Optval]],
140140
/// Free string fragments
141141
free: ~[~str]
142142
}

branches/try/src/libextra/glob.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,21 +480,21 @@ pub struct MatchOptions {
480480
* currently only considers upper/lower case relationships between ASCII characters,
481481
* but in future this might be extended to work with Unicode.
482482
*/
483-
case_sensitive: bool,
483+
priv case_sensitive: bool,
484484

485485
/**
486486
* If this is true then path-component separator characters (e.g. `/` on Posix)
487487
* must be matched by a literal `/`, rather than by `*` or `?` or `[...]`
488488
*/
489-
require_literal_separator: bool,
489+
priv require_literal_separator: bool,
490490

491491
/**
492492
* If this is true then paths that contain components that start with a `.` will
493493
* not match unless the `.` appears literally in the pattern: `*`, `?` or `[...]`
494494
* will not match. This is useful because such files are conventionally considered
495495
* hidden on Unix systems and it might be desirable to skip them when listing files.
496496
*/
497-
require_literal_leading_dot: bool
497+
priv require_literal_leading_dot: bool
498498
}
499499

500500
impl MatchOptions {

branches/try/src/libextra/io_util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ use std::cast;
1717
/// An implementation of the io::Reader interface which reads a buffer of bytes
1818
pub struct BufReader {
1919
/// The buffer of bytes to read
20-
buf: ~[u8],
20+
priv buf: ~[u8],
2121
/// The current position in the buffer of bytes
22-
pos: @mut uint
22+
priv pos: @mut uint
2323
}
2424

2525
impl BufReader {

branches/try/src/libextra/json.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ pub type Object = TreeMap<~str, Json>;
4949
/// returned
5050
pub struct Error {
5151
/// The line number at which the error occurred
52-
line: uint,
52+
priv line: uint,
5353
/// The column number at which the error occurred
54-
col: uint,
54+
priv col: uint,
5555
/// A message describing the type of the error
56-
msg: @~str,
56+
priv msg: @~str,
5757
}
5858

5959
fn escape_str(s: &str) -> ~str {

branches/try/src/libextra/num/rational.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ use super::bigint::BigInt;
2020
#[deriving(Clone)]
2121
#[allow(missing_doc)]
2222
pub struct Ratio<T> {
23-
numer: T,
24-
denom: T
23+
priv numer: T,
24+
priv denom: T
2525
}
2626

2727
/// Alias for a `Ratio` of machine-sized integers.

branches/try/src/libextra/semver.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,17 @@ impl ToStr for Identifier {
7171
#[deriving(Clone, Eq)]
7272
pub struct Version {
7373
/// The major version, to be incremented on incompatible changes.
74-
major: uint,
74+
priv major: uint,
7575
/// The minor version, to be incremented when functionality is added in a
7676
/// backwards-compatible manner.
77-
minor: uint,
77+
priv minor: uint,
7878
/// The patch version, to be incremented when backwards-compatible bug
7979
/// fixes are made.
80-
patch: uint,
80+
priv patch: uint,
8181
/// The pre-release version identifier, if one exists.
82-
pre: ~[Identifier],
82+
priv pre: ~[Identifier],
8383
/// The build metadata, ignored when determining version precedence.
84-
build: ~[Identifier],
84+
priv build: ~[Identifier],
8585
}
8686

8787
impl ToStr for Version {

branches/try/src/libextra/stats.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,23 @@ pub trait Stats {
105105
#[deriving(Clone, Eq)]
106106
#[allow(missing_doc)]
107107
pub struct Summary {
108-
sum: f64,
108+
priv sum: f64,
109+
// public
109110
min: f64,
111+
// public
110112
max: f64,
111-
mean: f64,
113+
priv mean: f64,
114+
// public
112115
median: f64,
113-
var: f64,
114-
std_dev: f64,
115-
std_dev_pct: f64,
116+
priv var: f64,
117+
priv std_dev: f64,
118+
priv std_dev_pct: f64,
119+
// public
116120
median_abs_dev: f64,
121+
// public
117122
median_abs_dev_pct: f64,
118-
quartiles: (f64,f64,f64),
119-
iqr: f64,
123+
priv quartiles: (f64,f64,f64),
124+
priv iqr: f64,
120125
}
121126

122127
impl Summary {

branches/try/src/libextra/sync.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,8 @@ impl Semaphore {
376376
* A task which fails while holding a mutex will unlock the mutex as it
377377
* unwinds.
378378
*/
379-
pub struct Mutex { priv sem: Sem<~[WaitQueue]> }
380379

380+
pub struct Mutex { priv sem: Sem<~[WaitQueue]> }
381381
impl Clone for Mutex {
382382
/// Create a new handle to the mutex.
383383
fn clone(&self) -> Mutex { Mutex { sem: Sem((*self.sem).clone()) } }
@@ -663,8 +663,8 @@ impl RWLock {
663663
}
664664

665665
/// The "write permission" token used for rwlock.write_downgrade().
666-
pub struct RWLockWriteMode<'self> { priv lock: &'self RWLock, priv token: NonCopyable }
667666
667+
pub struct RWLockWriteMode<'self> { priv lock: &'self RWLock, priv token: NonCopyable }
668668
/// The "read permission" token used for rwlock.write_downgrade().
669669
pub struct RWLockReadMode<'self> { priv lock: &'self RWLock,
670670
priv token: NonCopyable }

branches/try/src/libextra/task_pool.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ enum Msg<T> {
2828
}
2929

3030
pub struct TaskPool<T> {
31-
channels: ~[Chan<Msg<T>>],
32-
next_index: uint,
31+
priv channels: ~[Chan<Msg<T>>],
32+
priv next_index: uint,
3333
}
3434

3535
#[unsafe_destructor]

branches/try/src/libextra/term.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,14 @@ fn cap_for_attr(attr: attr::Attr) -> &'static str {
9595

9696
#[cfg(not(target_os = "win32"))]
9797
pub struct Terminal {
98-
num_colors: u16,
98+
priv num_colors: u16,
9999
priv out: @io::Writer,
100100
priv ti: ~TermInfo
101101
}
102102

103103
#[cfg(target_os = "win32")]
104104
pub struct Terminal {
105-
num_colors: u16,
105+
priv num_colors: u16,
106106
priv out: @io::Writer,
107107
}
108108

branches/try/src/libextra/terminfo/parm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ pub enum Param {
4848
/// Container for static and dynamic variable arrays
4949
pub struct Variables {
5050
/// Static variables A-Z
51-
sta: [Param, ..26],
51+
priv sta: [Param, ..26],
5252
/// Dynamic variables a-z
53-
dyn: [Param, ..26]
53+
priv dyn: [Param, ..26]
5454
}
5555

5656
impl Variables {

branches/try/src/libextra/terminfo/terminfo.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ use std::hashmap::HashMap;
1515
/// A parsed terminfo entry.
1616
pub struct TermInfo {
1717
/// Names for the terminal
18-
names: ~[~str],
18+
priv names: ~[~str],
1919
/// Map of capability name to boolean value
20-
bools: HashMap<~str, bool>,
20+
priv bools: HashMap<~str, bool>,
2121
/// Map of capability name to numeric value
2222
numbers: HashMap<~str, u16>,
2323
/// Map of capability name to raw (unexpanded) string

0 commit comments

Comments
 (0)