Skip to content

Commit 7b560e6

Browse files
committed
---
yaml --- r: 173214 b: refs/heads/snap-stage3 c: 4d17fba h: refs/heads/master v: v3
1 parent d8c52f3 commit 7b560e6

File tree

117 files changed

+655
-1171
lines changed

Some content is hidden

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

117 files changed

+655
-1171
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 896cb36ecab3eaeb7f101087e030e43771eca5ca
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 15a41380c14e94052332360b104ec1651f97297b
4+
refs/heads/snap-stage3: 4d17fbaf37a0641894317f016244943af66ce87b
55
refs/heads/try: 957472483d3a2f43c0e4f7c2056280a1022af93c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/mk/docs.mk

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ DOCS := index intro tutorial complement-bugreport \
2929
complement-lang-faq complement-design-faq complement-project-faq \
3030
rustdoc reference
3131

32-
# Legacy guides, preserved for a while to reduce the number of 404s
33-
DOCS += guide-crates guide-error-handling guide-ffi guide-macros guide \
34-
guide-ownership guide-plugins guide-pointers guide-strings guide-tasks \
35-
guide-testing
36-
37-
3832
PDF_DOCS := reference
3933

4034
RUSTDOC_DEPS_reference := doc/full-toc.inc
@@ -283,6 +277,6 @@ compiler-docs: $(COMPILER_DOC_TARGETS)
283277

284278
trpl: doc/book/index.html
285279

286-
doc/book/index.html: $(RUSTBOOK_EXE) $(wildcard $(S)/src/doc/trpl/*.md) | doc/
280+
doc/book/index.html: $(RUSTBOOK_EXE) $(wildcard $(S)/src/doc/trpl/*.md)
287281
$(Q)rm -rf doc/book
288282
$(Q)$(RUSTBOOK) build $(S)src/doc/trpl doc/book

branches/snap-stage3/src/compiletest/header.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ pub struct TestProps {
4242
pub pretty_compare_only: bool,
4343
// Patterns which must not appear in the output of a cfail test.
4444
pub forbid_output: Vec<String>,
45+
// Ignore errors which originate from a command line span
46+
pub ignore_command_line: bool,
4547
}
4648

4749
// Load any test directives embedded in the file
@@ -60,6 +62,8 @@ pub fn load_props(testfile: &Path) -> TestProps {
6062
let mut pretty_mode = None;
6163
let mut pretty_compare_only = false;
6264
let mut forbid_output = Vec::new();
65+
let mut ignore_command_line = false;
66+
6367
iter_header(testfile, |ln| {
6468
match parse_error_pattern(ln) {
6569
Some(ep) => error_patterns.push(ep),
@@ -102,6 +106,10 @@ pub fn load_props(testfile: &Path) -> TestProps {
102106
pretty_compare_only = parse_pretty_compare_only(ln);
103107
}
104108

109+
if !ignore_command_line {
110+
ignore_command_line = parse_ignore_command_line(ln);
111+
}
112+
105113
match parse_aux_build(ln) {
106114
Some(ab) => { aux_builds.push(ab); }
107115
None => {}
@@ -140,6 +148,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
140148
pretty_mode: pretty_mode.unwrap_or("normal".to_string()),
141149
pretty_compare_only: pretty_compare_only,
142150
forbid_output: forbid_output,
151+
ignore_command_line: ignore_command_line,
143152
}
144153
}
145154

@@ -291,6 +300,10 @@ fn parse_pretty_compare_only(line: &str) -> bool {
291300
parse_name_directive(line, "pretty-compare-only")
292301
}
293302

303+
fn parse_ignore_command_line(line: &str) -> bool {
304+
parse_name_directive(line, "ignore-command-line")
305+
}
306+
294307
fn parse_exec_env(line: &str) -> Option<(String, String)> {
295308
parse_name_value_directive(line, "exec-env").map(|nv| {
296309
// nv is either FOO or FOO=BAR

branches/snap-stage3/src/compiletest/runtest.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ fn run_cfail_test(config: &Config, props: &TestProps, testfile: &Path) {
104104
if !props.error_patterns.is_empty() {
105105
fatal("both error pattern and expected errors specified");
106106
}
107-
check_expected_errors(expected_errors, testfile, &proc_res);
107+
check_expected_errors(props, expected_errors, testfile, &proc_res);
108108
} else {
109109
check_error_patterns(props, testfile, output_to_check.as_slice(), &proc_res);
110110
}
@@ -941,7 +941,8 @@ fn check_forbid_output(props: &TestProps,
941941
}
942942
}
943943

944-
fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
944+
fn check_expected_errors(props: &TestProps,
945+
expected_errors: Vec<errors::ExpectedError> ,
945946
testfile: &Path,
946947
proc_res: &ProcRes) {
947948

@@ -996,6 +997,11 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
996997
was_expected = true;
997998
}
998999

1000+
if line.starts_with("<command line option>") &&
1001+
props.ignore_command_line {
1002+
was_expected = true;
1003+
}
1004+
9991005
if !was_expected && is_compiler_error_or_warning(line) {
10001006
fatal_proc_rec(format!("unexpected compiler error or warning: '{}'",
10011007
line).as_slice(),

branches/snap-stage3/src/doc/guide-crates.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

branches/snap-stage3/src/doc/guide-error-handling.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

branches/snap-stage3/src/doc/guide-ffi.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

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

Lines changed: 0 additions & 4 deletions
This file was deleted.

branches/snap-stage3/src/doc/guide-ownership.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

branches/snap-stage3/src/doc/guide-plugins.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

branches/snap-stage3/src/doc/guide-pointers.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

branches/snap-stage3/src/doc/guide-strings.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

branches/snap-stage3/src/doc/guide-tasks.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

branches/snap-stage3/src/doc/guide-testing.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

branches/snap-stage3/src/doc/guide-unsafe.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

branches/snap-stage3/src/doc/guide.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

branches/snap-stage3/src/doc/intro.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ use semver::Version;
106106
107107
fn main() {
108108
assert!(Version::parse("1.2.3") == Ok(Version {
109-
major: 1u64,
110-
minor: 2u64,
111-
patch: 3u64,
109+
major: 1u,
110+
minor: 2u,
111+
patch: 3u,
112112
pre: vec!(),
113113
build: vec!(),
114114
}));

branches/snap-stage3/src/doc/reference.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ mod b {
603603
```
604604

605605
* Paths starting with the keyword `super` begin resolution relative to the
606-
parent module. Each further identifier must resolve to an item.
606+
parent module. Each further identifier must resolve to an item
607607

608608
```rust
609609
mod a {
@@ -985,7 +985,7 @@ top of [modules](#modules) and [blocks](#blocks).
985985
986986
Use declarations support a number of convenient shortcuts:
987987

988-
* Rebinding the target name as a new local name, using the syntax `use p::q::r as x;`
988+
* Rebinding the target name as a new local name, using the syntax `use p::q::r as x;`.
989989
* Simultaneously binding a list of paths differing only in their final element,
990990
using the glob-like brace syntax `use a::b::{c,d,e,f};`
991991
* Binding all paths matching a given prefix, using the asterisk wildcard syntax
@@ -1091,7 +1091,7 @@ set of *input* [*slots*](#memory-slots) as parameters, through which the caller
10911091
passes arguments into the function, and an *output* [*slot*](#memory-slots)
10921092
through which the function passes results back to the caller.
10931093

1094-
A function may also be copied into a first-class *value*, in which case the
1094+
A function may also be copied into a first class *value*, in which case the
10951095
value has the corresponding [*function type*](#function-types), and can be used
10961096
otherwise exactly as a function item (with a minor additional cost of calling
10971097
the function indirectly).
@@ -1224,7 +1224,7 @@ the guarantee that these issues are never caused by safe code.
12241224
* A value other than `false` (0) or `true` (1) in a `bool`
12251225
* A discriminant in an `enum` not included in the type definition
12261226
* A value in a `char` which is a surrogate or above `char::MAX`
1227-
* Non-UTF-8 byte sequences in a `str`
1227+
* non-UTF-8 byte sequences in a `str`
12281228
* Unwinding into Rust from foreign code or unwinding from Rust into foreign
12291229
code. Rust's failure system is not compatible with exception handling in
12301230
other languages. Unwinding must be caught and handled at FFI boundaries.
@@ -1827,7 +1827,7 @@ accesses in two cases:
18271827

18281828
These two cases are surprisingly powerful for creating module hierarchies
18291829
exposing public APIs while hiding internal implementation details. To help
1830-
explain, here's a few use cases and what they would entail:
1830+
explain, here's a few use cases and what they would entail.
18311831

18321832
* A library developer needs to expose functionality to crates which link
18331833
against their library. As a consequence of the first case, this means that
@@ -1858,7 +1858,7 @@ import/expression is only valid if the destination is in the current visibility
18581858
scope.
18591859

18601860
Here's an example of a program which exemplifies the three cases outlined
1861-
above:
1861+
above.
18621862

18631863
```
18641864
// This module is private, meaning that no external crate can access this
@@ -2213,7 +2213,7 @@ mod m1 {
22132213
```
22142214

22152215
This example shows how one can use `allow` and `warn` to toggle a particular
2216-
check on and off:
2216+
check on and off.
22172217

22182218
```{.ignore}
22192219
#[warn(missing_docs)]
@@ -2235,7 +2235,7 @@ mod m2{
22352235
```
22362236

22372237
This example shows how one can use `forbid` to disallow uses of `allow` for
2238-
that lint check:
2238+
that lint check.
22392239

22402240
```{.ignore}
22412241
#[forbid(missing_docs)]
@@ -2318,9 +2318,9 @@ These language items are traits:
23182318
* `ord`
23192319
: Elements have a partial ordering.
23202320
* `deref`
2321-
: `*` can be applied, yielding a reference to another type.
2321+
: `*` can be applied, yielding a reference to another type
23222322
* `deref_mut`
2323-
: `*` can be applied, yielding a mutable reference to another type.
2323+
: `*` can be applied, yielding a mutable reference to another type
23242324

23252325
These are functions:
23262326

@@ -2341,7 +2341,7 @@ These are functions:
23412341
* `type_id`
23422342
: The type returned by the `type_id` intrinsic.
23432343
* `unsafe`
2344-
: A type whose contents can be mutated through an immutable reference.
2344+
: A type whose contents can be mutated through an immutable reference
23452345

23462346
#### Marker types
23472347

@@ -2350,11 +2350,11 @@ These types help drive the compiler's analysis
23502350
* `begin_unwind`
23512351
: ___Needs filling in___
23522352
* `no_copy_bound`
2353-
: This type does not implement "copy", even if eligible.
2353+
: This type does not implement "copy", even if eligible
23542354
* `no_send_bound`
2355-
: This type does not implement "send", even if eligible.
2355+
: This type does not implement "send", even if eligible
23562356
* `no_sync_bound`
2357-
: This type does not implement "sync", even if eligible.
2357+
: This type does not implement "sync", even if eligible
23582358
* `eh_personality`
23592359
: ___Needs filling in___
23602360
* `exchange_free`
@@ -2376,11 +2376,11 @@ These types help drive the compiler's analysis
23762376
* `iterator`
23772377
: ___Needs filling in___
23782378
* `contravariant_lifetime`
2379-
: The lifetime parameter should be considered contravariant.
2379+
: The lifetime parameter should be considered contravariant
23802380
* `covariant_lifetime`
2381-
: The lifetime parameter should be considered covariant.
2381+
: The lifetime parameter should be considered covariant
23822382
* `invariant_lifetime`
2383-
: The lifetime parameter should be considered invariant.
2383+
: The lifetime parameter should be considered invariant
23842384
* `malloc`
23852385
: Allocate memory on the managed heap.
23862386
* `owned_box`
@@ -2390,11 +2390,11 @@ These types help drive the compiler's analysis
23902390
* `start`
23912391
: ___Needs filling in___
23922392
* `contravariant_type`
2393-
: The type parameter should be considered contravariant.
2393+
: The type parameter should be considered contravariant
23942394
* `covariant_type`
2395-
: The type parameter should be considered covariant.
2395+
: The type parameter should be considered covariant
23962396
* `invariant_type`
2397-
: The type parameter should be considered invariant.
2397+
: The type parameter should be considered invariant
23982398
* `ty_desc`
23992399
: ___Needs filling in___
24002400

@@ -2921,13 +2921,13 @@ automatically dereferenced to make the field access possible.
29212921
```{.ebnf .gram}
29222922
array_expr : '[' "mut" ? vec_elems? ']' ;
29232923
2924-
array_elems : [expr [',' expr]*] | [expr ';' expr] ;
2924+
array_elems : [expr [',' expr]*] | [expr ',' ".." expr] ;
29252925
```
29262926

29272927
An [array](#array,-and-slice-types) _expression_ is written by enclosing zero
29282928
or more comma-separated expressions of uniform type in square brackets.
29292929

2930-
In the `[expr ';' expr]` form, the expression after the `';'` must be a
2930+
In the `[expr ',' ".." expr]` form, the expression after the `".."` must be a
29312931
constant expression that can be evaluated at compile time, such as a
29322932
[literal](#literals) or a [static item](#static-items).
29332933

@@ -3219,11 +3219,11 @@ the simplest and least-expensive form (analogous to a ```|| { }``` expression),
32193219
the lambda expression captures its environment by reference, effectively
32203220
borrowing pointers to all outer variables mentioned inside the function.
32213221
Alternately, the compiler may infer that a lambda expression should copy or
3222-
move values (depending on their type) from the environment into the lambda
3222+
move values (depending on their type.) from the environment into the lambda
32233223
expression's captured environment.
32243224

32253225
In this example, we define a function `ten_times` that takes a higher-order
3226-
function argument, and call it with a lambda expression as an argument:
3226+
function argument, and call it with a lambda expression as an argument.
32273227

32283228
```
32293229
fn ten_times<F>(f: F) where F: Fn(int) {
@@ -3661,14 +3661,14 @@ within an object along with one byte past the end.
36613661
The types `char` and `str` hold textual data.
36623662

36633663
A value of type `char` is a [Unicode scalar value](
3664-
http://www.unicode.org/glossary/#unicode_scalar_value) (i.e. a code point that
3664+
http://www.unicode.org/glossary/#unicode_scalar_value) (ie. a code point that
36653665
is not a surrogate), represented as a 32-bit unsigned word in the 0x0000 to
36663666
0xD7FF or 0xE000 to 0x10FFFF range. A `[char]` array is effectively an UCS-4 /
36673667
UTF-32 string.
36683668

36693669
A value of type `str` is a Unicode string, represented as an array of 8-bit
36703670
unsigned bytes holding a sequence of UTF-8 codepoints. Since `str` is of
3671-
unknown size, it is not a _first-class_ type, but can only be instantiated
3671+
unknown size, it is not a _first class_ type, but can only be instantiated
36723672
through a pointer type, such as `&str` or `String`.
36733673

36743674
### Tuple types
@@ -3698,7 +3698,7 @@ assert!(b != "world");
36983698

36993699
Rust has two different types for a list of items:
37003700

3701-
* `[T; N]`, an 'array'.
3701+
* `[T ..N]`, an 'array'
37023702
* `&[T]`, a 'slice'.
37033703

37043704
An array has a fixed size, and can be allocated on either the stack or the
@@ -3710,9 +3710,9 @@ to, it borrows it.
37103710
An example of each kind:
37113711

37123712
```{rust}
3713-
let vec: Vec<i32> = vec![1, 2, 3];
3714-
let arr: [i32; 3] = [1, 2, 3];
3715-
let s: &[i32] = vec.as_slice();
3713+
let vec: Vec<int> = vec![1, 2, 3];
3714+
let arr: [int; 3] = [1, 2, 3];
3715+
let s: &[int] = vec.as_slice();
37163716
```
37173717

37183718
As you can see, the `vec!` macro allows you to create a `Vec<T>` easily. The
@@ -3798,7 +3798,7 @@ enum List<T> {
37983798
Cons(T, Box<List<T>>)
37993799
}
38003800
3801-
let a: List<i32> = List::Cons(7, Box::new(List::Cons(13, Box::new(List::Nil))));
3801+
let a: List<int> = List::Cons(7, Box::new(List::Cons(13, Box::new(List::Nil))));
38023802
```
38033803

38043804
### Pointer types

0 commit comments

Comments
 (0)