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 10 pull requests #37540

Merged
merged 22 commits into from
Nov 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5a2fb88
Prevent exhaustive matching of Ordering to allow for future extension
Amanieu Oct 22, 2016
07bff08
Copyediting on documentation for write! and writeln!
joshtriplett Oct 29, 2016
10ce90f
Fix armv7 autodetection
matwey Oct 30, 2016
9b81f3c
Add armv6l autodetection
matwey Oct 30, 2016
c8c6d2c
Use quieter test output when running tests on Travis CI.
frewsxcv Oct 30, 2016
07c8a25
Remove unused type aliases
sanxiyn Oct 31, 2016
b926e8d
Add missing space in mutable_transmutes lint
CryZe Oct 31, 2016
e3025a0
ICH: Hash expression spans if their source location is captured for p…
michaelwoerister Oct 31, 2016
6720e01
Add tracking issue number to Result::unwrap_or_default unstable annot…
Mark-Simulacrum Nov 1, 2016
a0e7e35
Improve "Doesn't live long enough" error
mikhail-m1 Oct 26, 2016
7d5b788
Elide lifetimes in DerefMut documentation
d-unsed Nov 1, 2016
0e391bf
ICH: Add test case for when overflow checks are disabled.
michaelwoerister Nov 2, 2016
d00e5e9
Rollup merge of #37351 - Amanieu:consume, r=alexcrichton
Nov 2, 2016
dbb2506
Rollup merge of #37405 - mikhail-m1:dnlle, r=jonathandturner
Nov 2, 2016
3752673
Rollup merge of #37473 - joshtriplett:doc-copyedit-write-writeln, r=a…
Nov 2, 2016
0a20ec3
Rollup merge of #37482 - matwey:configure-arm, r=alexcrichton
Nov 2, 2016
d2f4a9d
Rollup merge of #37488 - frewsxcv:quiet-travis, r=alexcrichton
Nov 2, 2016
b333860
Rollup merge of #37498 - sanxiyn:unused-type-alias, r=eddyb
Nov 2, 2016
62e026b
Rollup merge of #37502 - CryZe:patch-4, r=sfackler
Nov 2, 2016
27f41b7
Rollup merge of #37513 - michaelwoerister:hash-panic-spans, r=nikomat…
Nov 2, 2016
805aecc
Rollup merge of #37517 - Mark-Simulacrum:add-unwrap-default-tracking-…
Nov 2, 2016
0befab2
Rollup merge of #37523 - d-unseductable:deref_mut_lifetimes, r=bluss
Nov 2, 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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ before_install:
script:
- docker run -v `pwd`:/build rust
sh -c "
./configure --enable-rustbuild --llvm-root=/usr/lib/llvm-3.7 &&
./configure --enable-rustbuild --llvm-root=/usr/lib/llvm-3.7 --enable-quiet-tests &&
make tidy &&
make check -j4
"
Expand Down
8 changes: 7 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -507,11 +507,16 @@ case $CFG_CPUTYPE in
CFG_CPUTYPE=arm
;;

armv7l)
armv6l)
CFG_CPUTYPE=arm
CFG_OSTYPE="${CFG_OSTYPE}eabihf"
;;

armv7l)
CFG_CPUTYPE=armv7
CFG_OSTYPE="${CFG_OSTYPE}eabihf"
;;

aarch64)
CFG_CPUTYPE=aarch64
;;
Expand Down Expand Up @@ -610,6 +615,7 @@ opt docs 1 "build standard library documentation"
opt compiler-docs 0 "build compiler documentation"
opt optimize-tests 1 "build tests with optimizations"
opt debuginfo-tests 0 "build tests with debugger metadata"
opt quiet-tests 0 "enable quieter output when running tests"
opt libcpp 1 "build llvm with libc++ instead of libstdc++ when using clang"
opt llvm-assertions 0 "build LLVM with assertions"
opt debug-assertions 0 "build with debugging assertions"
Expand Down
17 changes: 16 additions & 1 deletion src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ pub fn compiletest(build: &Build,
cmd.arg("--verbose");
}

if build.config.quiet_tests {
cmd.arg("--quiet");
}

// Only pass correct values for these flags for the `run-make` suite as it
// requires that a C++ compiler was configured which isn't always the case.
if suite == "run-make" {
Expand Down Expand Up @@ -277,7 +281,13 @@ fn markdown_test(build: &Build, compiler: &Compiler, markdown: &Path) {
build.add_rustc_lib_path(compiler, &mut cmd);
cmd.arg("--test");
cmd.arg(markdown);
cmd.arg("--test-args").arg(build.flags.args.join(" "));

let mut test_args = build.flags.args.join(" ");
if build.config.quiet_tests {
test_args.push_str(" --quiet");
}
cmd.arg("--test-args").arg(test_args);

build.run(&mut cmd);
}

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

if build.config.quiet_tests {
cargo.arg("--");
cargo.arg("--quiet");
}

if target.contains("android") {
build.run(cargo.arg("--no-run"));
krate_android(build, compiler, target, mode);
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ pub struct Config {

// misc
pub channel: String,
pub quiet_tests: bool,
// Fallback musl-root for all targets
pub musl_root: Option<PathBuf>,
pub prefix: Option<String>,
Expand Down Expand Up @@ -338,6 +339,7 @@ impl Config {
("RPATH", self.rust_rpath),
("OPTIMIZE_TESTS", self.rust_optimize_tests),
("DEBUGINFO_TESTS", self.rust_debuginfo_tests),
("QUIET_TESTS", self.quiet_tests),
("LOCAL_REBUILD", self.local_rebuild),
("NINJA", self.ninja),
("CODEGEN_TESTS", self.codegen_tests),
Expand Down
38 changes: 20 additions & 18 deletions src/libcore/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,26 +317,27 @@ macro_rules! try {

/// Write formatted data into a buffer
///
/// This macro accepts any value with `write_fmt` method as a writer, a format string, and a list
/// of arguments to format.
/// This macro accepts a 'writer' (any value with a `write_fmt` method), a format string, and a
/// list of arguments to format.
///
/// `write_fmt` method usually comes from an implementation of [`std::fmt::Write`][fmt_write] or
/// [`std::io::Write`][io_write] traits. These are sometimes called 'writers'.
/// The `write_fmt` method usually comes from an implementation of [`std::fmt::Write`][fmt_write]
/// or [`std::io::Write`][io_write] traits. The term 'writer' refers to an implementation of one of
/// these two traits.
///
/// Passed arguments will be formatted according to the specified format string and the resulting
/// string will be passed to the writer.
///
/// See [`std::fmt`][fmt] for more information on format syntax.
///
/// Return value is completely dependent on the 'write_fmt' method.
/// `write!` returns whatever the 'write_fmt' method returns.
///
/// Common return values are: [`Result`][enum_result], [`io::Result`][type_result]
/// Common return values include: [`fmt::Result`][fmt_result], [`io::Result`][io_result]
///
/// [fmt]: ../std/fmt/index.html
/// [fmt_write]: ../std/fmt/trait.Write.html
/// [io_write]: ../std/io/trait.Write.html
/// [enum_result]: ../std/result/enum.Result.html
/// [type_result]: ../std/io/type.Result.html
/// [fmt_result]: ../std/fmt/type.Result.html
/// [io_result]: ../std/io/type.Result.html
///
/// # Examples
///
Expand All @@ -355,31 +356,32 @@ macro_rules! write {
($dst:expr, $($arg:tt)*) => ($dst.write_fmt(format_args!($($arg)*)))
}

/// Write formatted data into a buffer, with appending a newline.
/// Write formatted data into a buffer, with a newline appended.
///
/// On all platforms, the newline is the LINE FEED character (`\n`/`U+000A`) alone
/// (no additional CARRIAGE RETURN (`\r`/`U+000D`).
///
/// This macro accepts any value with `write_fmt` method as a writer, a format string, and a list
/// of arguments to format.
/// This macro accepts a 'writer' (any value with a `write_fmt` method), a format string, and a
/// list of arguments to format.
///
/// `write_fmt` method usually comes from an implementation of [`std::fmt::Write`][fmt_write] or
/// [`std::io::Write`][io_write] traits. These are sometimes called 'writers'.
/// The `write_fmt` method usually comes from an implementation of [`std::fmt::Write`][fmt_write]
/// or [`std::io::Write`][io_write] traits. The term 'writer' refers to an implementation of one of
/// these two traits.
///
/// Passed arguments will be formatted according to the specified format string and the resulting
/// string will be passed to the writer.
/// string will be passed to the writer, along with the appended newline.
///
/// See [`std::fmt`][fmt] for more information on format syntax.
///
/// Return value is completely dependent on the 'write_fmt' method.
/// `write!` returns whatever the 'write_fmt' method returns.
///
/// Common return values are: [`Result`][enum_result], [`io::Result`][type_result]
/// Common return values include: [`fmt::Result`][fmt_result], [`io::Result`][io_result]
///
/// [fmt]: ../std/fmt/index.html
/// [fmt_write]: ../std/fmt/trait.Write.html
/// [io_write]: ../std/io/trait.Write.html
/// [enum_result]: ../std/result/enum.Result.html
/// [type_result]: ../std/io/type.Result.html
/// [fmt_result]: ../std/fmt/type.Result.html
/// [io_result]: ../std/io/type.Result.html
///
/// # Examples
///
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2484,13 +2484,13 @@ impl<'a, T: ?Sized> Deref for &'a mut T {
/// impl<T> Deref for DerefMutExample<T> {
/// type Target = T;
///
/// fn deref<'a>(&'a self) -> &'a T {
/// fn deref(&self) -> &T {
/// &self.value
/// }
/// }
///
/// impl<T> DerefMut for DerefMutExample<T> {
/// fn deref_mut<'a>(&'a mut self) -> &'a mut T {
/// fn deref_mut(&mut self) -> &mut T {
/// &mut self.value
/// }
/// }
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ impl<T: Default, E> Result<T, E> {
/// [`FromStr`]: ../../std/str/trait.FromStr.html
/// ```
#[inline]
#[unstable(feature = "result_unwrap_or_default", issue = "0")]
#[unstable(feature = "result_unwrap_or_default", issue = "37516")]
pub fn unwrap_or_default(self) -> T {
match self {
Ok(x) => x,
Expand Down
18 changes: 18 additions & 0 deletions src/libcore/sync/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ pub enum Ordering {
/// sequentially consistent operations in the same order.
#[stable(feature = "rust1", since = "1.0.0")]
SeqCst,
// Prevent exhaustive matching to allow for future extension
#[doc(hidden)]
#[unstable(feature = "future_atomic_orderings", issue = "0")]
__Nonexhaustive,
}

/// An `AtomicBool` initialized to `false`.
Expand Down Expand Up @@ -1277,6 +1281,7 @@ fn strongest_failure_ordering(order: Ordering) -> Ordering {
SeqCst => SeqCst,
Acquire => Acquire,
AcqRel => Acquire,
__Nonexhaustive => __Nonexhaustive,
}
}

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

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

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

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

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

Expand All @@ -1354,6 +1364,8 @@ unsafe fn atomic_compare_exchange<T>(dst: *mut T,
(AcqRel, Relaxed) => intrinsics::atomic_cxchg_acqrel_failrelaxed(dst, old, new),
(SeqCst, Relaxed) => intrinsics::atomic_cxchg_failrelaxed(dst, old, new),
(SeqCst, Acquire) => intrinsics::atomic_cxchg_failacq(dst, old, new),
(__Nonexhaustive, _) => panic!("invalid memory ordering"),
(_, __Nonexhaustive) => panic!("invalid memory ordering"),
(_, AcqRel) => panic!("there is no such thing as an acquire/release failure ordering"),
(_, Release) => panic!("there is no such thing as a release failure ordering"),
_ => panic!("a failure ordering can't be stronger than a success ordering"),
Expand All @@ -1378,6 +1390,8 @@ unsafe fn atomic_compare_exchange_weak<T>(dst: *mut T,
(AcqRel, Relaxed) => intrinsics::atomic_cxchgweak_acqrel_failrelaxed(dst, old, new),
(SeqCst, Relaxed) => intrinsics::atomic_cxchgweak_failrelaxed(dst, old, new),
(SeqCst, Acquire) => intrinsics::atomic_cxchgweak_failacq(dst, old, new),
(__Nonexhaustive, _) => panic!("invalid memory ordering"),
(_, __Nonexhaustive) => panic!("invalid memory ordering"),
(_, AcqRel) => panic!("there is no such thing as an acquire/release failure ordering"),
(_, Release) => panic!("there is no such thing as a release failure ordering"),
_ => panic!("a failure ordering can't be stronger than a success ordering"),
Expand All @@ -1393,6 +1407,7 @@ unsafe fn atomic_and<T>(dst: *mut T, val: T, order: Ordering) -> T {
AcqRel => intrinsics::atomic_and_acqrel(dst, val),
Relaxed => intrinsics::atomic_and_relaxed(dst, val),
SeqCst => intrinsics::atomic_and(dst, val),
__Nonexhaustive => panic!("invalid memory ordering"),
}
}

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

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

Expand Down Expand Up @@ -1448,6 +1465,7 @@ pub fn fence(order: Ordering) {
AcqRel => intrinsics::atomic_fence_acqrel(),
SeqCst => intrinsics::atomic_fence(),
Relaxed => panic!("there is no such thing as a relaxed fence"),
__Nonexhaustive => panic!("invalid memory ordering"),
}
}
}
Expand Down
6 changes: 2 additions & 4 deletions src/librustc_borrowck/borrowck/mir/abs_domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@
//! `a[x]` would still overlap them both. But that is not this
//! representation does today.)

use rustc::mir::{Lvalue, LvalueElem};
use rustc::mir::{Operand, Projection, ProjectionElem};
use rustc::mir::LvalueElem;
use rustc::mir::{Operand, ProjectionElem};

#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
pub struct AbstractOperand;
pub type AbstractProjection<'tcx> =
Projection<'tcx, Lvalue<'tcx>, AbstractOperand>;
pub type AbstractElem<'tcx> =
ProjectionElem<'tcx, AbstractOperand>;

Expand Down
15 changes: 13 additions & 2 deletions src/librustc_borrowck/borrowck/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,6 @@ struct BorrowStats {
guaranteed_paths: usize
}

pub type BckResult<'tcx, T> = Result<T, BckError<'tcx>>;

///////////////////////////////////////////////////////////////////////////
// Loans and loan paths

Expand Down Expand Up @@ -1064,6 +1062,19 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
db.note("values in a scope are dropped in the opposite order \
they are created");
}
(Some(s1), Some(s2)) if !is_temporary && !is_closure => {
db.span = MultiSpan::from_span(s2);
db.span_label(error_span, &format!("borrow occurs here"));
let msg = match opt_loan_path(&err.cmt) {
None => "borrowed value".to_string(),
Some(lp) => {
format!("`{}`", self.loan_path_to_string(&lp))
}
};
db.span_label(s2,
&format!("{} dropped here while still borrowed", msg));
db.span_label(s1, &format!("{} needs to live until here", value_kind));
}
_ => {
match sub_span {
Some(s) => {
Expand Down
Loading