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 23 pull requests #44380

Merged
merged 65 commits into from
Sep 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 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
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
3333262
Minor documentation improvements for StmtKind
zmanian Sep 3, 2017
4260e43
impl Debug for SplitWhitespace.
clarfonthey Sep 3, 2017
adbb820
rustbook: remove dead test functions
RalfJung Sep 4, 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
af3536d
Remove trailing white space
zmanian Sep 6, 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
04cbf6e
config.toml.example: fix some typos
mathstuf Sep 6, 2017
44351ed
Rollup merge of #44097 - Xaeroxe:clamp, r=burntsushi
Mark-Simulacrum Sep 7, 2017
b8812a2
Rollup merge of #44206 - MarkMcCaskey:master, r=steveklabnik
Mark-Simulacrum Sep 7, 2017
da5e5ef
Rollup merge of #44218 - SimonSapin:commit-hash, r=alexcrichton
Mark-Simulacrum Sep 7, 2017
2dabf35
Rollup merge of #44276 - mattico:test-35376, r=alexcrichton
Mark-Simulacrum Sep 7, 2017
5c79f6d
Rollup merge of #44277 - mattico:test-33185, r=nikomatsakis
Mark-Simulacrum Sep 7, 2017
fee0b67
Rollup merge of #44296 - zmanian:patch-1, r=steveklabnik
Mark-Simulacrum Sep 7, 2017
923c351
Rollup merge of #44303 - clarcharr:debugs, r=alexcrichton
Mark-Simulacrum Sep 7, 2017
50f14e9
Rollup merge of #44313 - RalfJung:book, r=nikomatsakis
Mark-Simulacrum Sep 7, 2017
fdb8d0b
Rollup merge of #44315 - kallisti5:epoch-doc-example-squashed, r=Guil…
Mark-Simulacrum Sep 7, 2017
089bbd0
Rollup merge of #44317 - Dushistov:master, r=arielb1
Mark-Simulacrum Sep 7, 2017
4051233
Rollup merge of #44319 - est31:master, r=eddyb
Mark-Simulacrum Sep 7, 2017
596e97f
Rollup merge of #44321 - jakllsch:jakllsch-4f2d6c87-2674-43e4-9c5f-24…
Mark-Simulacrum Sep 7, 2017
a4b5484
Rollup merge of #44325 - nielsegberts:master, r=steveklabnik
Mark-Simulacrum Sep 7, 2017
43d20c7
Rollup merge of #44326 - Eh2406:FIXME#44590, r=arielb1
Mark-Simulacrum Sep 7, 2017
d2c85a0
Rollup merge of #44327 - Eh2406:FIXME#12808, r=aturon
Mark-Simulacrum Sep 7, 2017
e7470c9
Rollup merge of #44328 - mcomstock:from-str-doc-fix, r=steveklabnik
Mark-Simulacrum Sep 7, 2017
ae96d68
Rollup merge of #44330 - WiSaGaN:patch-1, r=aturon
Mark-Simulacrum Sep 7, 2017
b0929aa
Rollup merge of #44351 - lu-zero:master, r=nikomatsakis
Mark-Simulacrum Sep 7, 2017
eba44f1
Rollup merge of #44353 - cuviper:install-rustc, r=Mark-Simulacrum
Mark-Simulacrum Sep 7, 2017
48dcebd
Rollup merge of #44354 - jakllsch:jakllsch-85453197-a0cc-43f6-8c55-7b…
Mark-Simulacrum Sep 7, 2017
f8b7c3e
Rollup merge of #44361 - oli-obk:lit_sugg, r=nikomatsakis
Mark-Simulacrum Sep 7, 2017
435a5cd
Rollup merge of #44362 - oli-obk:patch-7, r=eddyb
Mark-Simulacrum Sep 7, 2017
6667058
Rollup merge of #44377 - mathstuf:config.toml-typos, r=alexcrichton
Mark-Simulacrum Sep 7, 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
10 changes: 5 additions & 5 deletions config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@
# option to true.
#full-bootstrap = false

# Enable a build of the and extended rust tool set which is not only the
# compiler but also tools such as Cargo. This will also produce "combined
# installers" which are used to install Rust and Cargo together. This is
# disabled by default.
# Enable a build of the extended rust tool set which is not only the compiler
# but also tools such as Cargo. This will also produce "combined installers"
# which are used to install Rust and Cargo together. This is disabled by
# default.
#extended = false

# Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose
Expand All @@ -175,7 +175,7 @@
# script.
#configure-args = []

# Indicates that a local rebuild is ocurring instead of a full bootstrap,
# Indicates that a local rebuild is occurring instead of a full bootstrap,
# essentially skipping stage0 as the local compiler is recompiling itself again.
#local-rebuild = false

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
10 changes: 10 additions & 0 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,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 @@ -436,6 +437,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