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 22 pull requests #44369

Closed
wants to merge 64 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
c589f86
Add clamp functions
Xaeroxe Aug 26, 2017
f74c5d2
Add NAN examples
Xaeroxe Aug 26, 2017
61f20f8
Fix f32 examples.
Xaeroxe Aug 26, 2017
576426a
Fix f64 examples
Xaeroxe Aug 26, 2017
1d69c98
update unimplemented! docs
MarkMcCaskey Aug 31, 2017
de038b7
Add full git commit hash to release channel manifests
SimonSapin Aug 31, 2017
e572d85
Merge branch 'master' into master
MarkMcCaskey Aug 31, 2017
abc11c3
Properly detect overflow in Instance +/- Duration.
kennytm Aug 31, 2017
d308b0b
Add support for Vector Multiply Add Saturated on PowerPC
lu-zero Aug 4, 2017
078c3dd
Add support for Vector Multiply Sum on PowerPC
lu-zero Aug 4, 2017
cccf3e7
Add support for Vector Multiply Sum Saturated on PowerPC
lu-zero Aug 4, 2017
2e34ff7
Fix documentation and formatting.
Xaeroxe Sep 1, 2017
9abc549
Add git-commit-hash in source and extended tarballs too.
SimonSapin Sep 1, 2017
ad5fc2a
Add test for #35676
mattico Sep 2, 2017
f2250c4
Add test for #33185
mattico Sep 2, 2017
570ae39
Merge branch 'master' of git://github.com/rust-lang/rust
MarkMcCaskey Sep 2, 2017
ef8c204
Fix incorrect test in `time::tests::system_time_math`.
kennytm Sep 3, 2017
4260e43
impl Debug for SplitWhitespace.
Sep 3, 2017
cf318c3
bootstrap: use shasum(1) on NetBSD build hosts
jakllsch Aug 31, 2017
ab89870
bootstrap: use tar -z on extract
jakllsch Aug 31, 2017
9412fd7
Only include git-commit-hash in tarballs when available
SimonSapin Sep 4, 2017
49f1fc5
Add test for #22706
Dushistov Sep 4, 2017
fcefe36
bootstrap: only include docs in extended distribution if enabled
jakllsch Sep 4, 2017
b8cf07e
Improve DefIndex formatting to be more semantic
est31 Sep 4, 2017
69c4728
Make slice::split_at_mut example demonstrate mutability
nielsegberts Sep 4, 2017
76fae71
Fix tests
est31 Sep 4, 2017
e90f423
#33490 is closed remove the FIXME
Eh2406 Sep 4, 2017
b88ec73
#12808 is closed remove the FIXME
Eh2406 Sep 5, 2017
1c5bf24
std/time: Give an example to get UNIX_EPOCH in seconds
kallisti5 Sep 4, 2017
7d94ca6
Removed the incorrect documentation for from_str
mcomstock Sep 5, 2017
b762283
Add panic unit tests
Xaeroxe Sep 5, 2017
280e6d8
Fix link typo in 1.20.0 release notes
WiSaGaN Sep 5, 2017
f912d77
Make git commit info optional and per-package in channel manifests
SimonSapin Sep 4, 2017
668d8ff
Add support for Vector Sum Across Partial 1/2 Saturated on PowerPC
lu-zero Aug 4, 2017
eec1c17
Add support for Vector Sum Across Partial 1/4 Saturated on PowerPC
lu-zero Aug 4, 2017
c3041e8
Add support for Vector Sum Saturated on PowerPC
lu-zero Aug 4, 2017
110efe2
Include rustc in the default `./x.py install`
cuviper Sep 5, 2017
2047a0d
bootstrap: add openssl config for sparc64-unknown-netbsd
jakllsch Aug 31, 2017
847d1ff
bootstrap: avoid m4 -B for NetBSD-built sparc64 OpenSSL
jakllsch Aug 31, 2017
ddd0145
Suggest changing literals instead of calling methods (fixes #44307)
oli-obk Sep 6, 2017
02fb1b0
Fix a bug in the inliner
oli-obk Sep 6, 2017
5bb870f
Reintroduce the early returns
oli-obk Sep 6, 2017
98b1d8c
Rollup merge of #44097 - Xaeroxe:clamp, r=burntsushi
Mark-Simulacrum Sep 6, 2017
0420654
Rollup merge of #44206 - MarkMcCaskey:master, r=steveklabnik
Mark-Simulacrum Sep 6, 2017
124ea4a
Rollup merge of #44218 - SimonSapin:commit-hash, r=alexcrichton
Mark-Simulacrum Sep 6, 2017
4b4f518
Rollup merge of #44220 - kennytm:fix-44216-instance-plus-max-duration…
Mark-Simulacrum Sep 6, 2017
6926df0
Rollup merge of #44276 - mattico:test-35376, r=alexcrichton
Mark-Simulacrum Sep 6, 2017
65ad47d
Rollup merge of #44277 - mattico:test-33185, r=nikomatsakis
Mark-Simulacrum Sep 6, 2017
3602c6f
Rollup merge of #44303 - clarcharr:debugs, r=alexcrichton
Mark-Simulacrum Sep 6, 2017
dc5c94d
Rollup merge of #44315 - kallisti5:epoch-doc-example-squashed, r=Guil…
Mark-Simulacrum Sep 6, 2017
2d1b62e
Rollup merge of #44317 - Dushistov:master, r=arielb1
Mark-Simulacrum Sep 6, 2017
a784c33
Rollup merge of #44319 - est31:master, r=eddyb
Mark-Simulacrum Sep 6, 2017
a660f0c
Rollup merge of #44320 - jakllsch:jakllsch-caf2c3d2-c939-4c4d-8c68-1a…
Mark-Simulacrum Sep 6, 2017
bc52d58
Rollup merge of #44321 - jakllsch:jakllsch-4f2d6c87-2674-43e4-9c5f-24…
Mark-Simulacrum Sep 6, 2017
68e8c40
Rollup merge of #44325 - nielsegberts:master, r=steveklabnik
Mark-Simulacrum Sep 6, 2017
78986dc
Rollup merge of #44326 - Eh2406:FIXME#44590, r=arielb1
Mark-Simulacrum Sep 6, 2017
02d3bdd
Rollup merge of #44327 - Eh2406:FIXME#12808, r=aturon
Mark-Simulacrum Sep 6, 2017
adcc1f0
Rollup merge of #44328 - mcomstock:from-str-doc-fix, r=steveklabnik
Mark-Simulacrum Sep 6, 2017
531f0da
Rollup merge of #44330 - WiSaGaN:patch-1, r=aturon
Mark-Simulacrum Sep 6, 2017
4526725
Rollup merge of #44351 - lu-zero:master, r=nikomatsakis
Mark-Simulacrum Sep 6, 2017
c447c3b
Rollup merge of #44353 - cuviper:install-rustc, r=Mark-Simulacrum
Mark-Simulacrum Sep 6, 2017
ed952d8
Rollup merge of #44354 - jakllsch:jakllsch-85453197-a0cc-43f6-8c55-7b…
Mark-Simulacrum Sep 6, 2017
7232d12
Rollup merge of #44361 - oli-obk:lit_sugg, r=nikomatsakis
Mark-Simulacrum Sep 6, 2017
ab729fb
Rollup merge of #44362 - oli-obk:patch-7, r=eddyb
Mark-Simulacrum Sep 6, 2017
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
2 changes: 1 addition & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Compatibility Notes
[`slice::sort_unstable_by_key`]: https://doc.rust-lang.org/std/primitive.slice.html#method.sort_unstable_by_key
[`slice::sort_unstable_by`]: https://doc.rust-lang.org/std/primitive.slice.html#method.sort_unstable_by
[`slice::sort_unstable`]: https://doc.rust-lang.org/std/primitive.slice.html#method.sort_unstable
[`ste::from_boxed_utf8_unchecked`]: https://doc.rust-lang.org/std/str/fn.from_boxed_utf8_unchecked.html
[`str::from_boxed_utf8_unchecked`]: https://doc.rust-lang.org/std/str/fn.from_boxed_utf8_unchecked.html
[`str::as_bytes_mut`]: https://doc.rust-lang.org/std/primitive.str.html#method.as_bytes_mut
[`str::from_utf8_mut`]: https://doc.rust-lang.org/std/str/fn.from_utf8_mut.html
[`str::from_utf8_unchecked_mut`]: https://doc.rust-lang.org/std/str/fn.from_utf8_unchecked_mut.html
Expand Down
14 changes: 13 additions & 1 deletion src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,9 @@ impl Step for Rustc {
// tiny morsel of metadata is used by rust-packaging
let version = build.rust_version();
t!(t!(File::create(overlay.join("version"))).write_all(version.as_bytes()));
if let Some(sha) = build.rust_sha() {
t!(t!(File::create(overlay.join("git-commit-hash"))).write_all(sha.as_bytes()));
}

// On MinGW we've got a few runtime DLL dependencies that we need to
// include. The first argument to this script is where to put these DLLs
Expand Down Expand Up @@ -844,6 +847,9 @@ impl Step for PlainSourceTarball {

// Create the version file
write_file(&plain_dst_src.join("version"), build.rust_version().as_bytes());
if let Some(sha) = build.rust_sha() {
write_file(&plain_dst_src.join("git-commit-hash"), sha.as_bytes());
}

// If we're building from git sources, we need to vendor a complete distribution.
if build.rust_info.is_git() {
Expand Down Expand Up @@ -1157,14 +1163,20 @@ impl Step for Extended {
install(&build.src.join("LICENSE-MIT"), &overlay, 0o644);
let version = build.rust_version();
t!(t!(File::create(overlay.join("version"))).write_all(version.as_bytes()));
if let Some(sha) = build.rust_sha() {
t!(t!(File::create(overlay.join("git-commit-hash"))).write_all(sha.as_bytes()));
}
install(&etc.join("README.md"), &overlay, 0o644);

// When rust-std package split from rustc, we needed to ensure that during
// upgrades rustc was upgraded before rust-std. To avoid rustc clobbering
// the std files during uninstall. To do this ensure that rustc comes
// before rust-std in the list below.
let mut tarballs = vec![rustc_installer, cargo_installer, rls_installer,
analysis_installer, docs_installer, std_installer];
analysis_installer, std_installer];
if build.config.docs {
tarballs.push(docs_installer);
}
if target.contains("pc-windows-gnu") {
tarballs.push(mingw_installer.unwrap());
}
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ install!((self, builder, _config),
builder.ensure(dist::Src);
install_src(builder, self.stage);
}, ONLY_BUILD;
Rustc, "src/librustc", _config.extended, only_hosts: true, {
Rustc, "src/librustc", true, only_hosts: true, {
builder.ensure(dist::Rustc {
compiler: builder.compiler(self.stage, self.target),
});
Expand Down
5 changes: 5 additions & 0 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,11 @@ impl Build {
self.rust_info.version(self, channel::CFG_RELEASE_NUM)
}

/// Return the full commit hash
fn rust_sha(&self) -> Option<&str> {
self.rust_info.sha()
}

/// Returns the `a.b.c` version that the given package is at.
fn release_num(&self, package: &str) -> String {
let mut toml = String::new();
Expand Down
14 changes: 12 additions & 2 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ impl Step for Openssl {
if !ok {
panic!("failed to download openssl source")
}
let mut shasum = if target.contains("apple") {
let mut shasum = if target.contains("apple") || build.build.contains("netbsd") {
let mut cmd = Command::new("shasum");
cmd.arg("-a").arg("256");
cmd
Expand All @@ -386,7 +386,7 @@ impl Step for Openssl {
let dst = build.openssl_install_dir(target).unwrap();
drop(fs::remove_dir_all(&obj));
drop(fs::remove_dir_all(&dst));
build.run(Command::new("tar").arg("xf").arg(&tarball).current_dir(&out));
build.run(Command::new("tar").arg("zxf").arg(&tarball).current_dir(&out));

let mut configure = Command::new(obj.join("Configure"));
configure.arg(format!("--prefix={}", dst.display()));
Expand Down Expand Up @@ -416,6 +416,7 @@ impl Step for Openssl {
"powerpc64-unknown-linux-gnu" => "linux-ppc64",
"powerpc64le-unknown-linux-gnu" => "linux-ppc64le",
"s390x-unknown-linux-gnu" => "linux64-s390x",
"sparc64-unknown-netbsd" => "BSD-sparc64",
"x86_64-apple-darwin" => "darwin64-x86_64-cc",
"x86_64-linux-android" => "linux-x86_64",
"x86_64-unknown-freebsd" => "BSD-x86_64",
Expand All @@ -435,6 +436,15 @@ impl Step for Openssl {
configure.arg("-mandroid");
configure.arg("-fomit-frame-pointer");
}
if target == "sparc64-unknown-netbsd" {
// Need -m64 to get assembly generated correctly for sparc64.
configure.arg("-m64");
if build.build.contains("netbsd") {
// Disable sparc64 asm on NetBSD builders, it uses
// m4(1)'s -B flag, which NetBSD m4 does not support.
configure.arg("no-asm");
}
}
// Make PIE binaries
// Non-PIE linker support was removed in Lollipop
// https://source.android.com/security/enhancements/enhancements50
Expand Down
63 changes: 63 additions & 0 deletions src/etc/platform-intrinsics/powerpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,69 @@
"llvm": "vupkh{1.kind}{1.data_type_short}",
"ret": "s(16-32)",
"args": ["0N"]
},
{
"intrinsic": "madds",
"width": [128],
"llvm": "vmhaddshs",
"ret": "s16",
"args": ["0", "0", "0"]
},
{
"intrinsic": "msumu{1.data_type_short}m",
"width": [128],
"llvm": "vmsumu{1.data_type_short}m",
"ret": "u32",
"args": ["u(8-16)", "1", "u32"]
},
{
"intrinsic": "msummbm",
"width": [128],
"llvm": "vmsummbm",
"ret": "s32",
"args": ["s8", "u8", "s32"]
},
{
"intrinsic": "msumshm",
"width": [128],
"llvm": "vmsumshm",
"ret": "s32",
"args": ["s16", "s16", "s32"]
},
{
"intrinsic": "msum{0.kind}hs",
"width": [128],
"llvm": "vmsum{0.kind}hs",
"ret": "i32",
"args": ["0N", "0N", "0"]
},
{
"intrinsic": "sum2s",
"width": [128],
"llvm": "vsum2sws",
"ret": "s32",
"args": ["0", "0"]
},
{
"intrinsic": "sum4{0.kind}bs",
"width": [128],
"llvm": "vsum4{0.kind}bs",
"ret": "i32",
"args": ["0NN", "0"]
},
{
"intrinsic": "sum4shs",
"width": [128],
"llvm": "vsum4shs",
"ret": "s32",
"args": ["0N", "0"]
},
{
"intrinsic": "sums",
"width": [128],
"llvm": "vsumsws",
"ret": "s32",
"args": ["0", "0"]
}
]
}
45 changes: 25 additions & 20 deletions src/liballoc/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,10 +671,25 @@ impl<T> [T] {
/// # Examples
///
/// ```
/// let v = [10, 40, 30, 20, 50];
/// let (v1, v2) = v.split_at(2);
/// assert_eq!([10, 40], v1);
/// assert_eq!([30, 20, 50], v2);
/// let v = [1, 2, 3, 4, 5, 6];
///
/// {
/// let (left, right) = v.split_at(0);
/// assert!(left == []);
/// assert!(right == [1, 2, 3, 4, 5, 6]);
/// }
///
/// {
/// let (left, right) = v.split_at(2);
/// assert!(left == [1, 2]);
/// assert!(right == [3, 4, 5, 6]);
/// }
///
/// {
/// let (left, right) = v.split_at(6);
/// assert!(left == [1, 2, 3, 4, 5, 6]);
/// assert!(right == []);
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
Expand All @@ -695,26 +710,16 @@ impl<T> [T] {
/// # Examples
///
/// ```
/// let mut v = [1, 2, 3, 4, 5, 6];
///
/// let mut v = [1, 0, 3, 0, 5, 6];
/// // scoped to restrict the lifetime of the borrows
/// {
/// let (left, right) = v.split_at_mut(0);
/// assert!(left == []);
/// assert!(right == [1, 2, 3, 4, 5, 6]);
/// }
///
/// {
/// let (left, right) = v.split_at_mut(2);
/// assert!(left == [1, 2]);
/// assert!(right == [3, 4, 5, 6]);
/// }
///
/// {
/// let (left, right) = v.split_at_mut(6);
/// assert!(left == [1, 2, 3, 4, 5, 6]);
/// assert!(right == []);
/// assert!(left == [1, 0]);
/// assert!(right == [3, 0, 5, 6]);
/// left[1] = 2;
/// right[1] = 4;
/// }
/// assert!(v == [1, 2, 3, 4, 5, 6]);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
Expand Down
24 changes: 24 additions & 0 deletions src/libcore/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,30 @@ pub trait Ord: Eq + PartialOrd<Self> {
where Self: Sized {
if self <= other { self } else { other }
}

/// Returns max if self is greater than max, and min if self is less than min.
/// Otherwise this will return self.
///
/// # Examples
///
/// ```
/// #![feature(clamp)]
///
/// assert!((-3).clamp(-2, 1) == -2);
/// assert!(0.clamp(-2, 1) == 0);
/// assert!(2.clamp(-2, 1) == 1);
/// ```
///
/// # Panics
/// Panics if min > max.
#[unstable(feature = "clamp", issue = "44095")]
fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized {
assert!(min <= max);
if self < min { min }
else if self > max { max }
else { self }
}
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down
4 changes: 1 addition & 3 deletions src/libcore/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -531,15 +531,13 @@ macro_rules! unreachable {

/// A standardized placeholder for marking unfinished code.
///
/// It panics with the message `"not yet implemented"` when executed.
///
/// This can be useful if you are prototyping and are just looking to have your
/// code typecheck, or if you're implementing a trait that requires multiple
/// methods, and you're only planning on using one of them.
///
/// # Panics
///
/// This macro always panics.
/// This will always [panic!](macro.panic.html)
///
/// # Examples
///
Expand Down
1 change: 0 additions & 1 deletion src/libcore/num/dec2flt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ macro_rules! from_str_float_impl {
/// * '-3.14'
/// * '2.5E10', or equivalently, '2.5e10'
/// * '2.5E-10'
/// * '.' (understood as 0)
/// * '5.'
/// * '.5', or, equivalently, '0.5'
/// * 'inf', '-inf', 'NaN'
Expand Down
11 changes: 10 additions & 1 deletion src/librustc/hir/def_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,19 @@ impl serialize::UseSpecializedDecodable for CrateNum {
///
/// Since the DefIndex is mostly treated as an opaque ID, you probably
/// don't have to care about these ranges.
#[derive(Clone, Debug, Eq, Ord, PartialOrd, PartialEq, RustcEncodable,
#[derive(Clone, Eq, Ord, PartialOrd, PartialEq, RustcEncodable,
RustcDecodable, Hash, Copy)]
pub struct DefIndex(u32);

impl fmt::Debug for DefIndex {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f,
"DefIndex({}:{})",
self.address_space().index(),
self.as_array_index())
}
}

impl DefIndex {
#[inline]
pub fn new(x: usize) -> DefIndex {
Expand Down
10 changes: 8 additions & 2 deletions src/librustc_mir/transform/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -606,14 +606,20 @@ impl<'a, 'tcx> MutVisitor<'tcx> for Integrator<'a, 'tcx> {
_location: Location) {
if *local == RETURN_POINTER {
match self.destination {
Lvalue::Local(l) => *local = l,
Lvalue::Local(l) => {
*local = l;
return;
},
ref lval => bug!("Return lvalue is {:?}, not local", lval)
}
}
let idx = local.index() - 1;
if idx < self.args.len() {
match self.args[idx] {
Operand::Consume(Lvalue::Local(l)) => *local = l,
Operand::Consume(Lvalue::Local(l)) => {
*local = l;
return;
},
ref op => bug!("Arg operand `{:?}` is {:?}, not local", idx, op)
}
}
Expand Down
Loading