Skip to content

Commit 9db5264

Browse files
committed
---
yaml --- r: 212343 b: refs/heads/master c: 2442f83 h: refs/heads/master i: 212341: 09a9835 212339: 9654494 212335: 32a8e8e v: v3
1 parent f0f4cdb commit 9db5264

File tree

135 files changed

+858
-1672
lines changed

Some content is hidden

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

135 files changed

+858
-1672
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: 02c33b690b9270ef7d26412fdf4a8498acfea1a7
2+
refs/heads/master: 2442f830cbe6317a9376a04ea4486923e32e4dd4
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
55
refs/heads/try: 1864973ae17213c5a58c4dd3f9af6d1b6c7d2e05

trunk/AUTHORS.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ Hajime Morrita <[email protected]>
338338
Hanno Braun <[email protected]>
339339
Harry Marr <[email protected]>
340340
341-
Heejong Ahn <[email protected]>
341+
Heejong Ahn <[email protected]
342342
Henrik Schopmans <[email protected]>
343343
Herman J. Radtke III <[email protected]>
344344
HeroesGrave <[email protected]>

trunk/configure

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,12 +1307,6 @@ CFG_LLVM_SRC_DIR=${CFG_SRC_DIR}src/llvm/
13071307
for t in $CFG_HOST
13081308
do
13091309
do_reconfigure=1
1310-
is_msvc=0
1311-
case "$t" in
1312-
(*-msvc)
1313-
is_msvc=1
1314-
;;
1315-
esac
13161310

13171311
if [ -z $CFG_LLVM_ROOT ]
13181312
then
@@ -1332,13 +1326,7 @@ do
13321326
LLVM_ASSERTION_OPTS="--disable-assertions"
13331327
else
13341328
LLVM_ASSERTION_OPTS="--enable-assertions"
1335-
1336-
# Apparently even if we request assertions be enabled for MSVC,
1337-
# LLVM's CMake build system ignore this and outputs in `Release`
1338-
# anyway.
1339-
if [ ${is_msvc} -eq 0 ]; then
1340-
LLVM_INST_DIR=${LLVM_INST_DIR}+Asserts
1341-
fi
1329+
LLVM_INST_DIR=${LLVM_INST_DIR}+Asserts
13421330
fi
13431331
else
13441332
msg "not reconfiguring LLVM, external LLVM root"
@@ -1368,7 +1356,14 @@ do
13681356
done
13691357
fi
13701358

1371-
if [ ${do_reconfigure} -ne 0 ] && [ ${is_msvc} -ne 0 ]
1359+
use_cmake=0
1360+
case "$t" in
1361+
(*-msvc)
1362+
use_cmake=1
1363+
;;
1364+
esac
1365+
1366+
if [ ${do_reconfigure} -ne 0 ] && [ ${use_cmake} -ne 0 ]
13721367
then
13731368
msg "configuring LLVM for $t with cmake"
13741369

@@ -1393,7 +1388,7 @@ do
13931388
need_ok "LLVM cmake configure failed"
13941389
fi
13951390

1396-
if [ ${do_reconfigure} -ne 0 ] && [ ${is_msvc} -eq 0 ]
1391+
if [ ${do_reconfigure} -ne 0 ] && [ ${use_cmake} -eq 0 ]
13971392
then
13981393
# LLVM's configure doesn't recognize the new Windows triples yet
13991394
gnu_t=$(to_gnu_triple $t)

trunk/src/compiletest/runtest.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ use std::fmt;
2424
use std::fs::{self, File};
2525
use std::io::BufReader;
2626
use std::io::prelude::*;
27+
use std::iter::repeat;
2728
use std::net::TcpStream;
2829
use std::path::{Path, PathBuf};
2930
use std::process::{Command, Output, ExitStatus};
@@ -651,7 +652,7 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
651652

652653
// Write debugger script:
653654
// We don't want to hang when calling `quit` while the process is still running
654-
let mut script_str = String::from("settings set auto-confirm true\n");
655+
let mut script_str = String::from_str("settings set auto-confirm true\n");
655656

656657
// Make LLDB emit its version, so we have it documented in the test output
657658
script_str.push_str("version\n");
@@ -927,12 +928,12 @@ fn check_forbid_output(props: &TestProps,
927928
}
928929
}
929930

930-
fn check_expected_errors(expected_errors: Vec<errors::ExpectedError>,
931+
fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
931932
testfile: &Path,
932933
proc_res: &ProcRes) {
933934

934935
// true if we found the error in question
935-
let mut found_flags = vec![false; expected_errors.len()];
936+
let mut found_flags: Vec<_> = repeat(false).take(expected_errors.len()).collect();
936937

937938
if proc_res.status.success() {
938939
fatal("process did not return an error status");
@@ -953,10 +954,14 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError>,
953954
}
954955
}
955956

956-
// A multi-line error will have followup lines which start with a space
957-
// or open paren.
957+
// A multi-line error will have followup lines which will always
958+
// start with one of these strings.
958959
fn continuation( line: &str) -> bool {
959-
line.starts_with(" ") || line.starts_with("(")
960+
line.starts_with(" expected") ||
961+
line.starts_with(" found") ||
962+
// 1234
963+
// Should have 4 spaces: see issue 18946
964+
line.starts_with("(")
960965
}
961966

962967
// Scan and extract our error/warning messages,

trunk/src/doc/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ series of small examples.
2525
If you need help with something, or just want to talk about Rust with others,
2626
there are a few places you can do that:
2727

28-
The Rust IRC channels on [irc.mozilla.org](irc://irc.mozilla.org/) are the
28+
The Rust IRC channels on [irc.mozilla.org](http://irc.mozilla.org/) are the
2929
fastest way to get help.
3030
[`#rust`](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust) is
3131
the general discussion channel, and you'll find people willing to help you with
@@ -40,15 +40,15 @@ There's also
4040
[`#rust-internals`](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-internals), which is for discussion of the development of Rust itself.
4141

4242
You can also get help on [Stack
43-
Overflow](https://stackoverflow.com/questions/tagged/rust). Searching for your
43+
Overflow](http://stackoverflow.com/questions/tagged/rust). Searching for your
4444
problem might reveal someone who has asked it before!
4545

46-
There is an active [subreddit](https://reddit.com/r/rust) with lots of
46+
There is an active [subreddit](http://reddit.com/r/rust) with lots of
4747
discussion and news about Rust.
4848

49-
There is also a [user forum](https://users.rust-lang.org), for all
50-
user-oriented discussion, and a [developer
51-
forum](https://internals.rust-lang.org/), where the development of Rust
49+
There is also a [user forum](http://users.rust-lang.org), for all
50+
user-oriented discussion, and a [developer
51+
forum](http://internals.rust-lang.org/), where the development of Rust
5252
itself is discussed.
5353

5454
# Specification
@@ -61,7 +61,7 @@ the language in as much detail as possible is in [the reference](reference.html)
6161
Rust is still a young language, so there isn't a ton of tooling yet, but the
6262
tools we have are really nice.
6363

64-
[Cargo](https://crates.io) is Rust's package manager, and its website contains
64+
[Cargo](http://crates.io) is Rust's package manager, and its website contains
6565
lots of good documentation.
6666

6767
[`rustdoc`](book/documentation.html) is used to generate documentation for Rust code.

trunk/src/doc/reference.md

Lines changed: 0 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -3599,147 +3599,6 @@ The notation `&self` is a shorthand for `self: &Self`. In this case,
35993599
in the impl, `Self` refers to the value of type `String` that is the
36003600
receiver for a call to the method `make_string`.
36013601

3602-
## Subtyping
3603-
3604-
Subtyping is implicit and can occur at any stage in type checking or
3605-
inference. Subtyping in Rust is very restricted and occurs only due to
3606-
variance with respect to lifetimes and between types with higher ranked
3607-
lifetimes. If we were to erase lifetimes from types, then the only subtyping
3608-
would be due to type equality.
3609-
3610-
Consider the following example: string literals always have `'static`
3611-
lifetime. Nevertheless, we can assign `s` to `t`:
3612-
3613-
```
3614-
fn bar<'a>() {
3615-
let s: &'static str = "hi";
3616-
let t: &'a str = s;
3617-
}
3618-
```
3619-
Since `'static` "lives longer" than `'a`, `&'static str` is a subtype of
3620-
`&'a str`.
3621-
3622-
## Type coercions
3623-
3624-
Coercions are defined in [RFC401]. A coercion is implicit and has no syntax.
3625-
3626-
[RFC401]: https://github.com/rust-lang/rfcs/blob/master/text/0401-coercions.md
3627-
3628-
### Coercion sites
3629-
3630-
A coercion can only occur at certain coercion sites in a program; these are
3631-
typically places where the desired type is explicit or can be dervied by
3632-
propagation from explicit types (without type inference). Possible coercion
3633-
sites are:
3634-
3635-
* `let` statements where an explicit type is given.
3636-
3637-
In `let _: U = e;`, `e` is coerced to have type `U`.
3638-
3639-
* `static` and `const` statements (similar to `let` statements).
3640-
3641-
* arguments for function calls.
3642-
3643-
The value being coerced is the
3644-
actual parameter and it is coerced to the type of the formal parameter. For
3645-
example, let `foo` be defined as `fn foo(x: U) { ... }` and call it as
3646-
`foo(e);`. Then `e` is coerced to have type `U`;
3647-
3648-
* instantiations of struct or variant fields.
3649-
3650-
Assume we have a `struct
3651-
Foo { x: U }` and instantiate it as `Foo { x: e }`. Then `e` is coerced to
3652-
have type `U`.
3653-
3654-
* function results (either the final line of a block if it is not semicolon
3655-
terminated or any expression in a `return` statement).
3656-
3657-
In `fn foo() -> U { e }`, `e` is coerced to to have type `U`.
3658-
3659-
If the expression in one of these coercion sites is a coercion-propagating
3660-
expression, then the relevant sub-expressions in that expression are also
3661-
coercion sites. Propagation recurses from these new coercion sites.
3662-
Propagating expressions and their relevant sub-expressions are:
3663-
3664-
* array literals, where the array has type `[U; n]`. Each sub-expression in
3665-
the array literal is a coercion site for coercion to type `U`.
3666-
3667-
* array literals with repeating syntax, where the array has type `[U; n]`. The
3668-
repeated sub-expression is a coercion site for coercion to type `U`.
3669-
3670-
* tuples, where a tuple is a coercion site to type `(U_0, U_1, ..., U_n)`.
3671-
Each sub-expression is a coercion site to the respective type, e.g. the
3672-
zeroth sub-expression is a coercion site to type `U_0`.
3673-
3674-
* parenthesised sub-expressions (`(e)`). If the expression has type `U`, then
3675-
the sub-expression is a coercion site to `U`.
3676-
3677-
* blocks. If a block has type `U`, then the last expression in the block (if
3678-
it is not semicolon-terminated) is a coercion site to `U`. This includes
3679-
blocks which are part of control flow statements, such as `if`/`else`, if
3680-
the block has a known type.
3681-
3682-
### Coercion types
3683-
3684-
Coercion is allowed between the following types:
3685-
3686-
* `T` to `U` if `T` is a subtype of `U` (*reflexive case*).
3687-
3688-
* `T_1` to `T_3` where `T_1` coerces to `T_2` and `T_2` coerces to `T_3`
3689-
(*transitive case*).
3690-
3691-
Note that this is not fully supported yet
3692-
3693-
* `&mut T` to `&T`.
3694-
3695-
* `*mut T` to `*const T`.
3696-
3697-
* `&T` to `*const T`.
3698-
3699-
* `&mut T` to `*mut T`.
3700-
3701-
* `&T` to `&U` if `T` implements `Deref<Target = U>`. For example:
3702-
3703-
```rust
3704-
use std::ops::Deref;
3705-
3706-
struct CharContainer {
3707-
value: char
3708-
}
3709-
3710-
impl Deref for CharContainer {
3711-
type Target = char;
3712-
3713-
fn deref<'a>(&'a self) -> &'a char {
3714-
&self.value
3715-
}
3716-
}
3717-
3718-
fn foo(arg: &char) {}
3719-
3720-
fn main() {
3721-
let x = &mut CharContainer { value: 'y' };
3722-
foo(x); //&mut CharContainer is coerced to &char.
3723-
}
3724-
```
3725-
* `&mut T` to `&mut U` if `T` implements `DerefMut<Target = U>`.
3726-
3727-
* TyCtor(`T`) to TyCtor(coerce_inner(`T`)), where TyCtor(`T`) is one of
3728-
- `&T`
3729-
- `&mut T`
3730-
- `*const T`
3731-
- `*mut T`
3732-
- `Box<T>`
3733-
3734-
and where
3735-
- coerce_inner(`[T, ..n]`) = `[T]`
3736-
- coerce_inner(`T`) = `U` where `T` is a concrete type which implements the
3737-
trait `U`.
3738-
3739-
In the future, coerce_inner will be recursively extended to tuples and
3740-
structs. In addition, coercions from sub-traits to super-traits will be
3741-
added. See [RFC401] for more details.
3742-
37433602
# Special traits
37443603

37453604
Several traits define special evaluation behavior.

trunk/src/doc/trpl/for-loops.md

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -41,45 +41,3 @@ so our loop will print `0` through `9`, not `10`.
4141
Rust does not have the “C-style” `for` loop on purpose. Manually controlling
4242
each element of the loop is complicated and error prone, even for experienced C
4343
developers.
44-
45-
# Enumerate
46-
47-
When you need to keep track of how many times you already looped, you can use the `.enumerate()` function.
48-
49-
## On ranges:
50-
51-
```rust
52-
for (i,j) in (5..10).enumerate() {
53-
println!("i = {} and j = {}", i, j);
54-
}
55-
```
56-
57-
Outputs:
58-
59-
```text
60-
i = 0 and j = 5
61-
i = 1 and j = 6
62-
i = 2 and j = 7
63-
i = 3 and j = 8
64-
i = 4 and j = 9
65-
```
66-
67-
Don't forget to add the parentheses around the range.
68-
69-
## On iterators:
70-
71-
```rust
72-
# let lines = "hello\nworld".lines();
73-
for (linenumber, line) in lines.enumerate() {
74-
println!("{}: {}", linenumber, line);
75-
}
76-
```
77-
78-
Outputs:
79-
80-
```text
81-
0: Content of line one
82-
1: Content of line two
83-
2: Content of line tree
84-
3: Content of line four
85-
```

0 commit comments

Comments
 (0)