Skip to content

Commit 54fa17f

Browse files
committed
---
yaml --- r: 273487 b: refs/heads/beta c: 7f2612e h: refs/heads/master i: 273485: 8c9a652 273483: 574ba2d 273479: 657cd3b 273471: 9f6f705
1 parent f0f2845 commit 54fa17f

File tree

205 files changed

+6452
-1439
lines changed

Some content is hidden

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

205 files changed

+6452
-1439
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 7d626e9f55f0503a5e0324a4172f80d3281d6ae0
26+
refs/heads/beta: 7f2612e66ce8dd77329fa0983a3a01bcac129368
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ build.
7777
7878
Download [MinGW from
7979
here](http://mingw-w64.org/doku.php/download/mingw-builds), and choose the
80-
`threads=win32,exceptions=dwarf/seh` flavor when installing. Also, make sure to install to a path without spaces in it. After installing,
80+
`version=4.9.x,threads=win32,exceptions=dwarf/seh` flavor when installing. Also, make sure to install to a path without spaces in it. After installing,
8181
add its `bin` directory to your `PATH`. This is due to [#28260](https://github.com/rust-lang/rust/issues/28260), in the future,
8282
installing from pacman should be just fine.
8383

branches/beta/RELEASES.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ Compatibility Notes
116116
that were not intended. In this release, [defaulted type parameters
117117
appearing outside of type definitions will generate a
118118
warning][1.7d], which will become an error in future releases.
119-
* [Parsing "." as a float results in an error instead of
120-
0][1.7p]. That is, `".".parse::<f32>()` returns `Err`, not `Ok(0)`.
119+
* [Parsing "." as a float results in an error instead of 0][1.7p].
120+
That is, `".".parse::<f32>()` returns `Err`, not `Ok(0.0)`.
121121
* [Borrows of closure parameters may not outlive the closure][1.7bc].
122122

123123
[1.7a]: https://github.com/rust-lang/rust/pull/30928

branches/beta/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ then
10341034
if [ -n "$CFG_OSX_CLANG_VERSION" ]
10351035
then
10361036
case $CFG_OSX_CLANG_VERSION in
1037-
(7.0* | 7.1* | 7.2*)
1037+
(7.0* | 7.1* | 7.2* | 7.3*)
10381038
step_msg "found ok version of APPLE CLANG: $CFG_OSX_CLANG_VERSION"
10391039
;;
10401040
(*)

branches/beta/mk/cfg/i586-unknown-linux-gnu.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ CFG_LIB_NAME_i586-unknown-linux-gnu=lib$(1).so
77
CFG_STATIC_LIB_NAME_i586-unknown-linux-gnu=lib$(1).a
88
CFG_LIB_GLOB_i586-unknown-linux-gnu=lib$(1)-*.so
99
CFG_LIB_DSYM_GLOB_i586-unknown-linux-gnu=lib$(1)-*.dylib.dSYM
10-
CFG_JEMALLOC_CFLAGS_i586-unknown-linux-gnu := -m32 $(CFLAGS)
11-
CFG_GCCISH_CFLAGS_i586-unknown-linux-gnu := -Wall -Werror -g -fPIC -m32 $(CFLAGS)
12-
CFG_GCCISH_CXXFLAGS_i586-unknown-linux-gnu := -fno-rtti $(CXXFLAGS)
10+
CFG_JEMALLOC_CFLAGS_i586-unknown-linux-gnu := -m32 $(CFLAGS) -march=pentium
11+
CFG_GCCISH_CFLAGS_i586-unknown-linux-gnu := -Wall -Werror -g -fPIC -m32 $(CFLAGS) -march=pentium
12+
CFG_GCCISH_CXXFLAGS_i586-unknown-linux-gnu := -fno-rtti $(CXXFLAGS) -march=pentium
1313
CFG_GCCISH_LINK_FLAGS_i586-unknown-linux-gnu := -shared -fPIC -ldl -pthread -lrt -g -m32
1414
CFG_GCCISH_DEF_FLAG_i586-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list=
1515
CFG_LLC_FLAGS_i586-unknown-linux-gnu :=

branches/beta/mk/crates.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ DEPS_rustc := syntax fmt_macros flate arena serialize getopts rbml rustc_front\
9797
log graphviz rustc_llvm rustc_back rustc_data_structures\
9898
rustc_const_eval
9999
DEPS_rustc_back := std syntax rustc_llvm rustc_front flate log libc
100-
DEPS_rustc_borrowck := rustc rustc_front log graphviz syntax
100+
DEPS_rustc_borrowck := rustc rustc_front rustc_mir log graphviz syntax
101101
DEPS_rustc_data_structures := std log serialize
102102
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
103103
rustc_typeck rustc_mir rustc_resolve log syntax serialize rustc_llvm \

branches/beta/src/bootstrap/build/check.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,11 @@ pub fn linkcheck(build: &Build, stage: u32, host: &str) {
1616
build.run(build.tool_cmd(&compiler, "linkchecker")
1717
.arg(build.out.join(host).join("doc")));
1818
}
19+
20+
pub fn cargotest(build: &Build, stage: u32, host: &str) {
21+
let ref compiler = Compiler::new(stage, host);
22+
build.run(build.tool_cmd(compiler, "cargotest")
23+
.env("RUSTC", build.compiler_path(compiler))
24+
.env("RUSTDOC", build.rustdoc(compiler))
25+
.arg(&build.cargo));
26+
}

branches/beta/src/bootstrap/build/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ impl Build {
183183
compile::tool(self, stage, target.target,
184184
"error_index_generator");
185185
}
186+
ToolCargoTest { stage } => {
187+
compile::tool(self, stage, target.target, "cargotest");
188+
}
186189
DocBook { stage } => {
187190
doc::rustbook(self, stage, target.target, "book", &doc_out);
188191
}
@@ -210,6 +213,9 @@ impl Build {
210213
CheckLinkcheck { stage } => {
211214
check::linkcheck(self, stage, target.target);
212215
}
216+
CheckCargoTest { stage } => {
217+
check::cargotest(self, stage, target.target);
218+
}
213219

214220
DistDocs { stage } => dist::docs(self, stage, target.target),
215221
DistMingw { _dummy } => dist::mingw(self, target.target),

branches/beta/src/bootstrap/build/native.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ pub fn llvm(build: &Build, target: &str) {
3939

4040
let _ = fs::remove_dir_all(&dst.join("build"));
4141
t!(fs::create_dir_all(&dst.join("build")));
42-
let assertions = if build.config.llvm_assertions {"ON"} else {"OFF"};
42+
let mut assertions = if build.config.llvm_assertions {"ON"} else {"OFF"};
43+
44+
// Disable LLVM assertions on ARM compilers until #32360 is fixed
45+
if target.contains("arm") && target.contains("gnu") {
46+
assertions = "OFF";
47+
}
4348

4449
// http://llvm.org/docs/CMake.html
4550
let mut cfg = cmake::Config::new(build.src.join("src/llvm"));
@@ -114,7 +119,8 @@ pub fn compiler_rt(build: &Build, target: &str) {
114119
let arch = target.split('-').next().unwrap();
115120
let mode = if build.config.rust_optimize {"Release"} else {"Debug"};
116121
let (dir, build_target, libname) = if target.contains("linux") ||
117-
target.contains("freebsd") {
122+
target.contains("freebsd") ||
123+
target.contains("netbsd") {
118124
let os = if target.contains("android") {"-android"} else {""};
119125
let arch = if arch.starts_with("arm") && target.contains("eabihf") {
120126
"armhf"

branches/beta/src/bootstrap/build/step.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ macro_rules! targets {
4747
(tool_linkchecker, ToolLinkchecker { stage: u32 }),
4848
(tool_rustbook, ToolRustbook { stage: u32 }),
4949
(tool_error_index, ToolErrorIndex { stage: u32 }),
50+
(tool_cargotest, ToolCargoTest { stage: u32 }),
5051

5152
// Steps for long-running native builds. Ideally these wouldn't
5253
// actually exist and would be part of build scripts, but for now
@@ -73,6 +74,7 @@ macro_rules! targets {
7374
// target to depend on a bunch of others.
7475
(check, Check { stage: u32, compiler: Compiler<'a> }),
7576
(check_linkcheck, CheckLinkcheck { stage: u32 }),
77+
(check_cargotest, CheckCargoTest { stage: u32 }),
7678

7779
// Distribution targets, creating tarballs
7880
(dist, Dist { stage: u32 }),
@@ -292,6 +294,9 @@ impl<'a> Step<'a> {
292294
Source::CheckLinkcheck { stage } => {
293295
vec![self.tool_linkchecker(stage), self.doc(stage)]
294296
}
297+
Source::CheckCargoTest { stage } => {
298+
vec![self.tool_cargotest(stage)]
299+
}
295300

296301
Source::ToolLinkchecker { stage } => {
297302
vec![self.libstd(self.compiler(stage))]
@@ -300,6 +305,9 @@ impl<'a> Step<'a> {
300305
Source::ToolRustbook { stage } => {
301306
vec![self.librustc(self.compiler(stage))]
302307
}
308+
Source::ToolCargoTest { stage } => {
309+
vec![self.libstd(self.compiler(stage))]
310+
}
303311

304312
Source::DistDocs { stage } => vec![self.doc(stage)],
305313
Source::DistMingw { _dummy: _ } => Vec::new(),

branches/beta/src/bootstrap/mk/Makefile.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ standalone-docs:
3838
$(Q)$(BOOTSTRAP) --step doc-standalone
3939
check:
4040
$(Q)$(BOOTSTRAP) --step check
41+
cargotest:
42+
$(Q)$(BOOTSTRAP) --step cargotest
4143
dist:
4244
$(Q)$(BOOTSTRAP) --step dist
4345

branches/beta/src/compiletest/errors.rs

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,54 @@
99
// except according to those terms.
1010
use self::WhichLine::*;
1111

12+
use std::fmt;
1213
use std::fs::File;
1314
use std::io::BufReader;
1415
use std::io::prelude::*;
1516
use std::path::Path;
17+
use std::str::FromStr;
18+
19+
#[derive(Clone, Debug, PartialEq)]
20+
pub enum ErrorKind {
21+
Help,
22+
Error,
23+
Note,
24+
Suggestion,
25+
Warning,
26+
}
27+
28+
impl FromStr for ErrorKind {
29+
type Err = ();
30+
fn from_str(s: &str) -> Result<Self, Self::Err> {
31+
match &s.trim_right_matches(':') as &str {
32+
"HELP" => Ok(ErrorKind::Help),
33+
"ERROR" => Ok(ErrorKind::Error),
34+
"NOTE" => Ok(ErrorKind::Note),
35+
"SUGGESTION" => Ok(ErrorKind::Suggestion),
36+
"WARN" => Ok(ErrorKind::Warning),
37+
"WARNING" => Ok(ErrorKind::Warning),
38+
_ => Err(()),
39+
}
40+
}
41+
}
42+
43+
impl fmt::Display for ErrorKind {
44+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
45+
match *self {
46+
ErrorKind::Help => write!(f, "help"),
47+
ErrorKind::Error => write!(f, "error"),
48+
ErrorKind::Note => write!(f, "note"),
49+
ErrorKind::Suggestion => write!(f, "suggestion"),
50+
ErrorKind::Warning => write!(f, "warning"),
51+
}
52+
}
53+
}
1654

1755
pub struct ExpectedError {
1856
pub line_num: usize,
19-
pub kind: String,
57+
/// What kind of message we expect (e.g. warning, error, suggestion).
58+
/// `None` if not specified or unknown message kind.
59+
pub kind: Option<ErrorKind>,
2060
pub msg: String,
2161
}
2262

@@ -81,11 +121,11 @@ fn parse_expected(last_nonfollow_error: Option<usize>,
81121
(false, line[start + tag.len()..].chars().take_while(|c| *c == '^').count())
82122
};
83123
let kind_start = start + tag.len() + adjusts + (follow as usize);
84-
let letters = line[kind_start..].chars();
85-
let kind = letters.skip_while(|c| c.is_whitespace())
86-
.take_while(|c| !c.is_whitespace())
87-
.flat_map(|c| c.to_lowercase())
88-
.collect::<String>();
124+
let kind = line[kind_start..].split_whitespace()
125+
.next()
126+
.expect("Encountered unexpected empty comment")
127+
.parse::<ErrorKind>()
128+
.ok();
89129
let letters = line[kind_start..].chars();
90130
let msg = letters.skip_while(|c| c.is_whitespace())
91131
.skip_while(|c| !c.is_whitespace())

branches/beta/src/compiletest/runtest.rs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use common::Config;
1212
use common::{CompileFail, ParseFail, Pretty, RunFail, RunPass, RunPassValgrind};
1313
use common::{Codegen, DebugInfoLldb, DebugInfoGdb, Rustdoc, CodegenUnits};
14-
use errors;
14+
use errors::{self, ErrorKind};
1515
use header::TestProps;
1616
use header;
1717
use procsrv;
@@ -1025,12 +1025,16 @@ fn check_expected_errors(revision: Option<&str>,
10251025
expected.replace(r"\", "/")
10261026
}).collect::<Vec<String>>();
10271027

1028+
// If the testcase being checked contains at least one expected "help"
1029+
// message, then we'll ensure that all "help" messages are expected.
1030+
// Otherwise, all "help" messages reported by the compiler will be ignored.
1031+
// This logic also applies to "note" messages.
10281032
let (expect_help, expect_note) =
10291033
expected_errors.iter()
10301034
.fold((false, false),
10311035
|(acc_help, acc_note), ee|
1032-
(acc_help || ee.kind == "help:" || ee.kind == "help",
1033-
acc_note || ee.kind == "note:" || ee.kind == "note"));
1036+
(acc_help || ee.kind == Some(ErrorKind::Help),
1037+
acc_note || ee.kind == Some(ErrorKind::Note)));
10341038

10351039
// Scan and extract our error/warning messages,
10361040
// which look like:
@@ -1048,15 +1052,15 @@ fn check_expected_errors(revision: Option<&str>,
10481052
let mut prev = 0;
10491053
for (i, ee) in expected_errors.iter().enumerate() {
10501054
if !found_flags[i] {
1051-
debug!("prefix={} ee.kind={} ee.msg={} line={}",
1055+
debug!("prefix={} ee.kind={:?} ee.msg={} line={}",
10521056
prefixes[i],
10531057
ee.kind,
10541058
ee.msg,
10551059
line);
10561060
// Suggestions have no line number in their output, so take on the line number of
10571061
// the previous expected error
1058-
if ee.kind == "suggestion" {
1059-
assert!(expected_errors[prev].kind == "help",
1062+
if ee.kind == Some(ErrorKind::Suggestion) {
1063+
assert!(expected_errors[prev].kind == Some(ErrorKind::Help),
10601064
"SUGGESTIONs must be preceded by a HELP");
10611065
if line.contains(&ee.msg) {
10621066
found_flags[i] = true;
@@ -1066,7 +1070,7 @@ fn check_expected_errors(revision: Option<&str>,
10661070
}
10671071
if
10681072
(prefix_matches(line, &prefixes[i]) || continuation(line)) &&
1069-
line.contains(&ee.kind) &&
1073+
(ee.kind.is_none() || line.contains(&ee.kind.as_ref().unwrap().to_string())) &&
10701074
line.contains(&ee.msg)
10711075
{
10721076
found_flags[i] = true;
@@ -1092,7 +1096,10 @@ fn check_expected_errors(revision: Option<&str>,
10921096
if !flag {
10931097
let ee = &expected_errors[i];
10941098
error(revision, &format!("expected {} on line {} not found: {}",
1095-
ee.kind, ee.line_num, ee.msg));
1099+
ee.kind.as_ref()
1100+
.map_or("message".into(),
1101+
|k| k.to_string()),
1102+
ee.line_num, ee.msg));
10961103
not_found += 1;
10971104
}
10981105
}

branches/beta/src/doc/book/error-handling.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2019,6 +2019,16 @@ impl Error for CliError {
20192019
CliError::NotFound => "not found",
20202020
}
20212021
}
2022+
2023+
fn cause(&self) -> Option<&error::Error> {
2024+
match *self {
2025+
CliError::Io(ref err) => Some(err),
2026+
CliError::Parse(ref err) => Some(err),
2027+
// Our custom error doesn't have an underlying cause, but we could
2028+
// modify it so that it does.
2029+
CliError::NotFound() => None,
2030+
}
2031+
}
20222032
}
20232033
```
20242034

branches/beta/src/doc/book/getting-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ unofficial locations.
9393
| `armv7-apple-ios` || | | ARM iOS |
9494
| `armv7s-apple-ios` || | | ARM iOS |
9595
| `aarch64-apple-ios` || | | ARM64 iOS |
96-
| `i686-unknown-freebsd` ||| | 32-bit FreeBSD |
97-
| `x86_64-unknown-freebsd` ||| | 64-bit FreeBSD |
96+
| `i686-unknown-freebsd` ||| | 32-bit FreeBSD |
97+
| `x86_64-unknown-freebsd` ||| | 64-bit FreeBSD |
9898
| `x86_64-unknown-openbsd` ||| | 64-bit OpenBSD |
9999
| `x86_64-unknown-netbsd` ||| | 64-bit NetBSD |
100100
| `x86_64-unknown-bitrig` ||| | 64-bit Bitrig |

branches/beta/src/doc/book/guessing-game.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ returned by `parse()`, this is an `enum` like `Ordering`, but in this case,
912912
each variant has some data associated with it: `Ok` is a success, and `Err` is a
913913
failure. Each contains more information: the successfully parsed integer, or an
914914
error type. In this case, we `match` on `Ok(num)`, which sets the name `num` to
915-
the unwrapped `Ok` value (ythe integer), and then we return it on the
915+
the unwrapped `Ok` value (the integer), and then we return it on the
916916
right-hand side. In the `Err` case, we don’t care what kind of error it is, so
917917
we just use the catch all `_` instead of a name. This catches everything that
918918
isn't `Ok`, and `continue` lets us move to the next iteration of the loop; in

branches/beta/src/doc/book/lifetimes.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -282,14 +282,12 @@ to it.
282282

283283
## Lifetime Elision
284284

285-
Rust supports powerful local type inference in function bodies, but it’s
286-
forbidden in item signatures to allow reasoning about the types based on
287-
the item signature alone. However, for ergonomic reasons a very restricted
288-
secondary inference algorithm called “lifetime elision” applies in function
289-
signatures. It infers only based on the signature components themselves and not
290-
based on the body of the function, only infers lifetime parameters, and does
291-
this with only three easily memorizable and unambiguous rules. This makes
292-
lifetime elision a shorthand for writing an item signature, while not hiding
285+
Rust supports powerful local type inference in the bodies of functions but not in their item signatures.
286+
It's forbidden to allow reasoning about types based on the item signature alone.
287+
However, for ergonomic reasons, a very restricted secondary inference algorithm called
288+
“lifetime elision” does apply when judging lifetimes. Lifetime elision is concerned solely to infer
289+
lifetime parameters using three easily memorizable and unambiguous rules. This means lifetime elision
290+
acts as a shorthand for writing an item signature, while not hiding
293291
away the actual types involved as full local inference would if applied to it.
294292

295293
When talking about lifetime elision, we use the term *input lifetime* and

branches/beta/src/doc/book/match.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ give us an error:
3636
error: non-exhaustive patterns: `_` not covered
3737
```
3838

39-
Rust is telling us that we forgot a value. The compiler infers from `x` that it
40-
can have any positive 32bit value; for example 1 to 2,147,483,647. The `_` acts
39+
Rust is telling us that we forgot some value. The compiler infers from `x` that it
40+
can have any 32bit integer value; for example -2,147,483,648 to 2,147,483,647. The `_` acts
4141
as a 'catch-all', and will catch all possible values that *aren't* specified in
42-
an arm of `match`. As you can see with the previous example, we provide `match`
42+
an arm of `match`. As you can see in the previous example, we provide `match`
4343
arms for integers 1-5, if `x` is 6 or any other value, then it is caught by `_`.
4444

4545
`match` is also an expression, which means we can use it on the right-hand

branches/beta/src/doc/book/primitive-types.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ of these ones, as well, but these are the most primitive.
77

88
# Booleans
99

10-
Rust has a built in boolean type, named `bool`. It has two values, `true` and `false`:
10+
Rust has a built-in boolean type, named `bool`. It has two values, `true` and `false`:
1111

1212
```rust
1313
let x = true;
@@ -89,13 +89,13 @@ Unsigned types use a `u` for their category, and signed types use `i`. The `i`
8989
is for ‘integer’. So `u8` is an eight-bit unsigned number, and `i8` is an
9090
eight-bit signed number.
9191

92-
## Fixed size types
92+
## Fixed-size types
9393

94-
Fixed size types have a specific number of bits in their representation. Valid
94+
Fixed-size types have a specific number of bits in their representation. Valid
9595
bit sizes are `8`, `16`, `32`, and `64`. So, `u32` is an unsigned, 32-bit integer,
9696
and `i64` is a signed, 64-bit integer.
9797

98-
## Variable sized types
98+
## Variable-size types
9999

100100
Rust also provides types whose size depends on the size of a pointer of the
101101
underlying machine. These types have ‘size’ as the category, and come in signed

0 commit comments

Comments
 (0)