From a2d63d65da7de9b1245a19320cd4c5cbf6b4dd73 Mon Sep 17 00:00:00 2001 From: Virgil Palanciuc Date: Mon, 30 Oct 2017 19:52:10 +0200 Subject: [PATCH 1/5] Add test for #44953 --- .../ui-fulldeps/issue-44953/issue-44953.rs | 20 +++++++++++++++++++ .../issue-44953/issue-44953.stderr | 19 ++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 src/test/ui-fulldeps/issue-44953/issue-44953.rs create mode 100644 src/test/ui-fulldeps/issue-44953/issue-44953.stderr diff --git a/src/test/ui-fulldeps/issue-44953/issue-44953.rs b/src/test/ui-fulldeps/issue-44953/issue-44953.rs new file mode 100644 index 0000000000000..256305bf17df8 --- /dev/null +++ b/src/test/ui-fulldeps/issue-44953/issue-44953.rs @@ -0,0 +1,20 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. +// + + +#![feature(proc_macro)] +#![allow(unused_macros)] + +#[macro_use] extern crate log; + +pub fn main() { + info!("This is a log message."); +} diff --git a/src/test/ui-fulldeps/issue-44953/issue-44953.stderr b/src/test/ui-fulldeps/issue-44953/issue-44953.stderr new file mode 100644 index 0000000000000..ce17ea7916122 --- /dev/null +++ b/src/test/ui-fulldeps/issue-44953/issue-44953.stderr @@ -0,0 +1,19 @@ +error: use of unstable library feature 'rustc_private': this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead? (see issue #27812) + --> $DIR/issue-44953.rs:16:14 + | +16 | #[macro_use] extern crate log; + | ^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(rustc_private)] to the crate attributes to enable + +error: use of unstable library feature 'rustc_private': this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead? (see issue #27812) + --> $DIR/issue-44953.rs:19:5 + | +19 | info!("This is a log message."); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(rustc_private)] to the crate attributes to enable + = note: this error originates in a macro outside of the current crate (run with -Z external-macro-backtrace for more info) + +error: aborting due to 2 previous errors + From fb094642e13fc7b41a55aa2eaba4361411cccf8f Mon Sep 17 00:00:00 2001 From: Oliver Middleton Date: Wed, 22 Nov 2017 00:49:28 +0000 Subject: [PATCH 2/5] Add missing Debug impls to std_unicode Also adds #![deny(missing_debug_implementations)] so they don't get missed again. --- src/libstd_unicode/char.rs | 5 ++++- src/libstd_unicode/lib.rs | 1 + src/libstd_unicode/lossy.rs | 1 + src/libstd_unicode/u_str.rs | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libstd_unicode/char.rs b/src/libstd_unicode/char.rs index e20937c6c7bdb..0faf5bd912101 100644 --- a/src/libstd_unicode/char.rs +++ b/src/libstd_unicode/char.rs @@ -57,6 +57,7 @@ pub use tables::{UnicodeVersion, UNICODE_VERSION}; /// [`to_lowercase`]: ../../std/primitive.char.html#method.to_lowercase /// [`char`]: ../../std/primitive.char.html #[stable(feature = "rust1", since = "1.0.0")] +#[derive(Debug)] pub struct ToLowercase(CaseMappingIter); #[stable(feature = "rust1", since = "1.0.0")] @@ -78,6 +79,7 @@ impl FusedIterator for ToLowercase {} /// [`to_uppercase`]: ../../std/primitive.char.html#method.to_uppercase /// [`char`]: ../../std/primitive.char.html #[stable(feature = "rust1", since = "1.0.0")] +#[derive(Debug)] pub struct ToUppercase(CaseMappingIter); #[stable(feature = "rust1", since = "1.0.0")] @@ -91,6 +93,7 @@ impl Iterator for ToUppercase { #[unstable(feature = "fused", issue = "35602")] impl FusedIterator for ToUppercase {} +#[derive(Debug)] enum CaseMappingIter { Three(char, char, char), Two(char, char), @@ -1450,7 +1453,7 @@ impl char { /// An iterator that decodes UTF-16 encoded code points from an iterator of `u16`s. #[stable(feature = "decode_utf16", since = "1.9.0")] -#[derive(Clone)] +#[derive(Clone, Debug)] pub struct DecodeUtf16 where I: Iterator { diff --git a/src/libstd_unicode/lib.rs b/src/libstd_unicode/lib.rs index 65058b6554aa6..22f8bdab2f7b5 100644 --- a/src/libstd_unicode/lib.rs +++ b/src/libstd_unicode/lib.rs @@ -28,6 +28,7 @@ issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/", test(no_crate_inject, attr(allow(unused_variables), deny(warnings))))] #![deny(warnings)] +#![deny(missing_debug_implementations)] #![no_std] #![feature(ascii_ctype)] diff --git a/src/libstd_unicode/lossy.rs b/src/libstd_unicode/lossy.rs index 253dcb6a15951..cc8e93308a527 100644 --- a/src/libstd_unicode/lossy.rs +++ b/src/libstd_unicode/lossy.rs @@ -38,6 +38,7 @@ impl Utf8Lossy { /// Iterator over lossy UTF-8 string #[unstable(feature = "str_internals", issue = "0")] +#[allow(missing_debug_implementations)] pub struct Utf8LossyChunksIter<'a> { source: &'a [u8], } diff --git a/src/libstd_unicode/u_str.rs b/src/libstd_unicode/u_str.rs index 0046e3f7bd093..5d1611acb7ee6 100644 --- a/src/libstd_unicode/u_str.rs +++ b/src/libstd_unicode/u_str.rs @@ -76,6 +76,7 @@ impl UnicodeStr for str { /// Iterator adaptor for encoding `char`s to UTF-16. #[derive(Clone)] +#[allow(missing_debug_implementations)] pub struct Utf16Encoder { chars: I, extra: u16, From cdc6b8415748d44aee37d91de91ece4eeb371122 Mon Sep 17 00:00:00 2001 From: steveklabnik Date: Wed, 22 Nov 2017 14:04:41 -0500 Subject: [PATCH 3/5] Amend RELEASES for 1.22.1 and fix the date for 1.22.0 --- RELEASES.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/RELEASES.md b/RELEASES.md index 7f5035a837cf0..57434ebc1f600 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,4 +1,11 @@ -Version 1.22.0 (2017-11-23) +Version 1.22.1 (2017-11-22) +========================== + +- [Update Cargo to fix an issue with macOS 10.13 "High Sierra"][46183] + +[46183]: https://github.com/rust-lang/rust/pull/46183 + +Version 1.22.0 (2017-11-22) ========================== Language From e1b479cff94005b38717abd74598478cd7180766 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Wed, 22 Nov 2017 19:56:48 -0500 Subject: [PATCH 4/5] Rename param in `[T]::swap_with_slice` from `src` to `other`. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The idea of ‘source’ and ‘destination’ aren’t very applicable for this operation since both slices can both be considered sources and destinations. --- src/liballoc/slice.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs index b41cb912fe798..7e3d2af79ce2b 100644 --- a/src/liballoc/slice.rs +++ b/src/liballoc/slice.rs @@ -1468,9 +1468,9 @@ impl [T] { core_slice::SliceExt::copy_from_slice(self, src) } - /// Swaps all elements in `self` with those in `src`. + /// Swaps all elements in `self` with those in `other`. /// - /// The length of `src` must be the same as `self`. + /// The length of `other` must be the same as `self`. /// /// # Panics /// @@ -1481,16 +1481,16 @@ impl [T] { /// ``` /// #![feature(swap_with_slice)] /// - /// let mut src = [1, 2, 3]; - /// let mut dst = [7, 8, 9]; + /// let mut slice1 = [1, 2, 3]; + /// let mut slice2 = [7, 8, 9]; /// - /// src.swap_with_slice(&mut dst); - /// assert_eq!(src, [7, 8, 9]); - /// assert_eq!(dst, [1, 2, 3]); + /// slice1.swap_with_slice(&mut slice2); + /// assert_eq!(slice1, [7, 8, 9]); + /// assert_eq!(slice2, [1, 2, 3]); /// ``` #[unstable(feature = "swap_with_slice", issue = "44030")] - pub fn swap_with_slice(&mut self, src: &mut [T]) { - core_slice::SliceExt::swap_with_slice(self, src) + pub fn swap_with_slice(&mut self, other: &mut [T]) { + core_slice::SliceExt::swap_with_slice(self, other) } /// Copies `self` into a new `Vec`. From 2178e3a1b90a8169dc7439f28f8346f7c9c4d144 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Wed, 22 Nov 2017 20:47:31 -0500 Subject: [PATCH 5/5] Clarify stdin behavior of `Command::output`. Fixes #44929. --- src/libstd/process.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libstd/process.rs b/src/libstd/process.rs index 35c33f4025380..2335695ae42d4 100644 --- a/src/libstd/process.rs +++ b/src/libstd/process.rs @@ -712,8 +712,10 @@ impl Command { /// Executes the command as a child process, waiting for it to finish and /// collecting all of its output. /// - /// By default, stdin, stdout and stderr are captured (and used to - /// provide the resulting output). + /// By default, stdout and stderr are captured (and used to provide the + /// resulting output). Stdin is not inherited from the parent and any + /// attempt by the child process to read from the stdin stream will result + /// in the stream immediately closing. /// /// # Examples ///