Skip to content

Commit 83fc051

Browse files
committed
---
yaml --- r: 273342 b: refs/heads/beta c: 4a67405 h: refs/heads/master
1 parent 0a2b96d commit 83fc051

File tree

184 files changed

+5064
-6462
lines changed

Some content is hidden

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

184 files changed

+5064
-6462
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: 9e1d65975c050c89b9ff3d0b0e404946d1f21f9e
26+
refs/heads/beta: 4a67405ba9870d643d3b6314b1b0e52d37b6958e
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,7 @@ opt dist-host-only 0 "only install bins for the host architecture"
607607
opt inject-std-version 1 "inject the current compiler version of libstd into programs"
608608
opt llvm-version-check 1 "check if the LLVM version is supported, build anyway"
609609
opt rustbuild 0 "use the rust and cargo based build system"
610+
opt orbit 0 "get MIR where it belongs - everywhere; most importantly, in orbit"
610611

611612
# Optimization and debugging options. These may be overridden by the release channel, etc.
612613
opt_nosave optimize 1 "build optimized rust code"
@@ -713,6 +714,8 @@ if [ -n "$CFG_ENABLE_DEBUG_ASSERTIONS" ]; then putvar CFG_ENABLE_DEBUG_ASSERTION
713714
if [ -n "$CFG_ENABLE_DEBUGINFO" ]; then putvar CFG_ENABLE_DEBUGINFO; fi
714715
if [ -n "$CFG_ENABLE_DEBUG_JEMALLOC" ]; then putvar CFG_ENABLE_DEBUG_JEMALLOC; fi
715716

717+
if [ -n "$CFG_ENABLE_ORBIT" ]; then putvar CFG_ENABLE_ORBIT; fi
718+
716719
# A magic value that allows the compiler to use unstable features
717720
# during the bootstrap even when doing so would normally be an error
718721
# because of feature staging or because the build turns on

branches/beta/mk/main.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ ifdef CFG_ENABLE_DEBUGINFO
134134
CFG_RUSTC_FLAGS += -g
135135
endif
136136

137+
ifdef CFG_ENABLE_ORBIT
138+
$(info cfg: launching MIR (CFG_ENABLE_ORBIT))
139+
CFG_RUSTC_FLAGS += -Z orbit
140+
endif
141+
137142
ifdef SAVE_TEMPS
138143
CFG_RUSTC_FLAGS += --save-temps
139144
endif

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ pub fn compiler_rt(build: &Build, target: &str) {
114114
let arch = target.split('-').next().unwrap();
115115
let mode = if build.config.rust_optimize {"Release"} else {"Debug"};
116116
let (dir, build_target, libname) = if target.contains("linux") ||
117-
target.contains("freebsd") {
117+
target.contains("freebsd") ||
118+
target.contains("netbsd") {
118119
let os = if target.contains("android") {"-android"} else {""};
119120
let arch = if arch.starts_with("arm") && target.contains("eabihf") {
120121
"armhf"

branches/beta/src/compiletest/header.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ pub struct TestProps {
3131
pub pp_exact: Option<PathBuf>,
3232
// Modules from aux directory that should be compiled
3333
pub aux_builds: Vec<String> ,
34+
// Environment settings to use for compiling
35+
pub rustc_env: Vec<(String,String)> ,
3436
// Environment settings to use during execution
3537
pub exec_env: Vec<(String,String)> ,
3638
// Lines to check if they appear in the expected debugger output
@@ -77,6 +79,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
7779
pp_exact: pp_exact,
7880
aux_builds: aux_builds,
7981
revisions: vec![],
82+
rustc_env: vec![],
8083
exec_env: exec_env,
8184
check_lines: check_lines,
8285
build_aux_docs: build_aux_docs,
@@ -153,10 +156,14 @@ pub fn load_props_into(props: &mut TestProps, testfile: &Path, cfg: Option<&str>
153156
props.aux_builds.push(ab);
154157
}
155158

156-
if let Some(ee) = parse_exec_env(ln) {
159+
if let Some(ee) = parse_env(ln, "exec-env") {
157160
props.exec_env.push(ee);
158161
}
159162

163+
if let Some(ee) = parse_env(ln, "rustc-env") {
164+
props.rustc_env.push(ee);
165+
}
166+
160167
if let Some(cl) = parse_check_line(ln) {
161168
props.check_lines.push(cl);
162169
}
@@ -372,8 +379,8 @@ fn parse_pretty_compare_only(line: &str) -> bool {
372379
parse_name_directive(line, "pretty-compare-only")
373380
}
374381

375-
fn parse_exec_env(line: &str) -> Option<(String, String)> {
376-
parse_name_value_directive(line, "exec-env").map(|nv| {
382+
fn parse_env(line: &str, name: &str) -> Option<(String, String)> {
383+
parse_name_value_directive(line, name).map(|nv| {
377384
// nv is either FOO or FOO=BAR
378385
let mut strs: Vec<String> = nv
379386
.splitn(2, '=')

branches/beta/src/compiletest/runtest.rs

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -863,12 +863,28 @@ fn cleanup_debug_info_options(options: &Option<String>) -> Option<String> {
863863
"-g".to_owned(),
864864
"--debuginfo".to_owned()
865865
];
866-
let new_options =
866+
let mut new_options =
867867
split_maybe_args(options).into_iter()
868868
.filter(|x| !options_to_remove.contains(x))
869-
.collect::<Vec<String>>()
870-
.join(" ");
871-
Some(new_options)
869+
.collect::<Vec<String>>();
870+
871+
let mut i = 0;
872+
while i + 1 < new_options.len() {
873+
if new_options[i] == "-Z" {
874+
// FIXME #31005 MIR missing debuginfo currently.
875+
if new_options[i + 1] == "orbit" {
876+
// Remove "-Z" and "orbit".
877+
new_options.remove(i);
878+
new_options.remove(i);
879+
continue;
880+
}
881+
// Always skip over -Z's argument.
882+
i += 1;
883+
}
884+
i += 1;
885+
}
886+
887+
Some(new_options.join(" "))
872888
}
873889

874890
fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String]) {
@@ -1009,6 +1025,10 @@ fn check_expected_errors(revision: Option<&str>,
10091025
expected.replace(r"\", "/")
10101026
}).collect::<Vec<String>>();
10111027

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.
10121032
let (expect_help, expect_note) =
10131033
expected_errors.iter()
10141034
.fold((false, false),
@@ -1386,7 +1406,7 @@ fn compose_and_run_compiler(config: &Config, props: &TestProps,
13861406
compose_and_run(config,
13871407
testpaths,
13881408
args,
1389-
Vec::new(),
1409+
props.rustc_env.clone(),
13901410
&config.compile_lib_path,
13911411
Some(aux_dir.to_str().unwrap()),
13921412
input)

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/references-and-borrowing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ both at the same time:
163163
* exactly one mutable reference (`&mut T`).
164164

165165

166-
You may notice that this is very similar, though not exactly the same as,
167-
to the definition of a data race:
166+
You may notice that this is very similar to, though not exactly the same as,
167+
the definition of a data race:
168168

169169
> There is a ‘data race’ when two or more pointers access the same memory
170170
> location at the same time, where at least one of them is writing, and the

branches/beta/src/doc/book/variable-bindings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ function, rather than leaving it off. Otherwise, you’ll get an error.
1818

1919
In many languages, a variable binding would be called a *variable*, but Rust’s
2020
variable bindings have a few tricks up their sleeves. For example the
21-
left-hand side of a `let` expression is a ‘[pattern][pattern]’, not a
21+
left-hand side of a `let` statement is a ‘[pattern][pattern]’, not a
2222
variable name. This means we can do things like:
2323

2424
```rust
2525
let (x, y) = (1, 2);
2626
```
2727

28-
After this expression is evaluated, `x` will be one, and `y` will be two.
28+
After this statement is evaluated, `x` will be one, and `y` will be two.
2929
Patterns are really powerful, and have [their own section][pattern] in the
3030
book. We don’t need those features for now, so we’ll keep this in the back
3131
of our minds as we go forward.

branches/beta/src/libcore/intrinsics.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,32 @@ extern "rust-intrinsic" {
539539
/// Returns the nearest integer to an `f64`. Rounds half-way cases away from zero.
540540
pub fn roundf64(x: f64) -> f64;
541541

542+
/// Float addition that allows optimizations based on algebraic rules.
543+
/// May assume inputs are finite.
544+
#[cfg(not(stage0))]
545+
pub fn fadd_fast<T>(a: T, b: T) -> T;
546+
547+
/// Float subtraction that allows optimizations based on algebraic rules.
548+
/// May assume inputs are finite.
549+
#[cfg(not(stage0))]
550+
pub fn fsub_fast<T>(a: T, b: T) -> T;
551+
552+
/// Float multiplication that allows optimizations based on algebraic rules.
553+
/// May assume inputs are finite.
554+
#[cfg(not(stage0))]
555+
pub fn fmul_fast<T>(a: T, b: T) -> T;
556+
557+
/// Float division that allows optimizations based on algebraic rules.
558+
/// May assume inputs are finite.
559+
#[cfg(not(stage0))]
560+
pub fn fdiv_fast<T>(a: T, b: T) -> T;
561+
562+
/// Float remainder that allows optimizations based on algebraic rules.
563+
/// May assume inputs are finite.
564+
#[cfg(not(stage0))]
565+
pub fn frem_fast<T>(a: T, b: T) -> T;
566+
567+
542568
/// Returns the number of bits set in an integer type `T`
543569
pub fn ctpop<T>(x: T) -> T;
544570

branches/beta/src/libcore/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
#![feature(reflect)]
7373
#![feature(unwind_attributes)]
7474
#![feature(repr_simd, platform_intrinsics)]
75+
#![feature(rustc_attrs)]
7576
#![feature(staged_api)]
7677
#![feature(unboxed_closures)]
7778

branches/beta/src/libcore/num/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,7 @@ macro_rules! int_impl {
10081008
/// ```
10091009
#[stable(feature = "rust1", since = "1.0.0")]
10101010
#[inline]
1011+
#[cfg_attr(not(stage0), rustc_no_mir)] // FIXME #29769 MIR overflow checking is TBD.
10111012
pub fn pow(self, mut exp: u32) -> Self {
10121013
let mut base = self;
10131014
let mut acc = Self::one();
@@ -1049,6 +1050,7 @@ macro_rules! int_impl {
10491050
/// ```
10501051
#[stable(feature = "rust1", since = "1.0.0")]
10511052
#[inline]
1053+
#[cfg_attr(not(stage0), rustc_no_mir)] // FIXME #29769 MIR overflow checking is TBD.
10521054
pub fn abs(self) -> Self {
10531055
if self.is_negative() {
10541056
// Note that the #[inline] above means that the overflow
@@ -2013,6 +2015,7 @@ macro_rules! uint_impl {
20132015
/// ```
20142016
#[stable(feature = "rust1", since = "1.0.0")]
20152017
#[inline]
2018+
#[cfg_attr(not(stage0), rustc_no_mir)] // FIXME #29769 MIR overflow checking is TBD.
20162019
pub fn pow(self, mut exp: u32) -> Self {
20172020
let mut base = self;
20182021
let mut acc = Self::one();

branches/beta/src/librustc/front/map/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use middle::def_id::DefId;
2222

2323
use syntax::abi::Abi;
2424
use syntax::ast::{self, Name, NodeId, DUMMY_NODE_ID};
25+
use syntax::attr::ThinAttributesExt;
2526
use syntax::codemap::{Span, Spanned};
2627
use syntax::parse::token;
2728

@@ -718,6 +719,8 @@ impl<'ast> Map<'ast> {
718719
Some(NodeTraitItem(ref ti)) => Some(&ti.attrs[..]),
719720
Some(NodeImplItem(ref ii)) => Some(&ii.attrs[..]),
720721
Some(NodeVariant(ref v)) => Some(&v.node.attrs[..]),
722+
Some(NodeExpr(ref e)) => Some(e.attrs.as_attr_slice()),
723+
Some(NodeStmt(ref s)) => Some(s.node.attrs()),
721724
// unit/tuple structs take the attributes straight from
722725
// the struct definition.
723726
Some(NodeStructCtor(_)) => {

branches/beta/src/librustc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ mod macros;
7373
pub mod diagnostics;
7474

7575
pub mod back {
76-
pub use rustc_back::abi;
7776
pub use rustc_back::rpath;
7877
pub use rustc_back::svh;
7978
}

branches/beta/src/librustc/lint/builtin.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ declare_lint! {
154154
"transmute from function item type to pointer-sized type erroneously allowed"
155155
}
156156

157+
declare_lint! {
158+
pub OVERLAPPING_INHERENT_IMPLS,
159+
Warn,
160+
"two overlapping inherent impls define an item with the same name were erroneously allowed"
161+
}
162+
157163
/// Does nothing as a lint pass, but registers some `Lint`s
158164
/// which are used by other parts of the compiler.
159165
#[derive(Copy, Clone)]
@@ -184,7 +190,8 @@ impl LintPass for HardwiredLints {
184190
MATCH_OF_UNIT_VARIANT_VIA_PAREN_DOTDOT,
185191
CONST_ERR,
186192
RAW_POINTER_DERIVE,
187-
TRANSMUTE_FROM_FN_ITEM_TYPES
193+
TRANSMUTE_FROM_FN_ITEM_TYPES,
194+
OVERLAPPING_INHERENT_IMPLS
188195
)
189196
}
190197
}

branches/beta/src/librustc/middle/cfg/construct.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -354,19 +354,10 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
354354
self.straightline(expr, pred, Some(&**e).into_iter())
355355
}
356356

357-
hir::ExprInlineAsm(ref inline_asm) => {
358-
let inputs = inline_asm.inputs.iter();
359-
let outputs = inline_asm.outputs.iter();
360-
let post_inputs = self.exprs(inputs.map(|a| {
361-
debug!("cfg::construct InlineAsm id:{} input:{:?}", expr.id, a);
362-
let &(_, ref expr) = a;
363-
&**expr
364-
}), pred);
365-
let post_outputs = self.exprs(outputs.map(|a| {
366-
debug!("cfg::construct InlineAsm id:{} output:{:?}", expr.id, a);
367-
&*a.expr
368-
}), post_inputs);
369-
self.add_ast_node(expr.id, &[post_outputs])
357+
hir::ExprInlineAsm(_, ref outputs, ref inputs) => {
358+
let post_outputs = self.exprs(outputs.iter().map(|e| &**e), pred);
359+
let post_inputs = self.exprs(inputs.iter().map(|e| &**e), post_outputs);
360+
self.add_ast_node(expr.id, &[post_inputs])
370361
}
371362

372363
hir::ExprClosure(..) |

branches/beta/src/librustc/middle/check_match.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,9 @@ impl<'a, 'tcx> Folder for StaticInliner<'a, 'tcx> {
475475
let def = self.tcx.def_map.borrow().get(&pat.id).map(|d| d.full_def());
476476
match def {
477477
Some(Def::AssociatedConst(did)) |
478-
Some(Def::Const(did)) => match lookup_const_by_id(self.tcx, did,
479-
Some(pat.id), None) {
480-
Some((const_expr, _const_ty)) => {
478+
Some(Def::Const(did)) => {
479+
let substs = Some(self.tcx.node_id_item_substs(pat.id).substs);
480+
if let Some((const_expr, _)) = lookup_const_by_id(self.tcx, did, substs) {
481481
const_expr_to_pat(self.tcx, const_expr, pat.span).map(|new_pat| {
482482

483483
if let Some(ref mut renaming_map) = self.renaming_map {
@@ -487,14 +487,13 @@ impl<'a, 'tcx> Folder for StaticInliner<'a, 'tcx> {
487487

488488
new_pat
489489
})
490-
}
491-
None => {
490+
} else {
492491
self.failed = true;
493492
span_err!(self.tcx.sess, pat.span, E0158,
494493
"statics cannot be referenced in patterns");
495494
pat
496495
}
497-
},
496+
}
498497
_ => noop_fold_pat(pat, self)
499498
}
500499
}

0 commit comments

Comments
 (0)