Skip to content

Commit 5c91fe6

Browse files
committed
---
yaml --- r: 152372 b: refs/heads/try2 c: fe7fc4a h: refs/heads/master v: v3
1 parent 0990272 commit 5c91fe6

File tree

248 files changed

+4151
-5191
lines changed

Some content is hidden

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

248 files changed

+4151
-5191
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 7580ef902eaaf402219b47c3f92019c0644086db
8+
refs/heads/try2: fe7fc4aeb270f5b102ff3e9905a571c30f0960cd
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/crates.mk

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
TARGET_CRATES := libc std green rustuv native flate arena glob term semver \
5353
uuid serialize sync getopts collections num test time rand \
54-
url log regex graphviz core rlibc alloc debug rustrt
54+
url log regex graphviz core rlibc alloc debug
5555
HOST_CRATES := syntax rustc rustdoc fourcc hexfloat regex_macros fmt_macros
5656
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5757
TOOLS := compiletest rustdoc rustc
@@ -60,9 +60,7 @@ DEPS_core :=
6060
DEPS_rlibc :=
6161
DEPS_alloc := core libc native:jemalloc
6262
DEPS_debug := std
63-
DEPS_rustrt := alloc core libc collections native:rustrt_native
64-
DEPS_std := core libc rand alloc collections rustrt \
65-
native:rust_builtin native:backtrace
63+
DEPS_std := core rand libc alloc collections native:rustrt native:backtrace
6664
DEPS_graphviz := std
6765
DEPS_green := std native:context_switch
6866
DEPS_rustuv := std native:uv native:uv_support

branches/try2/mk/docs.mk

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ L10N_LANGS := ja
4343

4444
# The options are passed to the documentation generators.
4545
RUSTDOC_HTML_OPTS_NO_CSS = --markdown-before-content=doc/version_info.html \
46-
--markdown-in-header=doc/favicon.inc \
47-
--markdown-after-content=doc/footer.inc \
48-
--markdown-playground-url='http://play.rust-lang.org/'
46+
--markdown-in-header=doc/favicon.inc --markdown-after-content=doc/footer.inc
4947

5048
RUSTDOC_HTML_OPTS = $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css rust.css
5149

branches/try2/mk/rt.mk

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
# that's per-target so you're allowed to conditionally add files based on the
3636
# target.
3737
################################################################################
38-
NATIVE_LIBS := rust_builtin hoedown uv_support morestack miniz context_switch \
39-
rustrt_native rust_test_helpers
38+
NATIVE_LIBS := rustrt hoedown uv_support morestack miniz context_switch \
39+
rust_test_helpers
4040

4141
# $(1) is the target triple
4242
define NATIVE_LIBRARIES
@@ -52,9 +52,8 @@ NATIVE_DEPS_hoedown_$(1) := hoedown/src/autolink.c \
5252
hoedown/src/version.c
5353
NATIVE_DEPS_uv_support_$(1) := rust_uv.c
5454
NATIVE_DEPS_miniz_$(1) = miniz.c
55-
NATIVE_DEPS_rust_builtin_$(1) := rust_builtin.c \
56-
rust_android_dummy.c
57-
NATIVE_DEPS_rustrt_native_$(1) := \
55+
NATIVE_DEPS_rustrt_$(1) := rust_builtin.c \
56+
rust_android_dummy.c \
5857
rust_try.ll \
5958
arch/$$(HOST_$(1))/record_sp.S
6059
NATIVE_DEPS_rust_test_helpers_$(1) := rust_test_helpers.c

branches/try2/mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ endif
818818
ifeq ($(2),$$(CFG_BUILD))
819819
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4)): $$(CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4))
820820
@$$(call E, run doc-crate-$(4) [$(2)])
821-
$$(Q)$$(RUSTDOC_$(1)_T_$(2)_H_$(3)) --test --cfg dox \
821+
$$(Q)$$(RUSTDOC_$(1)_T_$(2)_H_$(3)) --test \
822822
$$(CRATEFILE_$(4)) --test-args "$$(TESTARGS)" && touch $$@
823823
else
824824
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4)):

branches/try2/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1545,7 +1545,7 @@ fn disassemble_extract(config: &Config, _props: &TestProps,
15451545
fn count_extracted_lines(p: &Path) -> uint {
15461546
let x = File::open(&p.with_extension("ll")).read_to_end().unwrap();
15471547
let x = str::from_utf8(x.as_slice()).unwrap();
1548-
x.lines().count()
1548+
x.lines().len()
15491549
}
15501550

15511551

branches/try2/src/doc/footer.inc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@ or the <a href="http://opensource.org/licenses/MIT">MIT license</a>, at your opt
55
</p><p>
66
This file may not be copied, modified, or distributed except according to those terms.
77
</p></footer>
8-
<script type="text/javascript" src="jquery.js"></script>
9-
<script type="text/javascript" src="playpen.js"></script>

branches/try2/src/doc/guide-macros.md

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

1313
~~~~
14-
# enum T { SpecialA(uint), SpecialB(uint) }
14+
# enum T { SpecialA(uint), SpecialB(uint) };
1515
# fn f() -> uint {
1616
# let input_1 = SpecialA(0);
1717
# let input_2 = SpecialA(0);
@@ -37,8 +37,7 @@ lightweight custom syntax extensions, themselves defined using the
3737
the pattern in the above code:
3838

3939
~~~~
40-
# #![feature(macro_rules)]
41-
# enum T { SpecialA(uint), SpecialB(uint) }
40+
# enum T { SpecialA(uint), SpecialB(uint) };
4241
# fn f() -> uint {
4342
# let input_1 = SpecialA(0);
4443
# let input_2 = SpecialA(0);
@@ -56,7 +55,6 @@ early_return!(input_1 SpecialA);
5655
early_return!(input_2 SpecialB);
5756
# return 0;
5857
# }
59-
# fn main() {}
6058
~~~~
6159

6260
Macros are defined in pattern-matching style: in the above example, the text
@@ -157,8 +155,7 @@ separator token (a comma-separated list could be written `$(...),*`), and `+`
157155
instead of `*` to mean "at least one".
158156

159157
~~~~
160-
# #![feature(macro_rules)]
161-
# enum T { SpecialA(uint),SpecialB(uint),SpecialC(uint),SpecialD(uint)}
158+
# enum T { SpecialA(uint),SpecialB(uint),SpecialC(uint),SpecialD(uint)};
162159
# fn f() -> uint {
163160
# let input_1 = SpecialA(0);
164161
# let input_2 = SpecialA(0);
@@ -178,7 +175,6 @@ early_return!(input_1, [SpecialA|SpecialC|SpecialD]);
178175
early_return!(input_2, [SpecialB]);
179176
# return 0;
180177
# }
181-
# fn main() {}
182178
~~~~
183179

184180
### Transcription
@@ -219,10 +215,9 @@ solves the problem.
219215
Now consider code like the following:
220216

221217
~~~~
222-
# #![feature(macro_rules)]
223-
# enum T1 { Good1(T2, uint), Bad1}
218+
# enum T1 { Good1(T2, uint), Bad1};
224219
# struct T2 { body: T3 }
225-
# enum T3 { Good2(uint), Bad2}
220+
# enum T3 { Good2(uint), Bad2};
226221
# fn f(x: T1) -> uint {
227222
match x {
228223
Good1(g1, val) => {
@@ -237,7 +232,6 @@ match x {
237232
_ => return 0 // default value
238233
}
239234
# }
240-
# fn main() {}
241235
~~~~
242236

243237
All the complicated stuff is deeply indented, and the error-handling code is
@@ -246,7 +240,6 @@ a match, but with a syntax that suits the problem better. The following macro
246240
can solve the problem:
247241

248242
~~~~
249-
# #![feature(macro_rules)]
250243
macro_rules! biased_match (
251244
// special case: `let (x) = ...` is illegal, so use `let x = ...` instead
252245
( ($e:expr) ~ ($p:pat) else $err:stmt ;
@@ -268,9 +261,9 @@ macro_rules! biased_match (
268261
)
269262
)
270263
271-
# enum T1 { Good1(T2, uint), Bad1}
264+
# enum T1 { Good1(T2, uint), Bad1};
272265
# struct T2 { body: T3 }
273-
# enum T3 { Good2(uint), Bad2}
266+
# enum T3 { Good2(uint), Bad2};
274267
# fn f(x: T1) -> uint {
275268
biased_match!((x) ~ (Good1(g1, val)) else { return 0 };
276269
binds g1, val )
@@ -280,16 +273,13 @@ biased_match!((g1.body) ~ (Good2(result) )
280273
// complicated stuff goes here
281274
return result + val;
282275
# }
283-
# fn main() {}
284276
~~~~
285277

286278
This solves the indentation problem. But if we have a lot of chained matches
287279
like this, we might prefer to write a single macro invocation. The input
288280
pattern we want is clear:
289281

290282
~~~~
291-
# #![feature(macro_rules)]
292-
# fn main() {}
293283
# macro_rules! b(
294284
( $( ($e:expr) ~ ($p:pat) else $err:stmt ; )*
295285
binds $( $bind_res:ident ),*
@@ -311,18 +301,14 @@ process the semicolon-terminated lines, one-by-one. So, we want the following
311301
input patterns:
312302

313303
~~~~
314-
# #![feature(macro_rules)]
315304
# macro_rules! b(
316305
( binds $( $bind_res:ident ),* )
317306
# => (0))
318-
# fn main() {}
319307
~~~~
320308

321309
...and:
322310

323311
~~~~
324-
# #![feature(macro_rules)]
325-
# fn main() {}
326312
# macro_rules! b(
327313
( ($e :expr) ~ ($p :pat) else $err :stmt ;
328314
$( ($e_rest:expr) ~ ($p_rest:pat) else $err_rest:stmt ; )*
@@ -336,8 +322,6 @@ The resulting macro looks like this. Note that the separation into
336322
piece of syntax (the `let`) which we only want to transcribe once.
337323

338324
~~~~
339-
# #![feature(macro_rules)]
340-
# fn main() {
341325
342326
macro_rules! biased_match_rec (
343327
// Handle the first layer
@@ -381,9 +365,9 @@ macro_rules! biased_match (
381365
)
382366
383367
384-
# enum T1 { Good1(T2, uint), Bad1}
368+
# enum T1 { Good1(T2, uint), Bad1};
385369
# struct T2 { body: T3 }
386-
# enum T3 { Good2(uint), Bad2}
370+
# enum T3 { Good2(uint), Bad2};
387371
# fn f(x: T1) -> uint {
388372
biased_match!(
389373
(x) ~ (Good1(g1, val)) else { return 0 };
@@ -392,7 +376,6 @@ biased_match!(
392376
// complicated stuff goes here
393377
return result + val;
394378
# }
395-
# }
396379
~~~~
397380

398381
This technique applies to many cases where transcribing a result all at once is not possible.

branches/try2/src/doc/guide-unsafe.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,6 @@ vectors provided from C, using idiomatic Rust practices.
523523

524524
```
525525
#![no_std]
526-
#![feature(globs)]
527526
528527
# extern crate libc;
529528
extern crate core;

branches/try2/src/doc/rust.css

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -313,19 +313,6 @@ table th {
313313
padding: 5px;
314314
}
315315

316-
/* Code snippets */
317-
318-
.rusttest { display: none; }
319-
pre.rust { position: relative; }
320-
pre.rust a { transform: scaleX(-1); }
321-
.test-arrow {
322-
display: inline-block;
323-
position: absolute;
324-
top: 0;
325-
right: 10px;
326-
font-size: 150%;
327-
}
328-
329316
@media (min-width: 1170px) {
330317
pre {
331318
font-size: 15px;

branches/try2/src/doc/rust.md

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,16 +1260,13 @@ a = Cat;
12601260
Enumeration constructors can have either named or unnamed fields:
12611261

12621262
~~~~
1263-
# #![feature(struct_variant)]
1264-
# fn main() {
12651263
enum Animal {
12661264
Dog (String, f64),
12671265
Cat { name: String, weight: f64 }
12681266
}
12691267
12701268
let mut a: Animal = Dog("Cocoa".to_string(), 37.2);
12711269
a = Cat { name: "Spotty".to_string(), weight: 2.7 };
1272-
# }
12731270
~~~~
12741271

12751272
In this example, `Cat` is a _struct-like enum variant_,
@@ -2527,10 +2524,10 @@ Note that for a given *unit-like* structure type, this will always be the same v
25272524

25282525
A structure expression can terminate with the syntax `..` followed by an expression to denote a functional update.
25292526
The expression following `..` (the base) must have the same structure type as the new structure type being formed.
2530-
The entire expression denotes the result of constructing a new structure
2527+
The entire expression denotes the result of allocating a new structure
25312528
(with the same type as the base expression)
25322529
with the given values for the fields that were explicitly specified
2533-
and the values in the base expression for all other fields.
2530+
and the values in the base record for all other fields.
25342531

25352532
~~~~
25362533
# struct Point3d { x: int, y: int, z: int }
@@ -2578,15 +2575,15 @@ when not immediately followed by a parenthesized expression-list (the latter is
25782575
A field expression denotes a field of a [structure](#structure-types).
25792576

25802577
~~~~ {.ignore .field}
2581-
mystruct.myfield;
2578+
myrecord.myfield;
25822579
foo().x;
25832580
(Struct {a: 10, b: 20}).a;
25842581
~~~~
25852582

2586-
A field access is an [lvalue](#lvalues-rvalues-and-temporaries) referring to the value of that field.
2587-
When the type providing the field inherits mutabilty, it can be [assigned](#assignment-expressions) to.
2583+
A field access on a record is an [lvalue](#lvalues-rvalues-and-temporaries) referring to the value of that field.
2584+
When the field is mutable, it can be [assigned](#assignment-expressions) to.
25882585

2589-
Also, if the type of the expression to the left of the dot is a pointer,
2586+
When the type of the expression to the left of the dot is a pointer to a record or structure,
25902587
it is automatically dereferenced to make the field access possible.
25912588

25922589
### Vector expressions
@@ -3041,7 +3038,7 @@ match_pat : pat [ '|' pat ] * [ "if" expr ] ? ;
30413038

30423039
A `match` expression branches on a *pattern*. The exact form of matching that
30433040
occurs depends on the pattern. Patterns consist of some combination of
3044-
literals, destructured vectors or enum constructors, structures and
3041+
literals, destructured vectors or enum constructors, structures, records and
30453042
tuples, variable binding specifications, wildcards (`..`), and placeholders
30463043
(`_`). A `match` expression has a *head expression*, which is the value to
30473044
compare to the patterns. The type of the patterns must equal the type of the
@@ -3318,16 +3315,17 @@ such as `&str` or `String`.
33183315

33193316
### Tuple types
33203317

3321-
A tuple *type* is a heterogeneous product of other types, called the *elements*
3322-
of the tuple. It has no nominal name and is instead structurally typed.
3318+
The tuple type-constructor forms a new heterogeneous product of values similar
3319+
to the record type-constructor. The differences are as follows:
3320+
3321+
* tuple elements cannot be mutable, unlike record fields
3322+
* tuple elements are not named and can be accessed only by pattern-matching
33233323

33243324
Tuple types and values are denoted by listing the types or values of their
33253325
elements, respectively, in a parenthesized, comma-separated
33263326
list.
33273327

3328-
Because tuple elements don't have a name, they can only be accessed by pattern-matching.
3329-
3330-
The members of a tuple are laid out in memory contiguously, in
3328+
The members of a tuple are laid out in memory contiguously, like a record, in
33313329
order specified by the tuple type.
33323330

33333331
An example of a tuple type and its use:
@@ -3379,13 +3377,12 @@ of the type.[^structtype]
33793377

33803378
New instances of a `struct` can be constructed with a [struct expression](#structure-expressions).
33813379

3382-
The memory layout of a `struct` is undefined by default to allow for compiler optimziations like
3383-
field reordering, but it can be fixed with the `#[repr(...)]` attribute.
3384-
In either case, fields may be given in any order in a corresponding struct *expression*;
3385-
the resulting `struct` value will always have the same memory layout.
3380+
The memory order of fields in a `struct` is given by the item defining it.
3381+
Fields may be given in any order in a corresponding struct *expression*;
3382+
the resulting `struct` value will always be laid out in memory in the order specified by the corresponding *item*.
33863383

33873384
The fields of a `struct` may be qualified by [visibility modifiers](#re-exporting-and-visibility),
3388-
to allow access to data in a structure outside a module.
3385+
to restrict access to implementation-private data in a structure.
33893386

33903387
A _tuple struct_ type is just like a structure type, except that the fields are anonymous.
33913388

@@ -3936,7 +3933,7 @@ The runtime provides C and Rust code to assist with various built-in types,
39363933
such as vectors, strings, and the low level communication system (ports,
39373934
channels, tasks).
39383935

3939-
Support for other built-in types such as simple types, tuples and
3936+
Support for other built-in types such as simple types, tuples, records, and
39403937
enums is open-coded by the Rust compiler.
39413938

39423939
### Task scheduling and communication

branches/try2/src/doc/tutorial.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,6 @@ fn point_from_direction(dir: Direction) -> Point {
774774
Enum variants may also be structs. For example:
775775

776776
~~~~
777-
# #![feature(struct_variant)]
778777
use std::f64;
779778
# struct Point { x: f64, y: f64 }
780779
# fn square(x: f64) -> f64 { x * x }
@@ -790,7 +789,6 @@ fn area(sh: Shape) -> f64 {
790789
}
791790
}
792791
}
793-
# fn main() {}
794792
~~~~
795793

796794
> *Note:* This feature of the compiler is currently gated behind the
@@ -3048,7 +3046,6 @@ use farm::{chicken, cow};
30483046
2. Import everything in a module with a wildcard:
30493047

30503048
~~~
3051-
# #![feature(globs)]
30523049
use farm::*;
30533050
# mod farm {
30543051
# pub fn cow() { println!("Bat-chicken? What a stupid name!") }

0 commit comments

Comments
 (0)