Skip to content

Commit 5665bdf

Browse files
authored
Auto merge of #37540 - jonathandturner:rollup, r=jonathandturner
Rollup of 10 pull requests - Successful merges: #37351, #37405, #37473, #37482, #37488, #37498, #37502, #37513, #37517, #37523 - Failed merges: #37521
2 parents 0ca9967 + 0befab2 commit 5665bdf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+906
-89
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ before_install:
1515
script:
1616
- docker run -v `pwd`:/build rust
1717
sh -c "
18-
./configure --enable-rustbuild --llvm-root=/usr/lib/llvm-3.7 &&
18+
./configure --enable-rustbuild --llvm-root=/usr/lib/llvm-3.7 --enable-quiet-tests &&
1919
make tidy &&
2020
make check -j4
2121
"

configure

+7-1
Original file line numberDiff line numberDiff line change
@@ -507,11 +507,16 @@ case $CFG_CPUTYPE in
507507
CFG_CPUTYPE=arm
508508
;;
509509

510-
armv7l)
510+
armv6l)
511511
CFG_CPUTYPE=arm
512512
CFG_OSTYPE="${CFG_OSTYPE}eabihf"
513513
;;
514514

515+
armv7l)
516+
CFG_CPUTYPE=armv7
517+
CFG_OSTYPE="${CFG_OSTYPE}eabihf"
518+
;;
519+
515520
aarch64)
516521
CFG_CPUTYPE=aarch64
517522
;;
@@ -610,6 +615,7 @@ opt docs 1 "build standard library documentation"
610615
opt compiler-docs 0 "build compiler documentation"
611616
opt optimize-tests 1 "build tests with optimizations"
612617
opt debuginfo-tests 0 "build tests with debugger metadata"
618+
opt quiet-tests 0 "enable quieter output when running tests"
613619
opt libcpp 1 "build llvm with libc++ instead of libstdc++ when using clang"
614620
opt llvm-assertions 0 "build LLVM with assertions"
615621
opt debug-assertions 0 "build with debugging assertions"

src/bootstrap/check.rs

+16-1
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ pub fn compiletest(build: &Build,
187187
cmd.arg("--verbose");
188188
}
189189

190+
if build.config.quiet_tests {
191+
cmd.arg("--quiet");
192+
}
193+
190194
// Only pass correct values for these flags for the `run-make` suite as it
191195
// requires that a C++ compiler was configured which isn't always the case.
192196
if suite == "run-make" {
@@ -277,7 +281,13 @@ fn markdown_test(build: &Build, compiler: &Compiler, markdown: &Path) {
277281
build.add_rustc_lib_path(compiler, &mut cmd);
278282
cmd.arg("--test");
279283
cmd.arg(markdown);
280-
cmd.arg("--test-args").arg(build.flags.args.join(" "));
284+
285+
let mut test_args = build.flags.args.join(" ");
286+
if build.config.quiet_tests {
287+
test_args.push_str(" --quiet");
288+
}
289+
cmd.arg("--test-args").arg(test_args);
290+
281291
build.run(&mut cmd);
282292
}
283293

@@ -367,6 +377,11 @@ pub fn krate(build: &Build,
367377
dylib_path.insert(0, build.sysroot_libdir(compiler, target));
368378
cargo.env(dylib_path_var(), env::join_paths(&dylib_path).unwrap());
369379

380+
if build.config.quiet_tests {
381+
cargo.arg("--");
382+
cargo.arg("--quiet");
383+
}
384+
370385
if target.contains("android") {
371386
build.run(cargo.arg("--no-run"));
372387
krate_android(build, compiler, target, mode);

src/bootstrap/config.rs

+2
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ pub struct Config {
7777

7878
// misc
7979
pub channel: String,
80+
pub quiet_tests: bool,
8081
// Fallback musl-root for all targets
8182
pub musl_root: Option<PathBuf>,
8283
pub prefix: Option<String>,
@@ -338,6 +339,7 @@ impl Config {
338339
("RPATH", self.rust_rpath),
339340
("OPTIMIZE_TESTS", self.rust_optimize_tests),
340341
("DEBUGINFO_TESTS", self.rust_debuginfo_tests),
342+
("QUIET_TESTS", self.quiet_tests),
341343
("LOCAL_REBUILD", self.local_rebuild),
342344
("NINJA", self.ninja),
343345
("CODEGEN_TESTS", self.codegen_tests),

src/libcore/macros.rs

+20-18
Original file line numberDiff line numberDiff line change
@@ -317,26 +317,27 @@ macro_rules! try {
317317

318318
/// Write formatted data into a buffer
319319
///
320-
/// This macro accepts any value with `write_fmt` method as a writer, a format string, and a list
321-
/// of arguments to format.
320+
/// This macro accepts a 'writer' (any value with a `write_fmt` method), a format string, and a
321+
/// list of arguments to format.
322322
///
323-
/// `write_fmt` method usually comes from an implementation of [`std::fmt::Write`][fmt_write] or
324-
/// [`std::io::Write`][io_write] traits. These are sometimes called 'writers'.
323+
/// The `write_fmt` method usually comes from an implementation of [`std::fmt::Write`][fmt_write]
324+
/// or [`std::io::Write`][io_write] traits. The term 'writer' refers to an implementation of one of
325+
/// these two traits.
325326
///
326327
/// Passed arguments will be formatted according to the specified format string and the resulting
327328
/// string will be passed to the writer.
328329
///
329330
/// See [`std::fmt`][fmt] for more information on format syntax.
330331
///
331-
/// Return value is completely dependent on the 'write_fmt' method.
332+
/// `write!` returns whatever the 'write_fmt' method returns.
332333
///
333-
/// Common return values are: [`Result`][enum_result], [`io::Result`][type_result]
334+
/// Common return values include: [`fmt::Result`][fmt_result], [`io::Result`][io_result]
334335
///
335336
/// [fmt]: ../std/fmt/index.html
336337
/// [fmt_write]: ../std/fmt/trait.Write.html
337338
/// [io_write]: ../std/io/trait.Write.html
338-
/// [enum_result]: ../std/result/enum.Result.html
339-
/// [type_result]: ../std/io/type.Result.html
339+
/// [fmt_result]: ../std/fmt/type.Result.html
340+
/// [io_result]: ../std/io/type.Result.html
340341
///
341342
/// # Examples
342343
///
@@ -355,31 +356,32 @@ macro_rules! write {
355356
($dst:expr, $($arg:tt)*) => ($dst.write_fmt(format_args!($($arg)*)))
356357
}
357358

358-
/// Write formatted data into a buffer, with appending a newline.
359+
/// Write formatted data into a buffer, with a newline appended.
359360
///
360361
/// On all platforms, the newline is the LINE FEED character (`\n`/`U+000A`) alone
361362
/// (no additional CARRIAGE RETURN (`\r`/`U+000D`).
362363
///
363-
/// This macro accepts any value with `write_fmt` method as a writer, a format string, and a list
364-
/// of arguments to format.
364+
/// This macro accepts a 'writer' (any value with a `write_fmt` method), a format string, and a
365+
/// list of arguments to format.
365366
///
366-
/// `write_fmt` method usually comes from an implementation of [`std::fmt::Write`][fmt_write] or
367-
/// [`std::io::Write`][io_write] traits. These are sometimes called 'writers'.
367+
/// The `write_fmt` method usually comes from an implementation of [`std::fmt::Write`][fmt_write]
368+
/// or [`std::io::Write`][io_write] traits. The term 'writer' refers to an implementation of one of
369+
/// these two traits.
368370
///
369371
/// Passed arguments will be formatted according to the specified format string and the resulting
370-
/// string will be passed to the writer.
372+
/// string will be passed to the writer, along with the appended newline.
371373
///
372374
/// See [`std::fmt`][fmt] for more information on format syntax.
373375
///
374-
/// Return value is completely dependent on the 'write_fmt' method.
376+
/// `write!` returns whatever the 'write_fmt' method returns.
375377
///
376-
/// Common return values are: [`Result`][enum_result], [`io::Result`][type_result]
378+
/// Common return values include: [`fmt::Result`][fmt_result], [`io::Result`][io_result]
377379
///
378380
/// [fmt]: ../std/fmt/index.html
379381
/// [fmt_write]: ../std/fmt/trait.Write.html
380382
/// [io_write]: ../std/io/trait.Write.html
381-
/// [enum_result]: ../std/result/enum.Result.html
382-
/// [type_result]: ../std/io/type.Result.html
383+
/// [fmt_result]: ../std/fmt/type.Result.html
384+
/// [io_result]: ../std/io/type.Result.html
383385
///
384386
/// # Examples
385387
///

src/libcore/ops.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2484,13 +2484,13 @@ impl<'a, T: ?Sized> Deref for &'a mut T {
24842484
/// impl<T> Deref for DerefMutExample<T> {
24852485
/// type Target = T;
24862486
///
2487-
/// fn deref<'a>(&'a self) -> &'a T {
2487+
/// fn deref(&self) -> &T {
24882488
/// &self.value
24892489
/// }
24902490
/// }
24912491
///
24922492
/// impl<T> DerefMut for DerefMutExample<T> {
2493-
/// fn deref_mut<'a>(&'a mut self) -> &'a mut T {
2493+
/// fn deref_mut(&mut self) -> &mut T {
24942494
/// &mut self.value
24952495
/// }
24962496
/// }

src/libcore/result.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ impl<T: Default, E> Result<T, E> {
821821
/// [`FromStr`]: ../../std/str/trait.FromStr.html
822822
/// ```
823823
#[inline]
824-
#[unstable(feature = "result_unwrap_or_default", issue = "0")]
824+
#[unstable(feature = "result_unwrap_or_default", issue = "37516")]
825825
pub fn unwrap_or_default(self) -> T {
826826
match self {
827827
Ok(x) => x,

src/libcore/sync/atomic.rs

+18
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ pub enum Ordering {
166166
/// sequentially consistent operations in the same order.
167167
#[stable(feature = "rust1", since = "1.0.0")]
168168
SeqCst,
169+
// Prevent exhaustive matching to allow for future extension
170+
#[doc(hidden)]
171+
#[unstable(feature = "future_atomic_orderings", issue = "0")]
172+
__Nonexhaustive,
169173
}
170174

171175
/// An `AtomicBool` initialized to `false`.
@@ -1277,6 +1281,7 @@ fn strongest_failure_ordering(order: Ordering) -> Ordering {
12771281
SeqCst => SeqCst,
12781282
Acquire => Acquire,
12791283
AcqRel => Acquire,
1284+
__Nonexhaustive => __Nonexhaustive,
12801285
}
12811286
}
12821287

@@ -1288,6 +1293,7 @@ unsafe fn atomic_store<T>(dst: *mut T, val: T, order: Ordering) {
12881293
SeqCst => intrinsics::atomic_store(dst, val),
12891294
Acquire => panic!("there is no such thing as an acquire store"),
12901295
AcqRel => panic!("there is no such thing as an acquire/release store"),
1296+
__Nonexhaustive => panic!("invalid memory ordering"),
12911297
}
12921298
}
12931299

@@ -1299,6 +1305,7 @@ unsafe fn atomic_load<T>(dst: *const T, order: Ordering) -> T {
12991305
SeqCst => intrinsics::atomic_load(dst),
13001306
Release => panic!("there is no such thing as a release load"),
13011307
AcqRel => panic!("there is no such thing as an acquire/release load"),
1308+
__Nonexhaustive => panic!("invalid memory ordering"),
13021309
}
13031310
}
13041311

@@ -1310,6 +1317,7 @@ unsafe fn atomic_swap<T>(dst: *mut T, val: T, order: Ordering) -> T {
13101317
AcqRel => intrinsics::atomic_xchg_acqrel(dst, val),
13111318
Relaxed => intrinsics::atomic_xchg_relaxed(dst, val),
13121319
SeqCst => intrinsics::atomic_xchg(dst, val),
1320+
__Nonexhaustive => panic!("invalid memory ordering"),
13131321
}
13141322
}
13151323

@@ -1322,6 +1330,7 @@ unsafe fn atomic_add<T>(dst: *mut T, val: T, order: Ordering) -> T {
13221330
AcqRel => intrinsics::atomic_xadd_acqrel(dst, val),
13231331
Relaxed => intrinsics::atomic_xadd_relaxed(dst, val),
13241332
SeqCst => intrinsics::atomic_xadd(dst, val),
1333+
__Nonexhaustive => panic!("invalid memory ordering"),
13251334
}
13261335
}
13271336

@@ -1334,6 +1343,7 @@ unsafe fn atomic_sub<T>(dst: *mut T, val: T, order: Ordering) -> T {
13341343
AcqRel => intrinsics::atomic_xsub_acqrel(dst, val),
13351344
Relaxed => intrinsics::atomic_xsub_relaxed(dst, val),
13361345
SeqCst => intrinsics::atomic_xsub(dst, val),
1346+
__Nonexhaustive => panic!("invalid memory ordering"),
13371347
}
13381348
}
13391349

@@ -1354,6 +1364,8 @@ unsafe fn atomic_compare_exchange<T>(dst: *mut T,
13541364
(AcqRel, Relaxed) => intrinsics::atomic_cxchg_acqrel_failrelaxed(dst, old, new),
13551365
(SeqCst, Relaxed) => intrinsics::atomic_cxchg_failrelaxed(dst, old, new),
13561366
(SeqCst, Acquire) => intrinsics::atomic_cxchg_failacq(dst, old, new),
1367+
(__Nonexhaustive, _) => panic!("invalid memory ordering"),
1368+
(_, __Nonexhaustive) => panic!("invalid memory ordering"),
13571369
(_, AcqRel) => panic!("there is no such thing as an acquire/release failure ordering"),
13581370
(_, Release) => panic!("there is no such thing as a release failure ordering"),
13591371
_ => panic!("a failure ordering can't be stronger than a success ordering"),
@@ -1378,6 +1390,8 @@ unsafe fn atomic_compare_exchange_weak<T>(dst: *mut T,
13781390
(AcqRel, Relaxed) => intrinsics::atomic_cxchgweak_acqrel_failrelaxed(dst, old, new),
13791391
(SeqCst, Relaxed) => intrinsics::atomic_cxchgweak_failrelaxed(dst, old, new),
13801392
(SeqCst, Acquire) => intrinsics::atomic_cxchgweak_failacq(dst, old, new),
1393+
(__Nonexhaustive, _) => panic!("invalid memory ordering"),
1394+
(_, __Nonexhaustive) => panic!("invalid memory ordering"),
13811395
(_, AcqRel) => panic!("there is no such thing as an acquire/release failure ordering"),
13821396
(_, Release) => panic!("there is no such thing as a release failure ordering"),
13831397
_ => panic!("a failure ordering can't be stronger than a success ordering"),
@@ -1393,6 +1407,7 @@ unsafe fn atomic_and<T>(dst: *mut T, val: T, order: Ordering) -> T {
13931407
AcqRel => intrinsics::atomic_and_acqrel(dst, val),
13941408
Relaxed => intrinsics::atomic_and_relaxed(dst, val),
13951409
SeqCst => intrinsics::atomic_and(dst, val),
1410+
__Nonexhaustive => panic!("invalid memory ordering"),
13961411
}
13971412
}
13981413

@@ -1404,6 +1419,7 @@ unsafe fn atomic_or<T>(dst: *mut T, val: T, order: Ordering) -> T {
14041419
AcqRel => intrinsics::atomic_or_acqrel(dst, val),
14051420
Relaxed => intrinsics::atomic_or_relaxed(dst, val),
14061421
SeqCst => intrinsics::atomic_or(dst, val),
1422+
__Nonexhaustive => panic!("invalid memory ordering"),
14071423
}
14081424
}
14091425

@@ -1415,6 +1431,7 @@ unsafe fn atomic_xor<T>(dst: *mut T, val: T, order: Ordering) -> T {
14151431
AcqRel => intrinsics::atomic_xor_acqrel(dst, val),
14161432
Relaxed => intrinsics::atomic_xor_relaxed(dst, val),
14171433
SeqCst => intrinsics::atomic_xor(dst, val),
1434+
__Nonexhaustive => panic!("invalid memory ordering"),
14181435
}
14191436
}
14201437

@@ -1448,6 +1465,7 @@ pub fn fence(order: Ordering) {
14481465
AcqRel => intrinsics::atomic_fence_acqrel(),
14491466
SeqCst => intrinsics::atomic_fence(),
14501467
Relaxed => panic!("there is no such thing as a relaxed fence"),
1468+
__Nonexhaustive => panic!("invalid memory ordering"),
14511469
}
14521470
}
14531471
}

src/librustc_borrowck/borrowck/mir/abs_domain.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@
2121
//! `a[x]` would still overlap them both. But that is not this
2222
//! representation does today.)
2323
24-
use rustc::mir::{Lvalue, LvalueElem};
25-
use rustc::mir::{Operand, Projection, ProjectionElem};
24+
use rustc::mir::LvalueElem;
25+
use rustc::mir::{Operand, ProjectionElem};
2626

2727
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
2828
pub struct AbstractOperand;
29-
pub type AbstractProjection<'tcx> =
30-
Projection<'tcx, Lvalue<'tcx>, AbstractOperand>;
3129
pub type AbstractElem<'tcx> =
3230
ProjectionElem<'tcx, AbstractOperand>;
3331

src/librustc_borrowck/borrowck/mod.rs

+13-2
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,6 @@ struct BorrowStats {
300300
guaranteed_paths: usize
301301
}
302302

303-
pub type BckResult<'tcx, T> = Result<T, BckError<'tcx>>;
304-
305303
///////////////////////////////////////////////////////////////////////////
306304
// Loans and loan paths
307305

@@ -1064,6 +1062,19 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
10641062
db.note("values in a scope are dropped in the opposite order \
10651063
they are created");
10661064
}
1065+
(Some(s1), Some(s2)) if !is_temporary && !is_closure => {
1066+
db.span = MultiSpan::from_span(s2);
1067+
db.span_label(error_span, &format!("borrow occurs here"));
1068+
let msg = match opt_loan_path(&err.cmt) {
1069+
None => "borrowed value".to_string(),
1070+
Some(lp) => {
1071+
format!("`{}`", self.loan_path_to_string(&lp))
1072+
}
1073+
};
1074+
db.span_label(s2,
1075+
&format!("{} dropped here while still borrowed", msg));
1076+
db.span_label(s1, &format!("{} needs to live until here", value_kind));
1077+
}
10671078
_ => {
10681079
match sub_span {
10691080
Some(s) => {

0 commit comments

Comments
 (0)