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 15 pull requests #37002

Merged
merged 42 commits into from
Oct 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
42a5a06
Touch up formatting for variance README.md
cbreeden Sep 25, 2016
cb22364
Merge E0002 into E0004
GuillaumeGomez Oct 2, 2016
f320004
incr.comp.: Add test case for dependency graph of type aliases.
michaelwoerister Oct 3, 2016
ae51ccf
SimplifyCfg: simplify the start block
arielb1 Oct 4, 2016
44ac016
SimplifyCfg: don't incref target when collapsing a goto with 1 pred
arielb1 Oct 4, 2016
29212ec
Assign internal linkage to autogenerated FnOnce::call_once() instances.
michaelwoerister Oct 4, 2016
4570199
Add symbol hash to trans::partitioning debug output.
michaelwoerister Oct 4, 2016
cd7a04c
rustdoc: Fix missing *mut T impl
ollie27 Oct 4, 2016
bfdf437
update tests
arielb1 Oct 4, 2016
2d34ad0
trans: Make sure that each FnOnce shim is only translated once.
michaelwoerister Oct 4, 2016
4922abf
Haiku: Fix IPv6 target_os check
kallisti5 Oct 4, 2016
7bbfac6
update sip.rs for new intrinsics and defaults
edre Oct 4, 2016
335d393
Minor modifications in concurrency section of the Rust book
nikhilshagri Oct 4, 2016
51ef2b3
rustbuild: Fix bug preventing per-target musl-root
nastevens Oct 5, 2016
7937f6c
rustbuild: Fix panic message when musl-root not set
nastevens Oct 5, 2016
9081c00
ICH - Add test cases for function interfaces
Oct 3, 2016
e051eb3
ICH - Include omitted elements in inc. comp. hash #36914
Oct 4, 2016
14fe7ce
Adjustments due to naming changes in Ty_ and PatKind structs
Oct 5, 2016
6d54e0e
emit !nonnull metadata on loaded fat pointers when possible
arielb1 Oct 4, 2016
9233366
clean up misc. uses of get_dataptr/get_meta
arielb1 Oct 4, 2016
45fe3a1
emit an assume that cast-from enums are in range
arielb1 Oct 4, 2016
8d06332
Fixed small typo in `BufRead` comments
Razican Oct 5, 2016
a4e9c39
Clarify last element in str.{r,}splitn documentation
angelsl Oct 3, 2016
4b5a9a3
ICH: update saw_ty for TyBareFn; Update tests for functioninterfaces
Oct 5, 2016
6f64296
Merge branch 'master' into mb/36812_ICHFunctionInterfaces
Oct 5, 2016
0e40dbb
ICH: Remove obsolete binding in saw_ty
Oct 6, 2016
cb700e7
Add testcase for issue-32948
ParkHanbum Sep 29, 2016
d3bb568
Rollup merge of #36726 - cbreeden:patch-1, r=GuillaumeGomez
Oct 6, 2016
09712d7
Rollup merge of #36832 - ParkHanbum:master, r=michaelwoerister
Oct 6, 2016
5a199bf
Rollup merge of #36909 - GuillaumeGomez:merge_e0002_e0004, r=arielb1
Oct 6, 2016
91106f7
Rollup merge of #36930 - angelsl:issue-36202, r=frewsxcv
Oct 6, 2016
5dcd71f
Rollup merge of #36932 - michaelwoerister:type-alias-dep-graph-test, …
Oct 6, 2016
534a2b5
Rollup merge of #36957 - cynicaldevil:docs, r=frewsxcv
Oct 6, 2016
9f1089b
Rollup merge of #36959 - arielb1:simplify-cfg-fixes, r=eddyb
Oct 6, 2016
1a7aa75
Rollup merge of #36960 - michaelwoerister:linker-regression, r=eddyb
Oct 6, 2016
ed5a3c0
Rollup merge of #36962 - arielb1:cast-assumptions, r=eddyb
Oct 6, 2016
0698929
Rollup merge of #36965 - kallisti5:master, r=alexcrichton
Oct 6, 2016
4c10026
Rollup merge of #36966 - ollie27:rustdoc_mut_ptr_impl, r=alexcrichton
Oct 6, 2016
a19e22e
Rollup merge of #36967 - edre:master, r=alexcrichton
Oct 6, 2016
9ceef4e
Rollup merge of #36972 - nastevens:fix-rustbuild-per-target-musl-root…
Oct 6, 2016
2c8c0de
Rollup merge of #36974 - MathieuBordere:mb/36812_ICHFunctionInterface…
Oct 6, 2016
89aebdb
Rollup merge of #36977 - Razican:bufreader_typo_fix, r=alexcrichton
Oct 6, 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
6 changes: 3 additions & 3 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@ pub fn std_link(build: &Build,
add_to_sysroot(&out_dir, &libdir);

if target.contains("musl") && !target.contains("mips") {
copy_musl_third_party_objects(build, &libdir);
copy_musl_third_party_objects(build, target, &libdir);
}
}

/// Copies the crt(1,i,n).o startup objects
///
/// Only required for musl targets that statically link to libc
fn copy_musl_third_party_objects(build: &Build, into: &Path) {
fn copy_musl_third_party_objects(build: &Build, target: &str, into: &Path) {
for &obj in &["crt1.o", "crti.o", "crtn.o"] {
copy(&build.config.musl_root.as_ref().unwrap().join("lib").join(obj), &into.join(obj));
copy(&build.musl_root(target).unwrap().join("lib").join(obj), &into.join(obj));
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ struct TomlTarget {
cc: Option<String>,
cxx: Option<String>,
android_ndk: Option<String>,
musl_root: Option<String>,
}

impl Config {
Expand Down Expand Up @@ -268,6 +269,7 @@ impl Config {
}
target.cxx = cfg.cxx.clone().map(PathBuf::from);
target.cc = cfg.cc.clone().map(PathBuf::from);
target.musl_root = cfg.musl_root.clone().map(PathBuf::from);

config.target_config.insert(triple.clone(), target);
}
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ pub fn check(build: &mut Build) {
}
}
None => {
panic!("when targeting MUSL either the build.musl-root \
option or the target.$TARGET.musl-root one must \
panic!("when targeting MUSL either the rust.musl-root \
option or the target.$TARGET.musl-root option must \
be specified in config.toml")
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/doc/book/concurrency.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Concurrency and parallelism are incredibly important topics in computer
science, and are also a hot topic in industry today. Computers are gaining more
and more cores, yet many programmers aren't prepared to fully utilize them.

Rust's memory safety features also apply to its concurrency story too. Even
Rust's memory safety features also apply to its concurrency story. Even
concurrent Rust programs must be memory safe, having no data races. Rust's type
system is up to the task, and gives you powerful ways to reason about
concurrent code at compile time.
Expand Down Expand Up @@ -281,8 +281,8 @@ And... still gives us an error.
```

`Arc<T>` by default has immutable contents. It allows the _sharing_ of data
between threads, but shared mutable data is unsafe and when threads are
involved can cause data races!
between threads, but shared mutable data is unsafeand when threads are
involvedcan cause data races!


Usually when we wish to make something in an immutable position mutable, we use
Expand Down
20 changes: 10 additions & 10 deletions src/libcollections/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1053,10 +1053,10 @@ impl str {
}

/// An iterator over substrings of the given string slice, separated by a
/// pattern, restricted to returning at most `count` items.
/// pattern, restricted to returning at most `n` items.
///
/// The last element returned, if any, will contain the remainder of the
/// string slice.
/// If `n` substrings are returned, the last substring (the `n`th substring)
/// will contain the remainder of the string.
///
/// The pattern can be a `&str`, [`char`], or a closure that determines the
/// split.
Expand Down Expand Up @@ -1098,16 +1098,16 @@ impl str {
/// assert_eq!(v, ["abc", "defXghi"]);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn splitn<'a, P: Pattern<'a>>(&'a self, count: usize, pat: P) -> SplitN<'a, P> {
core_str::StrExt::splitn(self, count, pat)
pub fn splitn<'a, P: Pattern<'a>>(&'a self, n: usize, pat: P) -> SplitN<'a, P> {
core_str::StrExt::splitn(self, n, pat)
}

/// An iterator over substrings of this string slice, separated by a
/// pattern, starting from the end of the string, restricted to returning
/// at most `count` items.
/// at most `n` items.
///
/// The last element returned, if any, will contain the remainder of the
/// string slice.
/// If `n` substrings are returned, the last substring (the `n`th substring)
/// will contain the remainder of the string.
///
/// The pattern can be a `&str`, [`char`], or a closure that
/// determines the split.
Expand Down Expand Up @@ -1145,10 +1145,10 @@ impl str {
/// assert_eq!(v, ["ghi", "abc1def"]);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn rsplitn<'a, P: Pattern<'a>>(&'a self, count: usize, pat: P) -> RSplitN<'a, P>
pub fn rsplitn<'a, P: Pattern<'a>>(&'a self, n: usize, pat: P) -> RSplitN<'a, P>
where P::Searcher: ReverseSearcher<'a>
{
core_str::StrExt::rsplitn(self, count, pat)
core_str::StrExt::rsplitn(self, n, pat)
}

/// An iterator over the matches of a pattern within the given string
Expand Down
23 changes: 9 additions & 14 deletions src/libcore/hash/sip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ use ptr;

/// An implementation of SipHash 1-3.
///
/// This is currently the default hashing function used by standard library
/// (eg. `collections::HashMap` uses it by default).
///
/// See: https://131002.net/siphash/
#[unstable(feature = "sip_hash_13", issue = "34767")]
#[rustc_deprecated(since = "1.13.0", reason = "use `DefaultHasher` instead")]
Expand All @@ -39,9 +42,6 @@ pub struct SipHasher24 {
///
/// See: https://131002.net/siphash/
///
/// This is currently the default hashing function used by standard library
/// (eg. `collections::HashMap` uses it by default).
///
/// SipHash is a general-purpose hashing function: it runs at a good
/// speed (competitive with Spooky and City) and permits strong _keyed_
/// hashing. This lets you key your hashtables from a strong RNG, such as
Expand Down Expand Up @@ -117,23 +117,18 @@ unsafe fn load_u64_le(buf: &[u8], i: usize) -> u64 {
data.to_le()
}

macro_rules! rotl {
($x:expr, $b:expr) =>
(($x << $b) | ($x >> (64_i32.wrapping_sub($b))))
}

macro_rules! compress {
($state:expr) => ({
compress!($state.v0, $state.v1, $state.v2, $state.v3)
});
($v0:expr, $v1:expr, $v2:expr, $v3:expr) =>
({
$v0 = $v0.wrapping_add($v1); $v1 = rotl!($v1, 13); $v1 ^= $v0;
$v0 = rotl!($v0, 32);
$v2 = $v2.wrapping_add($v3); $v3 = rotl!($v3, 16); $v3 ^= $v2;
$v0 = $v0.wrapping_add($v3); $v3 = rotl!($v3, 21); $v3 ^= $v0;
$v2 = $v2.wrapping_add($v1); $v1 = rotl!($v1, 17); $v1 ^= $v2;
$v2 = rotl!($v2, 32);
$v0 = $v0.wrapping_add($v1); $v1 = $v1.rotate_left(13); $v1 ^= $v0;
$v0 = $v0.rotate_left(32);
$v2 = $v2.wrapping_add($v3); $v3 = $v3.rotate_left(16); $v3 ^= $v2;
$v0 = $v0.wrapping_add($v3); $v3 = $v3.rotate_left(21); $v3 ^= $v0;
$v2 = $v2.wrapping_add($v1); $v1 = $v1.rotate_left(17); $v1 ^= $v2;
$v2 = $v2.rotate_left(32);
});
}

Expand Down
22 changes: 15 additions & 7 deletions src/librustc_const_eval/check_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ use rustc::middle::expr_use_visitor::{LoanCause, MutateMode};
use rustc::middle::expr_use_visitor as euv;
use rustc::middle::mem_categorization::{cmt};
use rustc::hir::pat_util::*;
use rustc::session::Session;
use rustc::traits::Reveal;
use rustc::ty::{self, Ty, TyCtxt};
use rustc_errors::DiagnosticBuilder;
use std::cmp::Ordering;
use std::fmt;
use std::iter::{FromIterator, IntoIterator, repeat};
Expand Down Expand Up @@ -163,6 +165,10 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
tcx.sess.abort_if_errors();
}

fn create_e0004<'a>(sess: &'a Session, sp: Span, error_message: String) -> DiagnosticBuilder<'a> {
struct_span_err!(sess, sp, E0004, "{}", &error_message)
}

fn check_expr(cx: &mut MatchCheckCtxt, ex: &hir::Expr) {
intravisit::walk_expr(cx, ex);
match ex.node {
Expand Down Expand Up @@ -215,9 +221,10 @@ fn check_expr(cx: &mut MatchCheckCtxt, ex: &hir::Expr) {
if inlined_arms.is_empty() {
if !pat_ty.is_uninhabited(cx.tcx) {
// We know the type is inhabited, so this must be wrong
let mut err = struct_span_err!(cx.tcx.sess, ex.span, E0002,
"non-exhaustive patterns: type {} is non-empty",
pat_ty);
let mut err = create_e0004(cx.tcx.sess, ex.span,
format!("non-exhaustive patterns: type {} \
is non-empty",
pat_ty));
span_help!(&mut err, ex.span,
"Please ensure that all possible cases are being handled; \
possibly adding wildcards or more match arms.");
Expand Down Expand Up @@ -438,10 +445,11 @@ fn check_exhaustive<'a, 'tcx>(cx: &MatchCheckCtxt<'a, 'tcx>,
1 => format!("pattern {} not covered", joined_patterns),
_ => format!("patterns {} not covered", joined_patterns)
};
struct_span_err!(cx.tcx.sess, sp, E0004,
"non-exhaustive patterns: {} not covered",
joined_patterns
).span_label(sp, &label_text).emit();
create_e0004(cx.tcx.sess, sp,
format!("non-exhaustive patterns: {} not covered",
joined_patterns))
.span_label(sp, &label_text)
.emit();
},
}
}
Expand Down
Loading