Skip to content

Commit

Permalink
Auto merge of #60104 - Centril:rollup-7vmae1a, r=Centril
Browse files Browse the repository at this point in the history
Rollup of 16 pull requests

Successful merges:

 - #59915 (Implement event filtering for self-profiler.)
 - #59933 (Make clear that format padding doesn't work for Debug)
 - #60023 (implement specialized nth_back() for Bytes, Fuse and Enumerate)
 - #60032 (Remove unwanted z-index change)
 - #60041 (Simplify the returning of a Result a bit)
 - #60045 (Suggest appropriate path when calling associated item on bare types)
 - #60052 (Correct unused parameter diagnostic)
 - #60056 (Update rustfmt to 1.2.1)
 - #60060 (whitelist RTM x86 target cpu feature)
 - #60061 (Change suggestion of field when not in self context)
 - #60064 (Point at try `?` on errors affecting the err match arm of the desugared code)
 - #60078 (Use more realistic example for thread builder)
 - #60080 (Fix small errors in docs for `rchunks_exact` and `rchunks_exact_mut`.)
 - #60082 (Update miri)
 - #60097 (Use -mergefunc-use-aliases for any LLVM >= 8)
 - #60098 (libcore: deny `elided_lifetimes_in_paths`)

Failed merges:

r? @ghost
  • Loading branch information
bors committed Apr 19, 2019
2 parents e928e94 + 3ad9fcc commit 316a391
Show file tree
Hide file tree
Showing 91 changed files with 670 additions and 403 deletions.
17 changes: 14 additions & 3 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ dependencies = [
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "annotate-snippets"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "ansi_term"
version = "0.11.0"
Expand Down Expand Up @@ -2246,7 +2254,7 @@ dependencies = [
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-workspace-hack 1.0.0",
"rustc_tools_util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustfmt-nightly 1.2.0",
"rustfmt-nightly 1.2.1",
"serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_ignored 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
Expand Down Expand Up @@ -3038,8 +3046,9 @@ dependencies = [

[[package]]
name = "rustfmt-nightly"
version = "1.2.0"
version = "1.2.1"
dependencies = [
"annotate-snippets 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"bytecount 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cargo_metadata 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
Expand All @@ -3049,6 +3058,7 @@ dependencies = [
"env_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
"ignore 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
Expand All @@ -3061,7 +3071,7 @@ dependencies = [
"serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.33 (registry+https://github.com/rust-lang/crates.io-index)",
"term 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode_categories 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
Expand Down Expand Up @@ -3987,6 +3997,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e522997b529f05601e05166c07ed17789691f562762c7f3b987263d2dedee5c"
"checksum aho-corasick 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1e9a933f4e58658d7b12defcf96dc5c720f20832deebe3e0a19efd3b6aaeeb9e"
"checksum ammonia 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fd4c682378117e4186a492b2252b9537990e1617f44aed9788b9a1149de45477"
"checksum annotate-snippets 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e8bcdcd5b291ce85a78f2b9d082a8de9676c12b1840d386d67bc5eea6f9d2b4e"
"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
"checksum arc-swap 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1025aeae2b664ca0ea726a89d574fe8f4e77dd712d443236ad1de00379450cf6"
"checksum argon2rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3f67b0b6a86dae6e67ff4ca2b6201396074996379fba2b92ff649126f37cb392"
Expand Down
7 changes: 4 additions & 3 deletions src/liballoc/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,10 @@
//! * `^` - the argument is center-aligned in `width` columns
//! * `>` - the argument is right-aligned in `width` columns
//!
//! Note that alignment may not be implemented by some types. A good way
//! to ensure padding is applied is to format your input, then use this
//! resulting string to pad your output.
//! Note that alignment may not be implemented by some types. In particular, it
//! is not generally implemented for the `Debug` trait. A good way to ensure
//! padding is applied is to format your input, then use this resulting string
//! to pad your output.
//!
//! ## Sign/`#`/`0`
//!
Expand Down
6 changes: 3 additions & 3 deletions src/libcore/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ pub struct LayoutErr {
// (we need this for downstream impl of trait Error)
#[stable(feature = "alloc_layout", since = "1.28.0")]
impl fmt::Display for LayoutErr {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("invalid parameters to Layout::from_size_align")
}
}
Expand All @@ -354,7 +354,7 @@ pub struct AllocErr;
// (we need this for downstream impl of trait Error)
#[unstable(feature = "allocator_api", issue = "32838")]
impl fmt::Display for AllocErr {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("memory allocation failed")
}
}
Expand All @@ -376,7 +376,7 @@ impl CannotReallocInPlace {
// (we need this for downstream impl of trait Error)
#[unstable(feature = "allocator_api", issue = "32838")]
impl fmt::Display for CannotReallocInPlace {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.description())
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/libcore/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ impl<T: 'static + ?Sized > Any for T {

#[stable(feature = "rust1", since = "1.0.0")]
impl fmt::Debug for dyn Any {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.pad("Any")
}
}
Expand All @@ -117,14 +117,14 @@ impl fmt::Debug for dyn Any {
// dispatch works with upcasting.
#[stable(feature = "rust1", since = "1.0.0")]
impl fmt::Debug for dyn Any + Send {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.pad("Any")
}
}

#[stable(feature = "any_send_sync_methods", since = "1.28.0")]
impl fmt::Debug for dyn Any + Send + Sync {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.pad("Any")
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub struct TryFromSliceError(());

impl fmt::Display for TryFromSliceError {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Display::fmt(self.__description(), f)
}
}
Expand Down Expand Up @@ -184,7 +184,7 @@ macro_rules! array_impls {

#[stable(feature = "rust1", since = "1.0.0")]
impl<T: fmt::Debug> fmt::Debug for [T; $N] {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Debug::fmt(&&self[..], f)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/ascii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl FusedIterator for EscapeDefault {}

#[stable(feature = "std_debug", since = "1.16.0")]
impl fmt::Debug for EscapeDefault {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.pad("EscapeDefault { .. }")
}
}
20 changes: 10 additions & 10 deletions src/libcore/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,14 +577,14 @@ pub struct BorrowError {

#[stable(feature = "try_borrow", since = "1.13.0")]
impl Debug for BorrowError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("BorrowError").finish()
}
}

#[stable(feature = "try_borrow", since = "1.13.0")]
impl Display for BorrowError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Display::fmt("already mutably borrowed", f)
}
}
Expand All @@ -597,14 +597,14 @@ pub struct BorrowMutError {

#[stable(feature = "try_borrow", since = "1.13.0")]
impl Debug for BorrowMutError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("BorrowMutError").finish()
}
}

#[stable(feature = "try_borrow", since = "1.13.0")]
impl Display for BorrowMutError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Display::fmt("already borrowed", f)
}
}
Expand Down Expand Up @@ -788,7 +788,7 @@ impl<T: ?Sized> RefCell<T> {
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn borrow(&self) -> Ref<T> {
pub fn borrow(&self) -> Ref<'_, T> {
self.try_borrow().expect("already mutably borrowed")
}

Expand Down Expand Up @@ -819,7 +819,7 @@ impl<T: ?Sized> RefCell<T> {
/// ```
#[stable(feature = "try_borrow", since = "1.13.0")]
#[inline]
pub fn try_borrow(&self) -> Result<Ref<T>, BorrowError> {
pub fn try_borrow(&self) -> Result<Ref<'_, T>, BorrowError> {
match BorrowRef::new(&self.borrow) {
Some(b) => Ok(Ref {
value: unsafe { &*self.value.get() },
Expand Down Expand Up @@ -869,7 +869,7 @@ impl<T: ?Sized> RefCell<T> {
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn borrow_mut(&self) -> RefMut<T> {
pub fn borrow_mut(&self) -> RefMut<'_, T> {
self.try_borrow_mut().expect("already borrowed")
}

Expand Down Expand Up @@ -897,7 +897,7 @@ impl<T: ?Sized> RefCell<T> {
/// ```
#[stable(feature = "try_borrow", since = "1.13.0")]
#[inline]
pub fn try_borrow_mut(&self) -> Result<RefMut<T>, BorrowMutError> {
pub fn try_borrow_mut(&self) -> Result<RefMut<'_, T>, BorrowMutError> {
match BorrowRefMut::new(&self.borrow) {
Some(b) => Ok(RefMut {
value: unsafe { &mut *self.value.get() },
Expand Down Expand Up @@ -1245,7 +1245,7 @@ impl<'b, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Ref<'b, U>> for Ref<'b,

#[stable(feature = "std_guard_impls", since = "1.20.0")]
impl<T: ?Sized + fmt::Display> fmt::Display for Ref<'_, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
self.value.fmt(f)
}
}
Expand Down Expand Up @@ -1402,7 +1402,7 @@ impl<'b, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<RefMut<'b, U>> for RefM

#[stable(feature = "std_guard_impls", since = "1.20.0")]
impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
self.value.fmt(f)
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/libcore/char/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ enum CharErrorKind {

#[stable(feature = "char_from_str", since = "1.20.0")]
impl fmt::Display for ParseCharError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
self.__description().fmt(f)
}
}
Expand Down Expand Up @@ -240,7 +240,7 @@ pub struct CharTryFromError(());

#[stable(feature = "try_from", since = "1.34.0")]
impl fmt::Display for CharTryFromError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
"converted integer out of range for `char`".fmt(f)
}
}
Expand Down Expand Up @@ -316,4 +316,3 @@ pub fn from_digit(num: u32, radix: u32) -> Option<char> {
None
}
}

2 changes: 1 addition & 1 deletion src/libcore/char/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl DecodeUtf16Error {

#[stable(feature = "decode_utf16", since = "1.9.0")]
impl fmt::Display for DecodeUtf16Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "unpaired surrogate found: {:x}", self.code)
}
}
12 changes: 6 additions & 6 deletions src/libcore/char/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ impl FusedIterator for EscapeUnicode {}

#[stable(feature = "char_struct_display", since = "1.16.0")]
impl fmt::Display for EscapeUnicode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
for c in self.clone() {
f.write_char(c)?;
}
Expand Down Expand Up @@ -333,7 +333,7 @@ impl FusedIterator for EscapeDefault {}

#[stable(feature = "char_struct_display", since = "1.16.0")]
impl fmt::Display for EscapeDefault {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
for c in self.clone() {
f.write_char(c)?;
}
Expand Down Expand Up @@ -367,7 +367,7 @@ impl FusedIterator for EscapeDebug {}

#[stable(feature = "char_escape_debug", since = "1.20.0")]
impl fmt::Display for EscapeDebug {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Display::fmt(&self.0, f)
}
}
Expand Down Expand Up @@ -482,7 +482,7 @@ impl Iterator for CaseMappingIter {
}

impl fmt::Display for CaseMappingIter {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {
CaseMappingIter::Three(a, b, c) => {
f.write_char(a)?;
Expand All @@ -503,14 +503,14 @@ impl fmt::Display for CaseMappingIter {

#[stable(feature = "char_struct_display", since = "1.16.0")]
impl fmt::Display for ToLowercase {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Display::fmt(&self.0, f)
}
}

#[stable(feature = "char_struct_display", since = "1.16.0")]
impl fmt::Display for ToUppercase {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Display::fmt(&self.0, f)
}
}
10 changes: 5 additions & 5 deletions src/libcore/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub enum c_void {

#[stable(feature = "std_debug", since = "1.16.0")]
impl fmt::Debug for c_void {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.pad("c_void")
}
}
Expand All @@ -62,7 +62,7 @@ extern {
all(target_arch = "aarch64", target_os = "ios"),
windows))]
impl fmt::Debug for VaListImpl {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "va_list* {:p}", self)
}
}
Expand Down Expand Up @@ -212,7 +212,7 @@ impl<'a> VaList<'a> {
extern "rust-intrinsic" {
/// Destroy the arglist `ap` after initialization with `va_start` or
/// `va_copy`.
fn va_end(ap: &mut VaList);
fn va_end(ap: &mut VaList<'_>);

/// Copies the current location of arglist `src` to the arglist `dst`.
#[cfg(any(all(not(target_arch = "aarch64"), not(target_arch = "powerpc"),
Expand All @@ -222,9 +222,9 @@ extern "rust-intrinsic" {
fn va_copy<'a>(src: &VaList<'a>) -> VaList<'a>;
#[cfg(all(any(target_arch = "aarch64", target_arch = "powerpc", target_arch = "x86_64"),
not(windows), not(all(target_arch = "aarch64", target_os = "ios"))))]
fn va_copy(src: &VaList) -> VaListImpl;
fn va_copy(src: &VaList<'_>) -> VaListImpl;

/// Loads an argument of type `T` from the `va_list` `ap` and increment the
/// argument `ap` points to.
fn va_arg<T: sealed_trait::VaArgSafe>(ap: &mut VaList) -> T;
fn va_arg<T: sealed_trait::VaArgSafe>(ap: &mut VaList<'_>) -> T;
}
2 changes: 1 addition & 1 deletion src/libcore/fmt/builders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ struct PadAdapter<'a> {
}

impl<'a> PadAdapter<'a> {
fn wrap<'b, 'c: 'a+'b>(fmt: &'c mut fmt::Formatter, slot: &'b mut Option<Self>)
fn wrap<'b, 'c: 'a+'b>(fmt: &'c mut fmt::Formatter<'_>, slot: &'b mut Option<Self>)
-> fmt::Formatter<'b> {
fmt.wrap_buf(move |buf| {
*slot = Some(PadAdapter {
Expand Down
Loading

0 comments on commit 316a391

Please sign in to comment.