Skip to content

Commit 2ac1133

Browse files
committed
---
yaml --- r: 108532 b: refs/heads/dist-snap c: 51676b2 h: refs/heads/master v: v3
1 parent 576a908 commit 2ac1133

Some content is hidden

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

102 files changed

+1617
-963
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: f64fdf524a434f0e5cd0bc91d09c144723f3c90d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 5bb204ffdbb4305b8f9ab4d2f2d26f805e4fe92c
9+
refs/heads/dist-snap: 51676b21d63ee427be862b1f8112def790cd57a4
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/AUTHORS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Adrien Tétar <[email protected]>
77
Alan Andrade <[email protected]>
88
Aleksander Balicki <[email protected]>
99
Alex Crichton <[email protected]>
10+
Alex Lyon <[email protected]>
1011
Alex Rønne Petersen <[email protected]>
1112
Alexander Stavonin <[email protected]>
1213
Alexandros Tasos <[email protected]>

branches/dist-snap/mk/crates.mk

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,21 @@
5050
################################################################################
5151

5252
TARGET_CRATES := std extra green rustuv native flate arena glob term semver \
53-
uuid serialize sync getopts collections num test
53+
uuid serialize sync getopts collections num test time
5454
HOST_CRATES := syntax rustc rustdoc fourcc
5555
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5656
TOOLS := compiletest rustdoc rustc
5757

5858
DEPS_std := native:rustrt native:compiler-rt
59-
DEPS_extra := std term sync serialize getopts collections
59+
DEPS_extra := std term sync serialize getopts collections time
6060
DEPS_green := std native:context_switch
6161
DEPS_rustuv := std native:uv native:uv_support
6262
DEPS_native := std
6363
DEPS_syntax := std term serialize collections
6464
DEPS_rustc := syntax native:rustllvm flate arena serialize sync getopts \
65-
collections extra
65+
collections time extra
6666
DEPS_rustdoc := rustc native:sundown serialize sync getopts collections \
67-
test
67+
test time
6868
DEPS_flate := std native:miniz
6969
DEPS_arena := std collections
7070
DEPS_glob := std
@@ -78,6 +78,7 @@ DEPS_collections := std serialize
7878
DEPS_fourcc := syntax std
7979
DEPS_num := std extra
8080
DEPS_test := std extra collections getopts serialize term
81+
DEPS_time := std serialize
8182

8283
TOOL_DEPS_compiletest := test green rustuv getopts
8384
TOOL_DEPS_rustdoc := rustdoc green rustuv

branches/dist-snap/src/doc/complement-cheatsheet.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ let y: int = x.unwrap();
2222

2323
**Int to string, in non-base-10**
2424

25-
Use [`ToStrRadix`](http://static.rust-lang.org/doc/master/std/num/trait.ToStrRadix.html).
25+
Use the `format!` syntax extension.
2626

2727
~~~
28-
use std::num::ToStrRadix;
29-
3028
let x: int = 42;
31-
let y: ~str = x.to_str_radix(16);
29+
let y: ~str = format!("{:t}", x); // binary
30+
let y: ~str = format!("{:o}", x); // octal
31+
let y: ~str = format!("{:x}", x); // lowercase hexadecimal
32+
let y: ~str = format!("{:X}", x); // uppercase hexidecimal
3233
~~~
3334

3435
**String to int, in non-base-10**

branches/dist-snap/src/doc/guide-macros.md

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ which both pattern-match on their input and both return early in one case,
1111
doing nothing otherwise:
1212

1313
~~~~
14-
# enum t { special_a(uint), special_b(uint) };
14+
# enum T { SpecialA(uint), SpecialB(uint) };
1515
# fn f() -> uint {
16-
# let input_1 = special_a(0);
17-
# let input_2 = special_a(0);
16+
# let input_1 = SpecialA(0);
17+
# let input_2 = SpecialA(0);
1818
match input_1 {
19-
special_a(x) => { return x; }
19+
SpecialA(x) => { return x; }
2020
_ => {}
2121
}
2222
// ...
2323
match input_2 {
24-
special_b(x) => { return x; }
24+
SpecialB(x) => { return x; }
2525
_ => {}
2626
}
2727
# return 0u;
@@ -37,22 +37,22 @@ lightweight custom syntax extensions, themselves defined using the
3737
the pattern in the above code:
3838

3939
~~~~
40-
# enum t { special_a(uint), special_b(uint) };
40+
# enum T { SpecialA(uint), SpecialB(uint) };
4141
# fn f() -> uint {
42-
# let input_1 = special_a(0);
43-
# let input_2 = special_a(0);
42+
# let input_1 = SpecialA(0);
43+
# let input_2 = SpecialA(0);
4444
macro_rules! early_return(
45-
($inp:expr $sp:ident) => ( // invoke it like `(input_5 special_e)`
45+
($inp:expr $sp:ident) => ( // invoke it like `(input_5 SpecialE)`
4646
match $inp {
4747
$sp(x) => { return x; }
4848
_ => {}
4949
}
5050
);
5151
)
5252
// ...
53-
early_return!(input_1 special_a);
53+
early_return!(input_1 SpecialA);
5454
// ...
55-
early_return!(input_2 special_b);
55+
early_return!(input_2 SpecialB);
5656
# return 0;
5757
# }
5858
~~~~
@@ -155,10 +155,10 @@ separator token (a comma-separated list could be written `$(...),*`), and `+`
155155
instead of `*` to mean "at least one".
156156

157157
~~~~
158-
# enum t { special_a(uint),special_b(uint),special_c(uint),special_d(uint)};
158+
# enum T { SpecialA(uint),SpecialB(uint),SpecialC(uint),SpecialD(uint)};
159159
# fn f() -> uint {
160-
# let input_1 = special_a(0);
161-
# let input_2 = special_a(0);
160+
# let input_1 = SpecialA(0);
161+
# let input_2 = SpecialA(0);
162162
macro_rules! early_return(
163163
($inp:expr, [ $($sp:ident)|+ ]) => (
164164
match $inp {
@@ -170,9 +170,9 @@ macro_rules! early_return(
170170
);
171171
)
172172
// ...
173-
early_return!(input_1, [special_a|special_c|special_d]);
173+
early_return!(input_1, [SpecialA|SpecialC|SpecialD]);
174174
// ...
175-
early_return!(input_2, [special_b]);
175+
early_return!(input_2, [SpecialB]);
176176
# return 0;
177177
# }
178178
~~~~
@@ -215,14 +215,14 @@ solves the problem.
215215
Now consider code like the following:
216216

217217
~~~~
218-
# enum t1 { good_1(t2, uint), bad_1 };
219-
# struct t2 { body: t3 }
220-
# enum t3 { good_2(uint), bad_2};
221-
# fn f(x: t1) -> uint {
218+
# enum T1 { Good1(T2, uint), Bad1};
219+
# struct T2 { body: T3 }
220+
# enum T3 { Good2(uint), Bad2};
221+
# fn f(x: T1) -> uint {
222222
match x {
223-
good_1(g1, val) => {
223+
Good1(g1, val) => {
224224
match g1.body {
225-
good_2(result) => {
225+
Good2(result) => {
226226
// complicated stuff goes here
227227
return result + val;
228228
},
@@ -261,13 +261,13 @@ macro_rules! biased_match (
261261
)
262262
)
263263
264-
# enum t1 { good_1(t2, uint), bad_1 };
265-
# struct t2 { body: t3 }
266-
# enum t3 { good_2(uint), bad_2};
267-
# fn f(x: t1) -> uint {
268-
biased_match!((x) ~ (good_1(g1, val)) else { return 0 };
264+
# enum T1 { Good1(T2, uint), Bad1};
265+
# struct T2 { body: T3 }
266+
# enum T3 { Good2(uint), Bad2};
267+
# fn f(x: T1) -> uint {
268+
biased_match!((x) ~ (Good1(g1, val)) else { return 0 };
269269
binds g1, val )
270-
biased_match!((g1.body) ~ (good_2(result) )
270+
biased_match!((g1.body) ~ (Good2(result) )
271271
else { fail!("Didn't get good_2") };
272272
binds result )
273273
// complicated stuff goes here
@@ -365,13 +365,13 @@ macro_rules! biased_match (
365365
)
366366
367367
368-
# enum t1 { good_1(t2, uint), bad_1 };
369-
# struct t2 { body: t3 }
370-
# enum t3 { good_2(uint), bad_2};
371-
# fn f(x: t1) -> uint {
368+
# enum T1 { Good1(T2, uint), Bad1};
369+
# struct T2 { body: T3 }
370+
# enum T3 { Good2(uint), Bad2};
371+
# fn f(x: T1) -> uint {
372372
biased_match!(
373-
(x) ~ (good_1(g1, val)) else { return 0 };
374-
(g1.body) ~ (good_2(result) ) else { fail!("Didn't get good_2") };
373+
(x) ~ (Good1(g1, val)) else { return 0 };
374+
(g1.body) ~ (Good2(result) ) else { fail!("Didn't get Good2") };
375375
binds val, result )
376376
// complicated stuff goes here
377377
return result + val;

branches/dist-snap/src/doc/rust.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ Two examples of paths with type arguments:
470470
# use std::hashmap::HashMap;
471471
# fn f() {
472472
# fn id<T>(t: T) -> T { t }
473-
type t = HashMap<int,~str>; // Type arguments used in a type expression
473+
type T = HashMap<int,~str>; // Type arguments used in a type expression
474474
let x = id::<int>(10); // Type arguments used in a call expression
475475
# }
476476
~~~~
@@ -701,7 +701,7 @@ An example of a module:
701701

702702
~~~~
703703
mod math {
704-
type complex = (f64, f64);
704+
type Complex = (f64, f64);
705705
fn sin(f: f64) -> f64 {
706706
...
707707
# fail!();
@@ -752,35 +752,35 @@ mod task {
752752
#### View items
753753

754754
~~~~ {.ebnf .gram}
755-
view_item : extern_mod_decl | use_decl ;
755+
view_item : extern_crate_decl | use_decl ;
756756
~~~~
757757

758758
A view item manages the namespace of a module.
759759
View items do not define new items, but rather, simply change other items' visibility.
760760
There are several kinds of view item:
761761

762-
* [`extern crate` declarations](#extern-mod-declarations)
762+
* [`extern crate` declarations](#extern-crate-declarations)
763763
* [`use` declarations](#use-declarations)
764764

765-
##### Extern mod declarations
765+
##### Extern crate declarations
766766

767767
~~~~ {.ebnf .gram}
768-
extern_mod_decl : "extern" "mod" ident [ '(' link_attrs ')' ] ? [ '=' string_lit ] ? ;
768+
extern_crate_decl : "extern" "crate" ident [ '(' link_attrs ')' ] ? [ '=' string_lit ] ? ;
769769
link_attrs : link_attr [ ',' link_attrs ] + ;
770770
link_attr : ident '=' literal ;
771771
~~~~
772772

773773
An _`extern crate` declaration_ specifies a dependency on an external crate.
774-
The external crate is then bound into the declaring scope
775-
as the `ident` provided in the `extern_mod_decl`.
774+
The external crate is then bound into the declaring scope as the `ident` provided
775+
in the `extern_crate_decl`.
776776

777777
The external crate is resolved to a specific `soname` at compile time, and a
778778
runtime linkage requirement to that `soname` is passed to the linker for
779779
loading at runtime. The `soname` is resolved at compile time by scanning the
780780
compiler's library path and matching the optional `crateid` provided as a string literal
781781
against the `crateid` attributes that were declared on the external crate when
782782
it was compiled. If no `crateid` is provided, a default `name` attribute is
783-
assumed, equal to the `ident` given in the `extern_mod_decl`.
783+
assumed, equal to the `ident` given in the `extern_crate_decl`.
784784

785785
Four examples of `extern crate` declarations:
786786

@@ -813,7 +813,7 @@ module item. These declarations may appear at the top of [modules](#modules) and
813813

814814
*Note*: Unlike in many languages,
815815
`use` declarations in Rust do *not* declare linkage dependency with external crates.
816-
Rather, [`extern crate` declarations](#extern-mod-declarations) declare linkage dependencies.
816+
Rather, [`extern crate` declarations](#extern-crate-declarations) declare linkage dependencies.
817817

818818
Use declarations support a number of convenient shortcuts:
819819

@@ -875,14 +875,14 @@ An example of what will and will not work for `use` items:
875875

876876
~~~~
877877
# #[allow(unused_imports)];
878-
use foo::extra; // good: foo is at the root of the crate
878+
use foo::extra::json; // good: foo is at the root of the crate
879879
use foo::baz::foobaz; // good: foo is at the root of the crate
880880
881881
mod foo {
882882
extern crate extra;
883883
884-
use foo::extra::time; // good: foo is at crate root
885-
// use extra::*; // bad: extra is not at the crate root
884+
use foo::extra::json; // good: foo is at crate root
885+
// use extra::json::*; // bad: extra is not at the crate root
886886
use self::baz::foobaz; // good: self refers to module 'foo'
887887
use foo::bar::foobar; // good: foo is at crate root
888888
@@ -2824,13 +2824,13 @@ provided by an implementation of `std::iter::Iterator`.
28242824
An example of a for loop over the contents of a vector:
28252825

28262826
~~~~
2827-
# type foo = int;
2828-
# fn bar(f: foo) { }
2827+
# type Foo = int;
2828+
# fn bar(f: Foo) { }
28292829
# let a = 0;
28302830
# let b = 0;
28312831
# let c = 0;
28322832
2833-
let v: &[foo] = &[a, b, c];
2833+
let v: &[Foo] = &[a, b, c];
28342834
28352835
for e in v.iter() {
28362836
bar(*e);

branches/dist-snap/src/doc/tutorial.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,7 @@ reject the previous example if the arm with the wildcard pattern was
495495
omitted.
496496

497497
A powerful application of pattern matching is *destructuring*:
498-
matching in order to bind names to the contents of data
499-
types.
498+
matching in order to bind names to the contents of data types.
500499

501500
> ***Note:*** The following code makes use of tuples (`(f64, f64)`) which
502501
> are explained in section 5.3. For now you can think of tuples as a list of
@@ -2726,7 +2725,8 @@ pub mod barn {
27262725

27272726
In short, `mod foo;` is just syntactic sugar for `mod foo { /* content of <...>/foo.rs or <...>/foo/mod.rs */ }`.
27282727

2729-
This also means that having two or more identical `mod foo;` declarations somewhere in your crate hierarchy is generally a bad idea,
2728+
This also means that having two or more identical `mod foo;` declarations
2729+
somewhere in your crate hierarchy is generally a bad idea,
27302730
just like copy-and-paste-ing a module into multiple places is a bad idea.
27312731
Both will result in duplicate and mutually incompatible definitions.
27322732

@@ -3074,11 +3074,6 @@ fn main() {
30743074
It's a bit weird, but it's the result of shadowing rules that have been set that way because
30753075
they model most closely what people expect to shadow.
30763076

3077-
## Package ids
3078-
3079-
If you use `extern crate`, per default `rustc` will look for libraries in the library search path (which you can
3080-
extend with the `-L` switch).
3081-
30823077
## Crate metadata and settings
30833078

30843079
For every crate you can define a number of metadata items, such as link name, version or author.
@@ -3096,14 +3091,13 @@ Therefore, if you plan to compile your crate as a library, you should annotate i
30963091
// `lib.rs`
30973092
30983093
# #[crate_type = "lib"];
3099-
// Package ID
31003094
#[crate_id = "farm#2.5"];
31013095
31023096
// ...
31033097
# fn farm() {}
31043098
~~~~
31053099

3106-
You can also specify package ID information in a `extern crate` statement. For
3100+
You can also specify crate id information in a `extern crate` statement. For
31073101
example, these `extern crate` statements would both accept and select the
31083102
crate define above:
31093103

@@ -3161,7 +3155,7 @@ Now compile and run like this (adjust to your platform if necessary):
31613155
Notice that the library produced contains the version in the file name
31623156
as well as an inscrutable string of alphanumerics. As explained in the previous paragraph,
31633157
these are both part of Rust's library versioning scheme. The alphanumerics are
3164-
a hash representing the crates package ID.
3158+
a hash representing the crates id.
31653159

31663160
## The standard library and the prelude
31673161

@@ -3231,8 +3225,7 @@ library. You can link to a library such as `extra` with an `extern crate extra;
32313225
[extra library]: extra/index.html
32323226

32333227
Right now `extra` contains those definitions directly, but in the future it will likely just
3234-
re-export a bunch of 'officially blessed' crates that get managed with a
3235-
package manager.
3228+
re-export a bunch of 'officially blessed' crates that get managed with a package manager.
32363229

32373230
# What next?
32383231

branches/dist-snap/src/etc/vim/syntax/rust.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ syn keyword rustTrait Iterator DoubleEndedIterator RandomAccessIterator Cloneabl
8585
syn keyword rustTrait OrdIterator MutableDoubleEndedIterator ExactSize
8686

8787
syn keyword rustTrait Algebraic Trigonometric Exponential Hyperbolic
88-
syn keyword rustTrait Bitwise Bounded Integer
88+
syn keyword rustTrait Bitwise Bounded Fractional
8989
syn keyword rustTrait Num NumCast CheckedAdd CheckedSub CheckedMul CheckedDiv
9090
syn keyword rustTrait Orderable Signed Unsigned Round
9191
syn keyword rustTrait Primitive Int Float ToStrRadix ToPrimitive FromPrimitive

branches/dist-snap/src/libextra/enum_set.rs renamed to branches/dist-snap/src/libcollections/enum_set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ mod test {
139139

140140
use std::cast;
141141

142-
use enum_set::*;
142+
use enum_set::{EnumSet, CLike};
143143

144144
#[deriving(Eq)]
145145
#[repr(uint)]

0 commit comments

Comments
 (0)