Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 14 pull requests #32351

Merged
merged 30 commits into from
Mar 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
94ee40a
FreeBSD has already supported Cargo
tclfs Mar 15, 2016
178b280
syntax: impl ToTokens for P<ast::ImplItem>
richo Mar 15, 2016
6ed7846
Add comment about opt-in nature of compiletest note/help messages.
frewsxcv Mar 15, 2016
01d7609
docs: One typo
tclfs Mar 16, 2016
2910c00
Fix usability problem when browse document locally
bombless Mar 17, 2016
79244c3
`let` introduces a statement
tclfs Mar 17, 2016
a6e077e
documentation fix in RELEASES.md
benaryorg Mar 17, 2016
d7f80ca
rustbuild: Fix cross to netbsd from Linux
alexcrichton Mar 17, 2016
667d1c6
Minor phrasing adjustment
toddlucas Mar 18, 2016
74d00bd
Make AssertRecoverSafe's field public
sfackler Mar 18, 2016
fcaefcf
liveness: substitute bound regions with free ones before normalizing …
jonas-schievink Mar 18, 2016
9e1d659
Update LLVM to include a backport to restore AA performance
dotdash Mar 18, 2016
b3ade68
Add a since to deprecations
sfackler Mar 18, 2016
797d520
Fix tidy
sfackler Mar 18, 2016
2ab1f0a
Use explicit -march flags in the i586 mk file
petevine Mar 18, 2016
135d24d
Fix volatile stores of fat pointers
Amanieu Mar 19, 2016
8a13440
Rollup merge of #32265 - tclfs:patch-1, r=alexcrichton
eddyb Mar 19, 2016
8be1d7d
Rollup merge of #32269 - richo:impl-totokens-p-implitem, r=nikomatsakis
eddyb Mar 19, 2016
e28a1b6
Rollup merge of #32271 - frewsxcv:compiletest-ignored-help-note, r=ni…
eddyb Mar 19, 2016
33c28b4
Rollup merge of #32288 - tclfs:patch-2, r=apasel422
eddyb Mar 19, 2016
5a5b5f1
Rollup merge of #32308 - bombless:patch-2, r=alexcrichton
eddyb Mar 19, 2016
cb9b1b2
Rollup merge of #32316 - tclfs:patch-3, r=steveklabnik
eddyb Mar 19, 2016
472fe10
Rollup merge of #32319 - benaryorg:patch-3, r=alexcrichton
eddyb Mar 19, 2016
9413d90
Rollup merge of #32321 - alexcrichton:cross-to-netbsd, r=japaric
eddyb Mar 19, 2016
d5dceba
Rollup merge of #32327 - toddlucas:master, r=apasel422
eddyb Mar 19, 2016
b29e299
Rollup merge of #32329 - sfackler:assert-recover-safe-pub, r=aturon
eddyb Mar 19, 2016
34bd8f3
Rollup merge of #32332 - jonas-schievink:issue32323, r=arielb1
eddyb Mar 19, 2016
4a67405
Rollup merge of #32337 - dotdash:llvm-aa-perf, r=alexcrichton
eddyb Mar 19, 2016
835d2a9
Rollup merge of #32342 - petevine:patch-1, r=alexcrichton
eddyb Mar 19, 2016
5bf1e58
Rollup merge of #32347 - Amanieu:volatile_fat_ptr, r=eddyb
eddyb Mar 19, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ Compatibility Notes
that were not intended. In this release, [defaulted type parameters
appearing outside of type definitions will generate a
warning][1.7d], which will become an error in future releases.
* [Parsing "." as a float results in an error instead of
0][1.7p]. That is, `".".parse::<f32>()` returns `Err`, not `Ok(0)`.
* [Parsing "." as a float results in an error instead of 0][1.7p].
That is, `".".parse::<f32>()` returns `Err`, not `Ok(0.0)`.
* [Borrows of closure parameters may not outlive the closure][1.7bc].

[1.7a]: https://github.com/rust-lang/rust/pull/30928
Expand Down
6 changes: 3 additions & 3 deletions mk/cfg/i586-unknown-linux-gnu.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ CFG_LIB_NAME_i586-unknown-linux-gnu=lib$(1).so
CFG_STATIC_LIB_NAME_i586-unknown-linux-gnu=lib$(1).a
CFG_LIB_GLOB_i586-unknown-linux-gnu=lib$(1)-*.so
CFG_LIB_DSYM_GLOB_i586-unknown-linux-gnu=lib$(1)-*.dylib.dSYM
CFG_JEMALLOC_CFLAGS_i586-unknown-linux-gnu := -m32 $(CFLAGS)
CFG_GCCISH_CFLAGS_i586-unknown-linux-gnu := -Wall -Werror -g -fPIC -m32 $(CFLAGS)
CFG_GCCISH_CXXFLAGS_i586-unknown-linux-gnu := -fno-rtti $(CXXFLAGS)
CFG_JEMALLOC_CFLAGS_i586-unknown-linux-gnu := -m32 $(CFLAGS) -march=pentium
CFG_GCCISH_CFLAGS_i586-unknown-linux-gnu := -Wall -Werror -g -fPIC -m32 $(CFLAGS) -march=pentium
CFG_GCCISH_CXXFLAGS_i586-unknown-linux-gnu := -fno-rtti $(CXXFLAGS) -march=pentium
CFG_GCCISH_LINK_FLAGS_i586-unknown-linux-gnu := -shared -fPIC -ldl -pthread -lrt -g -m32
CFG_GCCISH_DEF_FLAG_i586-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list=
CFG_LLC_FLAGS_i586-unknown-linux-gnu :=
Expand Down
3 changes: 2 additions & 1 deletion src/bootstrap/build/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ pub fn compiler_rt(build: &Build, target: &str) {
let arch = target.split('-').next().unwrap();
let mode = if build.config.rust_optimize {"Release"} else {"Debug"};
let (dir, build_target, libname) = if target.contains("linux") ||
target.contains("freebsd") {
target.contains("freebsd") ||
target.contains("netbsd") {
let os = if target.contains("android") {"-android"} else {""};
let arch = if arch.starts_with("arm") && target.contains("eabihf") {
"armhf"
Expand Down
4 changes: 4 additions & 0 deletions src/compiletest/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,10 @@ fn check_expected_errors(revision: Option<&str>,
expected.replace(r"\", "/")
}).collect::<Vec<String>>();

// If the testcase being checked contains at least one expected "help"
// message, then we'll ensure that all "help" messages are expected.
// Otherwise, all "help" messages reported by the compiler will be ignored.
// This logic also applies to "note" messages.
let (expect_help, expect_note) =
expected_errors.iter()
.fold((false, false),
Expand Down
4 changes: 2 additions & 2 deletions src/doc/book/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ unofficial locations.
| `armv7-apple-ios` | ✓ | | | ARM iOS |
| `armv7s-apple-ios` | ✓ | | | ARM iOS |
| `aarch64-apple-ios` | ✓ | | | ARM64 iOS |
| `i686-unknown-freebsd` | ✓ | ✓ | | 32-bit FreeBSD |
| `x86_64-unknown-freebsd` | ✓ | ✓ | | 64-bit FreeBSD |
| `i686-unknown-freebsd` | ✓ | ✓ | | 32-bit FreeBSD |
| `x86_64-unknown-freebsd` | ✓ | ✓ | | 64-bit FreeBSD |
| `x86_64-unknown-openbsd` | ✓ | ✓ | | 64-bit OpenBSD |
| `x86_64-unknown-netbsd` | ✓ | ✓ | | 64-bit NetBSD |
| `x86_64-unknown-bitrig` | ✓ | ✓ | | 64-bit Bitrig |
Expand Down
2 changes: 1 addition & 1 deletion src/doc/book/guessing-game.md
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ returned by `parse()`, this is an `enum` like `Ordering`, but in this case,
each variant has some data associated with it: `Ok` is a success, and `Err` is a
failure. Each contains more information: the successfully parsed integer, or an
error type. In this case, we `match` on `Ok(num)`, which sets the name `num` to
the unwrapped `Ok` value (ythe integer), and then we return it on the
the unwrapped `Ok` value (the integer), and then we return it on the
right-hand side. In the `Err` case, we don’t care what kind of error it is, so
we just use the catch all `_` instead of a name. This catches everything that
isn't `Ok`, and `continue` lets us move to the next iteration of the loop; in
Expand Down
4 changes: 2 additions & 2 deletions src/doc/book/references-and-borrowing.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ both at the same time:
* exactly one mutable reference (`&mut T`).


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

> There is a ‘data race’ when two or more pointers access the same memory
> location at the same time, where at least one of them is writing, and the
Expand Down
4 changes: 2 additions & 2 deletions src/doc/book/variable-bindings.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ function, rather than leaving it off. Otherwise, you’ll get an error.

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

```rust
let (x, y) = (1, 2);
```

After this expression is evaluated, `x` will be one, and `y` will be two.
After this statement is evaluated, `x` will be one, and `y` will be two.
Patterns are really powerful, and have [their own section][pattern] in the
book. We don’t need those features for now, so we’ll keep this in the back
of our minds as we go forward.
Expand Down
4 changes: 3 additions & 1 deletion src/librustc/middle/liveness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ use middle::pat_util;
use middle::ty::{self, TyCtxt, ParameterEnvironment};
use middle::traits::{self, ProjectionMode};
use middle::infer;
use middle::subst::Subst;
use lint;
use util::nodemap::NodeMap;

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

let param_env = ParameterEnvironment::for_item(&self.ir.tcx, id);
let t_ret_subst = t_ret.subst(&self.ir.tcx, &param_env.free_substs);
let infcx = infer::new_infer_ctxt(&self.ir.tcx,
&self.ir.tcx.tables,
Some(param_env),
ProjectionMode::Any);
let cause = traits::ObligationCause::dummy();
let norm = traits::fully_normalize(&infcx,
cause,
&t_ret);
&t_ret_subst);

if norm.unwrap().is_nil() {
// for nil return types, it is ok to not return a value expl.
Expand Down
21 changes: 13 additions & 8 deletions src/librustc_trans/trans/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,15 +589,20 @@ pub fn trans_intrinsic_call<'a, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
},
(_, "volatile_store") => {
let tp_ty = *substs.types.get(FnSpace, 0);
let val = if fn_ty.args[1].is_indirect() {
Load(bcx, llargs[1])
if type_is_fat_ptr(bcx.tcx(), tp_ty) {
VolatileStore(bcx, llargs[1], expr::get_dataptr(bcx, llargs[0]));
VolatileStore(bcx, llargs[2], expr::get_meta(bcx, llargs[0]));
} else {
from_immediate(bcx, llargs[1])
};
let ptr = PointerCast(bcx, llargs[0], val_ty(val).ptr_to());
let store = VolatileStore(bcx, val, ptr);
unsafe {
llvm::LLVMSetAlignment(store, type_of::align_of(ccx, tp_ty));
let val = if fn_ty.args[1].is_indirect() {
Load(bcx, llargs[1])
} else {
from_immediate(bcx, llargs[1])
};
let ptr = PointerCast(bcx, llargs[0], val_ty(val).ptr_to());
let store = VolatileStore(bcx, val, ptr);
unsafe {
llvm::LLVMSetAlignment(store, type_of::align_of(ccx, tp_ty));
}
}
C_nil(ccx)
},
Expand Down
8 changes: 6 additions & 2 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,11 @@
$(".search-input").on("keyup input",function() {
clearTimeout(searchTimeout);
if ($(this).val().length === 0) {
window.history.replaceState("", "std - Rust", "?search=");
if (browserSupportsHistoryApi()) {
history.replaceState("", "std - Rust", "?search=");
} else {
location.replace("?search=");
}
$('#main.content').removeClass('hidden');
$('#search.content').addClass('hidden');
} else {
Expand Down Expand Up @@ -996,7 +1000,7 @@
var prev_id = 0;

function set_fragment(name) {
if (history.replaceState) {
if (browserSupportsHistoryApi()) {
history.replaceState(null, null, '#' + name);
$(window).trigger('hashchange');
} else {
Expand Down
8 changes: 4 additions & 4 deletions src/librustdoc/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,10 @@ fn runtest(test: &str, cratename: &str, cfgs: Vec<String>, libs: SearchPaths,
}

match {
let b_sess = AssertRecoverSafe::new(&sess);
let b_cstore = AssertRecoverSafe::new(&cstore);
let b_cfg = AssertRecoverSafe::new(cfg.clone());
let b_control = AssertRecoverSafe::new(&control);
let b_sess = AssertRecoverSafe(&sess);
let b_cstore = AssertRecoverSafe(&cstore);
let b_cfg = AssertRecoverSafe(cfg.clone());
let b_control = AssertRecoverSafe(&control);

panic::recover(|| {
driver::compile_input(&b_sess, &b_cstore, (*b_cfg).clone(),
Expand Down
10 changes: 7 additions & 3 deletions src/libstd/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ pub trait RefRecoverSafe {}
/// // });
///
/// // This, however, will compile due to the `AssertRecoverSafe` wrapper
/// let result = panic::recover(AssertRecoverSafe::new(|| {
/// let result = panic::recover(AssertRecoverSafe(|| {
/// variable += 3;
/// }));
/// // ...
Expand All @@ -185,15 +185,15 @@ pub trait RefRecoverSafe {}
/// let other_capture = 3;
///
/// let result = {
/// let mut wrapper = AssertRecoverSafe::new(&mut variable);
/// let mut wrapper = AssertRecoverSafe(&mut variable);
/// panic::recover(move || {
/// **wrapper += other_capture;
/// })
/// };
/// // ...
/// ```
#[unstable(feature = "recover", reason = "awaiting feedback", issue = "27719")]
pub struct AssertRecoverSafe<T>(T);
pub struct AssertRecoverSafe<T>(pub T);

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

/// Consumes the `AssertRecoverSafe`, returning the wrapped value.
#[unstable(feature = "recover", reason = "awaiting feedback", issue = "27719")]
#[rustc_deprecated(reason = "the type's field is now public, access it directly",
since = "1.9.0")]
pub fn into_inner(self) -> T {
self.0
}
Expand Down
6 changes: 6 additions & 0 deletions src/libsyntax/ext/quote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ pub mod rt {
}
}

impl ToTokens for P<ast::ImplItem> {
fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {
vec![TokenTree::Token(self.span, token::Interpolated(token::NtImplItem(self.clone())))]
}
}

impl ToTokens for ast::TraitItem {
fn to_tokens(&self, _cx: &ExtCtxt) -> Vec<TokenTree> {
vec![TokenTree::Token(self.span,
Expand Down
2 changes: 1 addition & 1 deletion src/rustllvm/llvm-auto-clean-trigger
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# If this file is modified, then llvm will be forcibly cleaned and then rebuilt.
# The actual contents of this file do not matter, but to trigger a change on the
# build bots then the contents should be changed so git updates the mtime.
2016-03-15
2016-03-18
18 changes: 18 additions & 0 deletions src/test/compile-fail/issue-32323.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

pub trait Tr<'a> {
type Out;
}

pub fn f<'a, T: Tr<'a>>() -> <T as Tr<'a>>::Out {}
//~^ ERROR not all control paths return a value

pub fn main() {}
2 changes: 1 addition & 1 deletion src/test/run-pass/binary-heap-panic-safe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ fn test_integrity() {
{
// push the panicking item to the heap and catch the panic
let thread_result = {
let mut heap_ref = AssertRecoverSafe::new(&mut heap);
let mut heap_ref = AssertRecoverSafe(&mut heap);
panic::recover(move || {
heap_ref.push(panic_item);
})
Expand Down
22 changes: 22 additions & 0 deletions src/test/run-pass/volatile-fat-ptr.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(volatile)]
use std::ptr::{read_volatile, write_volatile};

fn main() {
let mut x: &'static str = "test";
unsafe {
let a = read_volatile(&x);
assert_eq!(a, "test");
write_volatile(&mut x, "foo");
assert_eq!(x, "foo");
}
}