Skip to content

Commit 7c66a89

Browse files
committed
Auto merge of #32351 - eddyb:rollup, r=eddyb
Rollup of 14 pull requests - Successful merges: #32265, #32269, #32271, #32288, #32308, #32316, #32319, #32321, #32327, #32329, #32332, #32337, #32342, #32347 - Failed merges:
2 parents b854149 + 5bf1e58 commit 7c66a89

File tree

19 files changed

+100
-34
lines changed

19 files changed

+100
-34
lines changed

RELEASES.md

+2-2
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

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

+3-3
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 :=

src/bootstrap/build/native.rs

+2-1
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"

src/compiletest/runtest.rs

+4
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),

src/doc/book/getting-started.md

+2-2
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 |

src/doc/book/guessing-game.md

+1-1
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

src/doc/book/references-and-borrowing.md

+2-2
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

src/doc/book/variable-bindings.md

+2-2
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.

src/librustc/middle/liveness.rs

+3-1
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.

src/librustc_trans/trans/intrinsic.rs

+13-8
Original file line numberDiff line numberDiff line change
@@ -589,15 +589,20 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
589589
},
590590
(_, "volatile_store") => {
591591
let tp_ty = *substs.types.get(FnSpace, 0);
592-
let val = if fn_ty.args[1].is_indirect() {
593-
Load(bcx, llargs[1])
592+
if type_is_fat_ptr(bcx.tcx(), tp_ty) {
593+
VolatileStore(bcx, llargs[1], expr::get_dataptr(bcx, llargs[0]));
594+
VolatileStore(bcx, llargs[2], expr::get_meta(bcx, llargs[0]));
594595
} else {
595-
from_immediate(bcx, llargs[1])
596-
};
597-
let ptr = PointerCast(bcx, llargs[0], val_ty(val).ptr_to());
598-
let store = VolatileStore(bcx, val, ptr);
599-
unsafe {
600-
llvm::LLVMSetAlignment(store, type_of::align_of(ccx, tp_ty));
596+
let val = if fn_ty.args[1].is_indirect() {
597+
Load(bcx, llargs[1])
598+
} else {
599+
from_immediate(bcx, llargs[1])
600+
};
601+
let ptr = PointerCast(bcx, llargs[0], val_ty(val).ptr_to());
602+
let store = VolatileStore(bcx, val, ptr);
603+
unsafe {
604+
llvm::LLVMSetAlignment(store, type_of::align_of(ccx, tp_ty));
605+
}
601606
}
602607
C_nil(ccx)
603608
},

src/librustdoc/html/static/main.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,11 @@
740740
$(".search-input").on("keyup input",function() {
741741
clearTimeout(searchTimeout);
742742
if ($(this).val().length === 0) {
743-
window.history.replaceState("", "std - Rust", "?search=");
743+
if (browserSupportsHistoryApi()) {
744+
history.replaceState("", "std - Rust", "?search=");
745+
} else {
746+
location.replace("?search=");
747+
}
744748
$('#main.content').removeClass('hidden');
745749
$('#search.content').addClass('hidden');
746750
} else {
@@ -996,7 +1000,7 @@
9961000
var prev_id = 0;
9971001

9981002
function set_fragment(name) {
999-
if (history.replaceState) {
1003+
if (browserSupportsHistoryApi()) {
10001004
history.replaceState(null, null, '#' + name);
10011005
$(window).trigger('hashchange');
10021006
} else {

src/librustdoc/test.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,10 @@ fn runtest(test: &str, cratename: &str, cfgs: Vec<String>, libs: SearchPaths,
257257
}
258258

259259
match {
260-
let b_sess = AssertRecoverSafe::new(&sess);
261-
let b_cstore = AssertRecoverSafe::new(&cstore);
262-
let b_cfg = AssertRecoverSafe::new(cfg.clone());
263-
let b_control = AssertRecoverSafe::new(&control);
260+
let b_sess = AssertRecoverSafe(&sess);
261+
let b_cstore = AssertRecoverSafe(&cstore);
262+
let b_cfg = AssertRecoverSafe(cfg.clone());
263+
let b_control = AssertRecoverSafe(&control);
264264

265265
panic::recover(|| {
266266
driver::compile_input(&b_sess, &b_cstore, (*b_cfg).clone(),

src/libstd/panic.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ pub trait RefRecoverSafe {}
161161
/// // });
162162
///
163163
/// // This, however, will compile due to the `AssertRecoverSafe` wrapper
164-
/// let result = panic::recover(AssertRecoverSafe::new(|| {
164+
/// let result = panic::recover(AssertRecoverSafe(|| {
165165
/// variable += 3;
166166
/// }));
167167
/// // ...
@@ -185,15 +185,15 @@ pub trait RefRecoverSafe {}
185185
/// let other_capture = 3;
186186
///
187187
/// let result = {
188-
/// let mut wrapper = AssertRecoverSafe::new(&mut variable);
188+
/// let mut wrapper = AssertRecoverSafe(&mut variable);
189189
/// panic::recover(move || {
190190
/// **wrapper += other_capture;
191191
/// })
192192
/// };
193193
/// // ...
194194
/// ```
195195
#[unstable(feature = "recover", reason = "awaiting feedback", issue = "27719")]
196-
pub struct AssertRecoverSafe<T>(T);
196+
pub struct AssertRecoverSafe<T>(pub T);
197197

198198
// Implementations of the `RecoverSafe` trait:
199199
//
@@ -230,12 +230,16 @@ impl<T> RefRecoverSafe for AssertRecoverSafe<T> {}
230230
impl<T> AssertRecoverSafe<T> {
231231
/// Creates a new `AssertRecoverSafe` wrapper around the provided type.
232232
#[unstable(feature = "recover", reason = "awaiting feedback", issue = "27719")]
233+
#[rustc_deprecated(reason = "the type's field is now public, construct it directly",
234+
since = "1.9.0")]
233235
pub fn new(t: T) -> AssertRecoverSafe<T> {
234236
AssertRecoverSafe(t)
235237
}
236238

237239
/// Consumes the `AssertRecoverSafe`, returning the wrapped value.
238240
#[unstable(feature = "recover", reason = "awaiting feedback", issue = "27719")]
241+
#[rustc_deprecated(reason = "the type's field is now public, access it directly",
242+
since = "1.9.0")]
239243
pub fn into_inner(self) -> T {
240244
self.0
241245
}

src/libsyntax/ext/quote.rs

+6
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,12 @@ pub mod rt {
121121
}
122122
}
123123

124+
impl ToTokens for P<ast::ImplItem> {
125+
fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {
126+
vec![TokenTree::Token(self.span, token::Interpolated(token::NtImplItem(self.clone())))]
127+
}
128+
}
129+
124130
impl ToTokens for ast::TraitItem {
125131
fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {
126132
vec![TokenTree::Token(self.span,

src/rustllvm/llvm-auto-clean-trigger

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# If this file is modified, then llvm will be forcibly cleaned and then rebuilt.
22
# The actual contents of this file do not matter, but to trigger a change on the
33
# build bots then the contents should be changed so git updates the mtime.
4-
2016-03-15
4+
2016-03-18

src/test/compile-fail/issue-32323.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
pub trait Tr<'a> {
12+
type Out;
13+
}
14+
15+
pub fn f<'a, T: Tr<'a>>() -> <T as Tr<'a>>::Out {}
16+
//~^ ERROR not all control paths return a value
17+
18+
pub fn main() {}

src/test/run-pass/binary-heap-panic-safe.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ fn test_integrity() {
7070
{
7171
// push the panicking item to the heap and catch the panic
7272
let thread_result = {
73-
let mut heap_ref = AssertRecoverSafe::new(&mut heap);
73+
let mut heap_ref = AssertRecoverSafe(&mut heap);
7474
panic::recover(move || {
7575
heap_ref.push(panic_item);
7676
})

src/test/run-pass/volatile-fat-ptr.rs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![feature(volatile)]
12+
use std::ptr::{read_volatile, write_volatile};
13+
14+
fn main() {
15+
let mut x: &'static str = "test";
16+
unsafe {
17+
let a = read_volatile(&x);
18+
assert_eq!(a, "test");
19+
write_volatile(&mut x, "foo");
20+
assert_eq!(x, "foo");
21+
}
22+
}

0 commit comments

Comments
 (0)