From 88f2a702c7c46274331f5be08f4dde692dbf1913 Mon Sep 17 00:00:00 2001 From: hyd-dev Date: Thu, 11 Mar 2021 19:39:26 +0800 Subject: [PATCH 1/8] Add regression test for https://github.com/rust-lang/rust/issues/81555 --- src/test/ui/proc-macro/issue-81555.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/test/ui/proc-macro/issue-81555.rs diff --git a/src/test/ui/proc-macro/issue-81555.rs b/src/test/ui/proc-macro/issue-81555.rs new file mode 100644 index 0000000000000..693f1f7dc39ff --- /dev/null +++ b/src/test/ui/proc-macro/issue-81555.rs @@ -0,0 +1,15 @@ +// check-pass +// aux-build:test-macros.rs +#![feature(stmt_expr_attributes, proc_macro_hygiene)] + +extern crate test_macros; + +use test_macros::identity_attr; + +#[identity_attr] +fn main() { + let _x; + let y = (); + #[identity_attr] + _x = y; +} From c8b2c86b2eaa2d98add7c13e6c9c5df11ca34549 Mon Sep 17 00:00:00 2001 From: hyd-dev Date: Thu, 11 Mar 2021 20:19:27 +0800 Subject: [PATCH 2/8] Add regression test for https://github.com/rust-lang/rust/issues/79825 --- src/test/ui/proc-macro/auxiliary/issue-79825.rs | 14 ++++++++++++++ src/test/ui/proc-macro/issue-79825.rs | 10 ++++++++++ 2 files changed, 24 insertions(+) create mode 100644 src/test/ui/proc-macro/auxiliary/issue-79825.rs create mode 100644 src/test/ui/proc-macro/issue-79825.rs diff --git a/src/test/ui/proc-macro/auxiliary/issue-79825.rs b/src/test/ui/proc-macro/auxiliary/issue-79825.rs new file mode 100644 index 0000000000000..930891b1d43f9 --- /dev/null +++ b/src/test/ui/proc-macro/auxiliary/issue-79825.rs @@ -0,0 +1,14 @@ +// force-host +// no-prefer-dynamic +#![crate_type = "proc-macro"] + +extern crate proc_macro; + +use proc_macro::TokenStream; + +#[proc_macro_attribute] +pub fn assert_input(args: TokenStream, input: TokenStream) -> TokenStream { + assert_eq!(input.to_string(), "trait Alias = Sized ;"); + assert!(args.is_empty()); + TokenStream::new() +} diff --git a/src/test/ui/proc-macro/issue-79825.rs b/src/test/ui/proc-macro/issue-79825.rs new file mode 100644 index 0000000000000..f628469ce3a62 --- /dev/null +++ b/src/test/ui/proc-macro/issue-79825.rs @@ -0,0 +1,10 @@ +// check-pass +// aux-build:issue-79825.rs +#![feature(trait_alias)] + +extern crate issue_79825; + +#[issue_79825::assert_input] +trait Alias = Sized; + +fn main() {} From ce6658818da9844d7adb85a573952ba081b466ac Mon Sep 17 00:00:00 2001 From: JohnTitor Date: Wed, 31 Mar 2021 18:48:28 +0900 Subject: [PATCH 3/8] Add a regression test for issue-68830 --- .../issue-68830-spurious-diagnostics.rs | 23 +++++++++++++++++++ .../issue-68830-spurious-diagnostics.stderr | 9 ++++++++ 2 files changed, 32 insertions(+) create mode 100644 src/test/ui/specialization/issue-68830-spurious-diagnostics.rs create mode 100644 src/test/ui/specialization/issue-68830-spurious-diagnostics.stderr diff --git a/src/test/ui/specialization/issue-68830-spurious-diagnostics.rs b/src/test/ui/specialization/issue-68830-spurious-diagnostics.rs new file mode 100644 index 0000000000000..d11ec79833217 --- /dev/null +++ b/src/test/ui/specialization/issue-68830-spurious-diagnostics.rs @@ -0,0 +1,23 @@ +// A regression test for #68830. This checks we don't emit +// a verbose `conflicting implementations` error. + +#![feature(specialization)] +#![allow(incomplete_features)] + +struct BadStruct { + err: MissingType //~ ERROR: cannot find type `MissingType` in this scope +} + +trait MyTrait { + fn foo(); +} + +impl MyTrait for D { + default fn foo() {} +} + +impl MyTrait for BadStruct { + fn foo() {} +} + +fn main() {} diff --git a/src/test/ui/specialization/issue-68830-spurious-diagnostics.stderr b/src/test/ui/specialization/issue-68830-spurious-diagnostics.stderr new file mode 100644 index 0000000000000..833f61dca8cac --- /dev/null +++ b/src/test/ui/specialization/issue-68830-spurious-diagnostics.stderr @@ -0,0 +1,9 @@ +error[E0412]: cannot find type `MissingType` in this scope + --> $DIR/issue-68830-spurious-diagnostics.rs:8:10 + | +LL | err: MissingType + | ^^^^^^^^^^^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0412`. From e7821e5475b0628eb9cb87534dad131c577de03c Mon Sep 17 00:00:00 2001 From: Frank Steffahn Date: Wed, 31 Mar 2021 12:11:24 +0200 Subject: [PATCH 4/8] Fix documentation of conversion from String to OsString --- library/std/src/ffi/os_str.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs index 14914287cb1b1..6fc97d628d722 100644 --- a/library/std/src/ffi/os_str.rs +++ b/library/std/src/ffi/os_str.rs @@ -361,7 +361,7 @@ impl OsString { impl From for OsString { /// Converts a [`String`] into a [`OsString`]. /// - /// The conversion copies the data, and includes an allocation on the heap. + /// This conversion does not allocate or copy memory. #[inline] fn from(s: String) -> OsString { OsString { inner: Buf::from_string(s) } From f5e7dbb20a4090f089f09a116ab7a75ad4296398 Mon Sep 17 00:00:00 2001 From: Frank Steffahn Date: Wed, 31 Mar 2021 12:24:37 +0200 Subject: [PATCH 5/8] Add a few missing links, fix a typo --- library/std/src/ffi/os_str.rs | 2 +- library/std/src/path.rs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs index 6fc97d628d722..ecaab67034908 100644 --- a/library/std/src/ffi/os_str.rs +++ b/library/std/src/ffi/os_str.rs @@ -858,7 +858,7 @@ impl From> for Box { #[stable(feature = "os_string_from_box", since = "1.18.0")] impl From> for OsString { - /// Converts a [`Box`]`<`[`OsStr`]`>` into a `OsString` without copying or + /// Converts a [`Box`]`<`[`OsStr`]`>` into an [`OsString`] without copying or /// allocating. #[inline] fn from(boxed: Box) -> OsString { diff --git a/library/std/src/path.rs b/library/std/src/path.rs index 57c892f32b193..984c9b4156795 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -1467,7 +1467,7 @@ impl> From<&T> for PathBuf { #[stable(feature = "rust1", since = "1.0.0")] impl From for PathBuf { - /// Converts a `OsString` into a `PathBuf` + /// Converts a [`OsString`] into a [`PathBuf`] /// /// This conversion does not allocate or copy memory. #[inline] @@ -1478,7 +1478,7 @@ impl From for PathBuf { #[stable(feature = "from_path_buf_for_os_string", since = "1.14.0")] impl From for OsString { - /// Converts a `PathBuf` into a `OsString` + /// Converts a [`PathBuf`] into a [`OsString`] /// /// This conversion does not allocate or copy memory. #[inline] @@ -1489,7 +1489,7 @@ impl From for OsString { #[stable(feature = "rust1", since = "1.0.0")] impl From for PathBuf { - /// Converts a `String` into a `PathBuf` + /// Converts a [`String`] into a [`PathBuf`] /// /// This conversion does not allocate or copy memory. #[inline] @@ -1595,7 +1595,7 @@ impl<'a> From> for PathBuf { #[stable(feature = "shared_from_slice2", since = "1.24.0")] impl From for Arc { - /// Converts a `PathBuf` into an `Arc` by moving the `PathBuf` data into a new `Arc` buffer. + /// Converts a [`PathBuf`] into an [`Arc`] by moving the [`PathBuf`] data into a new [`Arc`] buffer. #[inline] fn from(s: PathBuf) -> Arc { let arc: Arc = Arc::from(s.into_os_string()); @@ -1605,7 +1605,7 @@ impl From for Arc { #[stable(feature = "shared_from_slice2", since = "1.24.0")] impl From<&Path> for Arc { - /// Converts a `Path` into an `Arc` by copying the `Path` data into a new `Arc` buffer. + /// Converts a [`Path`] into an [`Arc`] by copying the [`Path`] data into a new [`Arc`] buffer. #[inline] fn from(s: &Path) -> Arc { let arc: Arc = Arc::from(s.as_os_str()); @@ -1615,7 +1615,7 @@ impl From<&Path> for Arc { #[stable(feature = "shared_from_slice2", since = "1.24.0")] impl From for Rc { - /// Converts a `PathBuf` into an `Rc` by moving the `PathBuf` data into a new `Rc` buffer. + /// Converts a [`PathBuf`] into an [`Rc`] by moving the [`PathBuf`] data into a new `Rc` buffer. #[inline] fn from(s: PathBuf) -> Rc { let rc: Rc = Rc::from(s.into_os_string()); @@ -1625,7 +1625,7 @@ impl From for Rc { #[stable(feature = "shared_from_slice2", since = "1.24.0")] impl From<&Path> for Rc { - /// Converts a `Path` into an `Rc` by copying the `Path` data into a new `Rc` buffer. + /// Converts a [`Path`] into an [`Rc`] by copying the [`Path`] data into a new `Rc` buffer. #[inline] fn from(s: &Path) -> Rc { let rc: Rc = Rc::from(s.as_os_str()); From 7509aa108c6bb852062e72de6fef5297f0d624e9 Mon Sep 17 00:00:00 2001 From: Frank Steffahn Date: Wed, 31 Mar 2021 16:08:20 +0200 Subject: [PATCH 6/8] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit More links, one more occurrence of “a OsString” Co-authored-by: Yuki Okushi --- library/std/src/path.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/std/src/path.rs b/library/std/src/path.rs index 984c9b4156795..f4020a428791e 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -1467,7 +1467,7 @@ impl> From<&T> for PathBuf { #[stable(feature = "rust1", since = "1.0.0")] impl From for PathBuf { - /// Converts a [`OsString`] into a [`PathBuf`] + /// Converts an [`OsString`] into a [`PathBuf`] /// /// This conversion does not allocate or copy memory. #[inline] @@ -1478,7 +1478,7 @@ impl From for PathBuf { #[stable(feature = "from_path_buf_for_os_string", since = "1.14.0")] impl From for OsString { - /// Converts a [`PathBuf`] into a [`OsString`] + /// Converts a [`PathBuf`] into an [`OsString`] /// /// This conversion does not allocate or copy memory. #[inline] From 82c6709d6fe46f6b7f2e7dc14e42eac1b5543080 Mon Sep 17 00:00:00 2001 From: JohnTitor Date: Thu, 1 Apr 2021 01:59:50 +0900 Subject: [PATCH 7/8] Clarify `--print target-list` is a rustc's option --- compiler/rustc_session/src/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index 6540d4610473c..3692219cb6d44 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -953,7 +953,7 @@ pub fn build_target_config(opts: &Options, target_override: Option) -> T opts.error_format, &format!( "Error loading target specification: {}. \ - Use `--print target-list` for a list of built-in targets", + Run `rustc --print target-list` for a list of built-in targets", e ), ) From 9acf558db426ac2875838d1bc5e499d57b1c3f99 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 31 Mar 2021 10:24:41 -0700 Subject: [PATCH 8/8] Update LLVM with another wasm simd fix Just a small bug fix for opcode numberings, not too major. --- src/llvm-project | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llvm-project b/src/llvm-project index c3a26cbf6e73f..0abbcc04d8375 160000 --- a/src/llvm-project +++ b/src/llvm-project @@ -1 +1 @@ -Subproject commit c3a26cbf6e73f2c5f8d03cee1f151d90a266ef3c +Subproject commit 0abbcc04d8375661a0637896b9ae5dc37a99dc70