Skip to content

Commit 7a2bac9

Browse files
committed
---
yaml --- r: 273351 b: refs/heads/beta c: 8eeb506 h: refs/heads/master i: 273349: a012f14 273347: b290073 273343: 6e75a7d
1 parent d965851 commit 7a2bac9

Some content is hidden

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

42 files changed

+517
-222
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: 421fed188c66379cb2f00c7e4ad7b7381b3abaa9
26+
refs/heads/beta: 8eeb5062d115b846a66685e73ce29697f7eeee11
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/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/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/runtest.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,10 @@ 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),

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
@@ -555,6 +555,32 @@ extern "rust-intrinsic" {
555555
/// Returns the nearest integer to an `f64`. Rounds half-way cases away from zero.
556556
pub fn roundf64(x: f64) -> f64;
557557

558+
/// Float addition that allows optimizations based on algebraic rules.
559+
/// May assume inputs are finite.
560+
#[cfg(not(stage0))]
561+
pub fn fadd_fast<T>(a: T, b: T) -> T;
562+
563+
/// Float subtraction that allows optimizations based on algebraic rules.
564+
/// May assume inputs are finite.
565+
#[cfg(not(stage0))]
566+
pub fn fsub_fast<T>(a: T, b: T) -> T;
567+
568+
/// Float multiplication that allows optimizations based on algebraic rules.
569+
/// May assume inputs are finite.
570+
#[cfg(not(stage0))]
571+
pub fn fmul_fast<T>(a: T, b: T) -> T;
572+
573+
/// Float division that allows optimizations based on algebraic rules.
574+
/// May assume inputs are finite.
575+
#[cfg(not(stage0))]
576+
pub fn fdiv_fast<T>(a: T, b: T) -> T;
577+
578+
/// Float remainder that allows optimizations based on algebraic rules.
579+
/// May assume inputs are finite.
580+
#[cfg(not(stage0))]
581+
pub fn frem_fast<T>(a: T, b: T) -> T;
582+
583+
558584
/// Returns the number of bits set in an integer type `T`
559585
pub fn ctpop<T>(x: T) -> T;
560586

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/liveness.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ use middle::pat_util;
115115
use middle::ty::{self, TyCtxt, ParameterEnvironment};
116116
use middle::traits::{self, ProjectionMode};
117117
use middle::infer;
118+
use middle::subst::Subst;
118119
use lint;
119120
use util::nodemap::NodeMap;
120121

@@ -1491,14 +1492,15 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
14911492
if self.live_on_entry(entry_ln, self.s.no_ret_var).is_some() => {
14921493

14931494
let param_env = ParameterEnvironment::for_item(&self.ir.tcx, id);
1495+
let t_ret_subst = t_ret.subst(&self.ir.tcx, &param_env.free_substs);
14941496
let infcx = infer::new_infer_ctxt(&self.ir.tcx,
14951497
&self.ir.tcx.tables,
14961498
Some(param_env),
14971499
ProjectionMode::Any);
14981500
let cause = traits::ObligationCause::dummy();
14991501
let norm = traits::fully_normalize(&infcx,
15001502
cause,
1501-
&t_ret);
1503+
&t_ret_subst);
15021504

15031505
if norm.unwrap().is_nil() {
15041506
// for nil return types, it is ok to not return a value expl.

branches/beta/src/librustc_lint/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
175175
id: LintId::of(TRANSMUTE_FROM_FN_ITEM_TYPES),
176176
reference: "issue #19925 <https://github.com/rust-lang/rust/issues/19925>",
177177
},
178+
FutureIncompatibleInfo {
179+
id: LintId::of(OVERLAPPING_INHERENT_IMPLS),
180+
reference: "issue #22889 <https://github.com/rust-lang/rust/issues/22889>",
181+
},
178182
]);
179183

180184
// We have one lint pass defined specially

branches/beta/src/librustc_llvm/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,6 +1310,7 @@ extern {
13101310
-> ValueRef;
13111311
pub fn LLVMBuildNot(B: BuilderRef, V: ValueRef, Name: *const c_char)
13121312
-> ValueRef;
1313+
pub fn LLVMRustSetHasUnsafeAlgebra(Instr: ValueRef);
13131314

13141315
/* Memory */
13151316
pub fn LLVMBuildAlloca(B: BuilderRef, Ty: TypeRef, Name: *const c_char)

branches/beta/src/librustc_trans/trans/build.rs

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,18 @@ pub fn FAdd(cx: Block,
221221
B(cx).fadd(lhs, rhs)
222222
}
223223

224+
pub fn FAddFast(cx: Block,
225+
lhs: ValueRef,
226+
rhs: ValueRef,
227+
debug_loc: DebugLoc)
228+
-> ValueRef {
229+
if cx.unreachable.get() {
230+
return _Undef(lhs);
231+
}
232+
debug_loc.apply(cx.fcx);
233+
B(cx).fadd_fast(lhs, rhs)
234+
}
235+
224236
pub fn Sub(cx: Block,
225237
lhs: ValueRef,
226238
rhs: ValueRef,
@@ -269,6 +281,18 @@ pub fn FSub(cx: Block,
269281
B(cx).fsub(lhs, rhs)
270282
}
271283

284+
pub fn FSubFast(cx: Block,
285+
lhs: ValueRef,
286+
rhs: ValueRef,
287+
debug_loc: DebugLoc)
288+
-> ValueRef {
289+
if cx.unreachable.get() {
290+
return _Undef(lhs);
291+
}
292+
debug_loc.apply(cx.fcx);
293+
B(cx).fsub_fast(lhs, rhs)
294+
}
295+
272296
pub fn Mul(cx: Block,
273297
lhs: ValueRef,
274298
rhs: ValueRef,
@@ -317,6 +341,18 @@ pub fn FMul(cx: Block,
317341
B(cx).fmul(lhs, rhs)
318342
}
319343

344+
pub fn FMulFast(cx: Block,
345+
lhs: ValueRef,
346+
rhs: ValueRef,
347+
debug_loc: DebugLoc)
348+
-> ValueRef {
349+
if cx.unreachable.get() {
350+
return _Undef(lhs);
351+
}
352+
debug_loc.apply(cx.fcx);
353+
B(cx).fmul_fast(lhs, rhs)
354+
}
355+
320356
pub fn UDiv(cx: Block,
321357
lhs: ValueRef,
322358
rhs: ValueRef,
@@ -365,6 +401,18 @@ pub fn FDiv(cx: Block,
365401
B(cx).fdiv(lhs, rhs)
366402
}
367403

404+
pub fn FDivFast(cx: Block,
405+
lhs: ValueRef,
406+
rhs: ValueRef,
407+
debug_loc: DebugLoc)
408+
-> ValueRef {
409+
if cx.unreachable.get() {
410+
return _Undef(lhs);
411+
}
412+
debug_loc.apply(cx.fcx);
413+
B(cx).fdiv_fast(lhs, rhs)
414+
}
415+
368416
pub fn URem(cx: Block,
369417
lhs: ValueRef,
370418
rhs: ValueRef,
@@ -401,6 +449,18 @@ pub fn FRem(cx: Block,
401449
B(cx).frem(lhs, rhs)
402450
}
403451

452+
pub fn FRemFast(cx: Block,
453+
lhs: ValueRef,
454+
rhs: ValueRef,
455+
debug_loc: DebugLoc)
456+
-> ValueRef {
457+
if cx.unreachable.get() {
458+
return _Undef(lhs);
459+
}
460+
debug_loc.apply(cx.fcx);
461+
B(cx).frem_fast(lhs, rhs)
462+
}
463+
404464
pub fn Shl(cx: Block,
405465
lhs: ValueRef,
406466
rhs: ValueRef,

branches/beta/src/librustc_trans/trans/builder.rs

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,15 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
226226
}
227227
}
228228

229+
pub fn fadd_fast(&self, lhs: ValueRef, rhs: ValueRef) -> ValueRef {
230+
self.count_insn("fadd");
231+
unsafe {
232+
let instr = llvm::LLVMBuildFAdd(self.llbuilder, lhs, rhs, noname());
233+
llvm::LLVMRustSetHasUnsafeAlgebra(instr);
234+
instr
235+
}
236+
}
237+
229238
pub fn sub(&self, lhs: ValueRef, rhs: ValueRef) -> ValueRef {
230239
self.count_insn("sub");
231240
unsafe {
@@ -254,6 +263,15 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
254263
}
255264
}
256265

266+
pub fn fsub_fast(&self, lhs: ValueRef, rhs: ValueRef) -> ValueRef {
267+
self.count_insn("sub");
268+
unsafe {
269+
let instr = llvm::LLVMBuildFSub(self.llbuilder, lhs, rhs, noname());
270+
llvm::LLVMRustSetHasUnsafeAlgebra(instr);
271+
instr
272+
}
273+
}
274+
257275
pub fn mul(&self, lhs: ValueRef, rhs: ValueRef) -> ValueRef {
258276
self.count_insn("mul");
259277
unsafe {
@@ -282,6 +300,16 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
282300
}
283301
}
284302

303+
pub fn fmul_fast(&self, lhs: ValueRef, rhs: ValueRef) -> ValueRef {
304+
self.count_insn("fmul");
305+
unsafe {
306+
let instr = llvm::LLVMBuildFMul(self.llbuilder, lhs, rhs, noname());
307+
llvm::LLVMRustSetHasUnsafeAlgebra(instr);
308+
instr
309+
}
310+
}
311+
312+
285313
pub fn udiv(&self, lhs: ValueRef, rhs: ValueRef) -> ValueRef {
286314
self.count_insn("udiv");
287315
unsafe {
@@ -310,6 +338,15 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
310338
}
311339
}
312340

341+
pub fn fdiv_fast(&self, lhs: ValueRef, rhs: ValueRef) -> ValueRef {
342+
self.count_insn("fdiv");
343+
unsafe {
344+
let instr = llvm::LLVMBuildFDiv(self.llbuilder, lhs, rhs, noname());
345+
llvm::LLVMRustSetHasUnsafeAlgebra(instr);
346+
instr
347+
}
348+
}
349+
313350
pub fn urem(&self, lhs: ValueRef, rhs: ValueRef) -> ValueRef {
314351
self.count_insn("urem");
315352
unsafe {
@@ -331,6 +368,15 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
331368
}
332369
}
333370

371+
pub fn frem_fast(&self, lhs: ValueRef, rhs: ValueRef) -> ValueRef {
372+
self.count_insn("frem");
373+
unsafe {
374+
let instr = llvm::LLVMBuildFRem(self.llbuilder, lhs, rhs, noname());
375+
llvm::LLVMRustSetHasUnsafeAlgebra(instr);
376+
instr
377+
}
378+
}
379+
334380
pub fn shl(&self, lhs: ValueRef, rhs: ValueRef) -> ValueRef {
335381
self.count_insn("shl");
336382
unsafe {

0 commit comments

Comments
 (0)