Skip to content

Commit 05e3c96

Browse files
committed
Auto merge of #44380 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 23 pull requests - Successful merges: #44097, #44206, #44218, #44276, #44277, #44296, #44303, #44313, #44315, #44317, #44319, #44321, #44325, #44326, #44327, #44328, #44330, #44351, #44353, #44354, #44361, #44362, #44377 - Failed merges:
2 parents 3681220 + 6667058 commit 05e3c96

File tree

33 files changed

+559
-83
lines changed

33 files changed

+559
-83
lines changed

Diff for: RELEASES.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ Compatibility Notes
170170
[`slice::sort_unstable_by_key`]: https://doc.rust-lang.org/std/primitive.slice.html#method.sort_unstable_by_key
171171
[`slice::sort_unstable_by`]: https://doc.rust-lang.org/std/primitive.slice.html#method.sort_unstable_by
172172
[`slice::sort_unstable`]: https://doc.rust-lang.org/std/primitive.slice.html#method.sort_unstable
173-
[`ste::from_boxed_utf8_unchecked`]: https://doc.rust-lang.org/std/str/fn.from_boxed_utf8_unchecked.html
173+
[`str::from_boxed_utf8_unchecked`]: https://doc.rust-lang.org/std/str/fn.from_boxed_utf8_unchecked.html
174174
[`str::as_bytes_mut`]: https://doc.rust-lang.org/std/primitive.str.html#method.as_bytes_mut
175175
[`str::from_utf8_mut`]: https://doc.rust-lang.org/std/str/fn.from_utf8_mut.html
176176
[`str::from_utf8_unchecked_mut`]: https://doc.rust-lang.org/std/str/fn.from_utf8_unchecked_mut.html

Diff for: config.toml.example

+5-5
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@
146146
# option to true.
147147
#full-bootstrap = false
148148

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

155155
# Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose
@@ -175,7 +175,7 @@
175175
# script.
176176
#configure-args = []
177177

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

Diff for: src/bootstrap/dist.rs

+13-1
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,9 @@ impl Step for Rustc {
365365
// tiny morsel of metadata is used by rust-packaging
366366
let version = build.rust_version();
367367
t!(t!(File::create(overlay.join("version"))).write_all(version.as_bytes()));
368+
if let Some(sha) = build.rust_sha() {
369+
t!(t!(File::create(overlay.join("git-commit-hash"))).write_all(sha.as_bytes()));
370+
}
368371

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

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

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

11621171
// When rust-std package split from rustc, we needed to ensure that during
11631172
// upgrades rustc was upgraded before rust-std. To avoid rustc clobbering
11641173
// the std files during uninstall. To do this ensure that rustc comes
11651174
// before rust-std in the list below.
11661175
let mut tarballs = vec![rustc_installer, cargo_installer, rls_installer,
1167-
analysis_installer, docs_installer, std_installer];
1176+
analysis_installer, std_installer];
1177+
if build.config.docs {
1178+
tarballs.push(docs_installer);
1179+
}
11681180
if target.contains("pc-windows-gnu") {
11691181
tarballs.push(mingw_installer.unwrap());
11701182
}

Diff for: src/bootstrap/install.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ install!((self, builder, _config),
200200
builder.ensure(dist::Src);
201201
install_src(builder, self.stage);
202202
}, ONLY_BUILD;
203-
Rustc, "src/librustc", _config.extended, only_hosts: true, {
203+
Rustc, "src/librustc", true, only_hosts: true, {
204204
builder.ensure(dist::Rustc {
205205
compiler: builder.compiler(self.stage, self.target),
206206
});

Diff for: src/bootstrap/lib.rs

+5
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,11 @@ impl Build {
797797
self.rust_info.version(self, channel::CFG_RELEASE_NUM)
798798
}
799799

800+
/// Return the full commit hash
801+
fn rust_sha(&self) -> Option<&str> {
802+
self.rust_info.sha()
803+
}
804+
800805
/// Returns the `a.b.c` version that the given package is at.
801806
fn release_num(&self, package: &str) -> String {
802807
let mut toml = String::new();

Diff for: src/bootstrap/native.rs

+10
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ impl Step for Openssl {
417417
"powerpc64-unknown-linux-gnu" => "linux-ppc64",
418418
"powerpc64le-unknown-linux-gnu" => "linux-ppc64le",
419419
"s390x-unknown-linux-gnu" => "linux64-s390x",
420+
"sparc64-unknown-netbsd" => "BSD-sparc64",
420421
"x86_64-apple-darwin" => "darwin64-x86_64-cc",
421422
"x86_64-linux-android" => "linux-x86_64",
422423
"x86_64-unknown-freebsd" => "BSD-x86_64",
@@ -436,6 +437,15 @@ impl Step for Openssl {
436437
configure.arg("-mandroid");
437438
configure.arg("-fomit-frame-pointer");
438439
}
440+
if target == "sparc64-unknown-netbsd" {
441+
// Need -m64 to get assembly generated correctly for sparc64.
442+
configure.arg("-m64");
443+
if build.build.contains("netbsd") {
444+
// Disable sparc64 asm on NetBSD builders, it uses
445+
// m4(1)'s -B flag, which NetBSD m4 does not support.
446+
configure.arg("no-asm");
447+
}
448+
}
439449
// Make PIE binaries
440450
// Non-PIE linker support was removed in Lollipop
441451
// https://source.android.com/security/enhancements/enhancements50

Diff for: src/etc/platform-intrinsics/powerpc.json

+63
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,69 @@
156156
"llvm": "vupkh{1.kind}{1.data_type_short}",
157157
"ret": "s(16-32)",
158158
"args": ["0N"]
159+
},
160+
{
161+
"intrinsic": "madds",
162+
"width": [128],
163+
"llvm": "vmhaddshs",
164+
"ret": "s16",
165+
"args": ["0", "0", "0"]
166+
},
167+
{
168+
"intrinsic": "msumu{1.data_type_short}m",
169+
"width": [128],
170+
"llvm": "vmsumu{1.data_type_short}m",
171+
"ret": "u32",
172+
"args": ["u(8-16)", "1", "u32"]
173+
},
174+
{
175+
"intrinsic": "msummbm",
176+
"width": [128],
177+
"llvm": "vmsummbm",
178+
"ret": "s32",
179+
"args": ["s8", "u8", "s32"]
180+
},
181+
{
182+
"intrinsic": "msumshm",
183+
"width": [128],
184+
"llvm": "vmsumshm",
185+
"ret": "s32",
186+
"args": ["s16", "s16", "s32"]
187+
},
188+
{
189+
"intrinsic": "msum{0.kind}hs",
190+
"width": [128],
191+
"llvm": "vmsum{0.kind}hs",
192+
"ret": "i32",
193+
"args": ["0N", "0N", "0"]
194+
},
195+
{
196+
"intrinsic": "sum2s",
197+
"width": [128],
198+
"llvm": "vsum2sws",
199+
"ret": "s32",
200+
"args": ["0", "0"]
201+
},
202+
{
203+
"intrinsic": "sum4{0.kind}bs",
204+
"width": [128],
205+
"llvm": "vsum4{0.kind}bs",
206+
"ret": "i32",
207+
"args": ["0NN", "0"]
208+
},
209+
{
210+
"intrinsic": "sum4shs",
211+
"width": [128],
212+
"llvm": "vsum4shs",
213+
"ret": "s32",
214+
"args": ["0N", "0"]
215+
},
216+
{
217+
"intrinsic": "sums",
218+
"width": [128],
219+
"llvm": "vsumsws",
220+
"ret": "s32",
221+
"args": ["0", "0"]
159222
}
160223
]
161224
}

Diff for: src/liballoc/slice.rs

+25-20
Original file line numberDiff line numberDiff line change
@@ -671,10 +671,25 @@ impl<T> [T] {
671671
/// # Examples
672672
///
673673
/// ```
674-
/// let v = [10, 40, 30, 20, 50];
675-
/// let (v1, v2) = v.split_at(2);
676-
/// assert_eq!([10, 40], v1);
677-
/// assert_eq!([30, 20, 50], v2);
674+
/// let v = [1, 2, 3, 4, 5, 6];
675+
///
676+
/// {
677+
/// let (left, right) = v.split_at(0);
678+
/// assert!(left == []);
679+
/// assert!(right == [1, 2, 3, 4, 5, 6]);
680+
/// }
681+
///
682+
/// {
683+
/// let (left, right) = v.split_at(2);
684+
/// assert!(left == [1, 2]);
685+
/// assert!(right == [3, 4, 5, 6]);
686+
/// }
687+
///
688+
/// {
689+
/// let (left, right) = v.split_at(6);
690+
/// assert!(left == [1, 2, 3, 4, 5, 6]);
691+
/// assert!(right == []);
692+
/// }
678693
/// ```
679694
#[stable(feature = "rust1", since = "1.0.0")]
680695
#[inline]
@@ -695,26 +710,16 @@ impl<T> [T] {
695710
/// # Examples
696711
///
697712
/// ```
698-
/// let mut v = [1, 2, 3, 4, 5, 6];
699-
///
713+
/// let mut v = [1, 0, 3, 0, 5, 6];
700714
/// // scoped to restrict the lifetime of the borrows
701715
/// {
702-
/// let (left, right) = v.split_at_mut(0);
703-
/// assert!(left == []);
704-
/// assert!(right == [1, 2, 3, 4, 5, 6]);
705-
/// }
706-
///
707-
/// {
708716
/// let (left, right) = v.split_at_mut(2);
709-
/// assert!(left == [1, 2]);
710-
/// assert!(right == [3, 4, 5, 6]);
711-
/// }
712-
///
713-
/// {
714-
/// let (left, right) = v.split_at_mut(6);
715-
/// assert!(left == [1, 2, 3, 4, 5, 6]);
716-
/// assert!(right == []);
717+
/// assert!(left == [1, 0]);
718+
/// assert!(right == [3, 0, 5, 6]);
719+
/// left[1] = 2;
720+
/// right[1] = 4;
717721
/// }
722+
/// assert!(v == [1, 2, 3, 4, 5, 6]);
718723
/// ```
719724
#[stable(feature = "rust1", since = "1.0.0")]
720725
#[inline]

Diff for: src/libcore/cmp.rs

+24
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,30 @@ pub trait Ord: Eq + PartialOrd<Self> {
481481
where Self: Sized {
482482
if self <= other { self } else { other }
483483
}
484+
485+
/// Returns max if self is greater than max, and min if self is less than min.
486+
/// Otherwise this will return self.
487+
///
488+
/// # Examples
489+
///
490+
/// ```
491+
/// #![feature(clamp)]
492+
///
493+
/// assert!((-3).clamp(-2, 1) == -2);
494+
/// assert!(0.clamp(-2, 1) == 0);
495+
/// assert!(2.clamp(-2, 1) == 1);
496+
/// ```
497+
///
498+
/// # Panics
499+
/// Panics if min > max.
500+
#[unstable(feature = "clamp", issue = "44095")]
501+
fn clamp(self, min: Self, max: Self) -> Self
502+
where Self: Sized {
503+
assert!(min <= max);
504+
if self < min { min }
505+
else if self > max { max }
506+
else { self }
507+
}
484508
}
485509

486510
#[stable(feature = "rust1", since = "1.0.0")]

Diff for: src/libcore/macros.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -531,15 +531,13 @@ macro_rules! unreachable {
531531

532532
/// A standardized placeholder for marking unfinished code.
533533
///
534-
/// It panics with the message `"not yet implemented"` when executed.
535-
///
536534
/// This can be useful if you are prototyping and are just looking to have your
537535
/// code typecheck, or if you're implementing a trait that requires multiple
538536
/// methods, and you're only planning on using one of them.
539537
///
540538
/// # Panics
541539
///
542-
/// This macro always panics.
540+
/// This will always [panic!](macro.panic.html)
543541
///
544542
/// # Examples
545543
///

Diff for: src/libcore/num/dec2flt/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ macro_rules! from_str_float_impl {
121121
/// * '-3.14'
122122
/// * '2.5E10', or equivalently, '2.5e10'
123123
/// * '2.5E-10'
124-
/// * '.' (understood as 0)
125124
/// * '5.'
126125
/// * '.5', or, equivalently, '0.5'
127126
/// * 'inf', '-inf', 'NaN'

Diff for: src/librustc/hir/def_id.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,19 @@ impl serialize::UseSpecializedDecodable for CrateNum {
9393
///
9494
/// Since the DefIndex is mostly treated as an opaque ID, you probably
9595
/// don't have to care about these ranges.
96-
#[derive(Clone, Debug, Eq, Ord, PartialOrd, PartialEq, RustcEncodable,
96+
#[derive(Clone, Eq, Ord, PartialOrd, PartialEq, RustcEncodable,
9797
RustcDecodable, Hash, Copy)]
9898
pub struct DefIndex(u32);
9999

100+
impl fmt::Debug for DefIndex {
101+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
102+
write!(f,
103+
"DefIndex({}:{})",
104+
self.address_space().index(),
105+
self.as_array_index())
106+
}
107+
}
108+
100109
impl DefIndex {
101110
#[inline]
102111
pub fn new(x: usize) -> DefIndex {

Diff for: src/librustc_mir/transform/inline.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -606,14 +606,20 @@ impl<'a, 'tcx> MutVisitor<'tcx> for Integrator<'a, 'tcx> {
606606
_location: Location) {
607607
if *local == RETURN_POINTER {
608608
match self.destination {
609-
Lvalue::Local(l) => *local = l,
609+
Lvalue::Local(l) => {
610+
*local = l;
611+
return;
612+
},
610613
ref lval => bug!("Return lvalue is {:?}, not local", lval)
611614
}
612615
}
613616
let idx = local.index() - 1;
614617
if idx < self.args.len() {
615618
match self.args[idx] {
616-
Operand::Consume(Lvalue::Local(l)) => *local = l,
619+
Operand::Consume(Lvalue::Local(l)) => {
620+
*local = l;
621+
return;
622+
},
617623
ref op => bug!("Arg operand `{:?}` is {:?}, not local", idx, op)
618624
}
619625
}

0 commit comments

Comments
 (0)