From a8fbe2f22f78a97f455808284d6893cee1ed6b35 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Tue, 13 Apr 2021 14:20:49 -0700 Subject: [PATCH 01/10] Fix join_paths error display. --- library/std/src/sys/unix/os.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/sys/unix/os.rs b/library/std/src/sys/unix/os.rs index 4a077e2151ed9..ce2c4e88c7e5a 100644 --- a/library/std/src/sys/unix/os.rs +++ b/library/std/src/sys/unix/os.rs @@ -223,7 +223,7 @@ where impl fmt::Display for JoinPathsError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "path segment contains separator `{}`", PATH_SEPARATOR) + write!(f, "path segment contains separator `{}`", char::from(PATH_SEPARATOR)) } } From 0e9de930aca7446a23b28c9a286c67d13b5678a3 Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Wed, 14 Apr 2021 18:51:54 +0800 Subject: [PATCH 02/10] add macro-or-patterns-2021 test --- src/test/ui/macros/macro-or-patterns-2021.rs | 21 +++++++++++++++ .../ui/macros/macro-or-patterns-2021.stderr | 26 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 src/test/ui/macros/macro-or-patterns-2021.rs create mode 100644 src/test/ui/macros/macro-or-patterns-2021.stderr diff --git a/src/test/ui/macros/macro-or-patterns-2021.rs b/src/test/ui/macros/macro-or-patterns-2021.rs new file mode 100644 index 0000000000000..edd3f3e7646b8 --- /dev/null +++ b/src/test/ui/macros/macro-or-patterns-2021.rs @@ -0,0 +1,21 @@ +#![feature(edition_macro_pats)] +#![allow(unused_macros)] +macro_rules! foo { ($x:pat2021 | $y:pat2021) => {} } //~ ERROR `$x:pat2021` is followed by `|`, which is not allowed for `pat2021` fragments +macro_rules! baz { ($x:pat2015 | $y:pat2015) => {} } // should be ok +macro_rules! qux { ($x:pat2015 | $y:pat2021) => {} } // should be ok +macro_rules! ogg { ($x:pat2021 | $y:pat2015) => {} } //~ ERROR `$x:pat2021` is followed by `|`, which is not allowed for `pat2021` fragments +macro_rules! match_any { + ( $expr:expr , $( $( $pat:pat2021 )|+ => $expr_arm:pat2021 ),+ ) => { //~ ERROR `$pat:pat2021` may be followed by `|`, which is not allowed for `pat2021` fragments + match $expr { + $( + $( $pat => $expr_arm, )+ + )+ + } + }; +} + +fn main() { + let result: Result = Err(42); + let int: i64 = match_any!(result, Ok(i) | Err(i) => i.into()); + assert_eq!(int, 42); +} diff --git a/src/test/ui/macros/macro-or-patterns-2021.stderr b/src/test/ui/macros/macro-or-patterns-2021.stderr new file mode 100644 index 0000000000000..67feb0c2891f1 --- /dev/null +++ b/src/test/ui/macros/macro-or-patterns-2021.stderr @@ -0,0 +1,26 @@ +error: `$x:pat2021` is followed by `|`, which is not allowed for `pat2021` fragments + --> $DIR/macro-or-patterns-2021.rs:3:32 + | +LL | macro_rules! foo { ($x:pat2021 | $y:pat2021) => {} } + | ^ not allowed after `pat2021` fragments + | + = note: allowed there are: `=>`, `,`, `=`, `if` or `in` + +error: `$x:pat2021` is followed by `|`, which is not allowed for `pat2021` fragments + --> $DIR/macro-or-patterns-2021.rs:6:32 + | +LL | macro_rules! ogg { ($x:pat2021 | $y:pat2015) => {} } + | ^ not allowed after `pat2021` fragments + | + = note: allowed there are: `=>`, `,`, `=`, `if` or `in` + +error: `$pat:pat2021` may be followed by `|`, which is not allowed for `pat2021` fragments + --> $DIR/macro-or-patterns-2021.rs:8:40 + | +LL | ( $expr:expr , $( $( $pat:pat2021 )|+ => $expr_arm:pat2021 ),+ ) => { + | ^ not allowed after `pat2021` fragments + | + = note: allowed there are: `=>`, `,`, `=`, `if` or `in` + +error: aborting due to 3 previous errors + From 905d23b65c07a1da4452f9a20b1891fc46533fb7 Mon Sep 17 00:00:00 2001 From: Christiaan Dirkx Date: Wed, 24 Feb 2021 19:16:24 +0100 Subject: [PATCH 03/10] Move `std::sys_common::alloc` to `std::sys::common` --- library/std/src/{sys_common => sys/common}/alloc.rs | 0 library/std/src/sys/common/mod.rs | 1 + library/std/src/sys/mod.rs | 2 ++ library/std/src/sys/unix/alloc.rs | 2 +- library/std/src/sys/windows/alloc.rs | 2 +- library/std/src/sys_common/mod.rs | 1 - 6 files changed, 5 insertions(+), 3 deletions(-) rename library/std/src/{sys_common => sys/common}/alloc.rs (100%) create mode 100644 library/std/src/sys/common/mod.rs diff --git a/library/std/src/sys_common/alloc.rs b/library/std/src/sys/common/alloc.rs similarity index 100% rename from library/std/src/sys_common/alloc.rs rename to library/std/src/sys/common/alloc.rs diff --git a/library/std/src/sys/common/mod.rs b/library/std/src/sys/common/mod.rs new file mode 100644 index 0000000000000..920965d5944d7 --- /dev/null +++ b/library/std/src/sys/common/mod.rs @@ -0,0 +1 @@ +pub mod alloc; diff --git a/library/std/src/sys/mod.rs b/library/std/src/sys/mod.rs index 9b359392cf0cd..50c2660ebcf1f 100644 --- a/library/std/src/sys/mod.rs +++ b/library/std/src/sys/mod.rs @@ -22,6 +22,8 @@ #![allow(missing_debug_implementations)] +mod common; + cfg_if::cfg_if! { if #[cfg(target_os = "vxworks")] { mod vxworks; diff --git a/library/std/src/sys/unix/alloc.rs b/library/std/src/sys/unix/alloc.rs index 964abe8b8c9ea..1b71905aa09b7 100644 --- a/library/std/src/sys/unix/alloc.rs +++ b/library/std/src/sys/unix/alloc.rs @@ -1,6 +1,6 @@ use crate::alloc::{GlobalAlloc, Layout, System}; use crate::ptr; -use crate::sys_common::alloc::{realloc_fallback, MIN_ALIGN}; +use crate::sys::common::alloc::{realloc_fallback, MIN_ALIGN}; #[stable(feature = "alloc_system_type", since = "1.28.0")] unsafe impl GlobalAlloc for System { diff --git a/library/std/src/sys/windows/alloc.rs b/library/std/src/sys/windows/alloc.rs index af93cd7a3e27d..2fe71f9f28d5c 100644 --- a/library/std/src/sys/windows/alloc.rs +++ b/library/std/src/sys/windows/alloc.rs @@ -5,7 +5,7 @@ use crate::ffi::c_void; use crate::ptr; use crate::sync::atomic::{AtomicPtr, Ordering}; use crate::sys::c; -use crate::sys_common::alloc::{realloc_fallback, MIN_ALIGN}; +use crate::sys::common::alloc::{realloc_fallback, MIN_ALIGN}; #[cfg(test)] mod tests; diff --git a/library/std/src/sys_common/mod.rs b/library/std/src/sys_common/mod.rs index 660f0e0df9732..9700d1f6daa61 100644 --- a/library/std/src/sys_common/mod.rs +++ b/library/std/src/sys_common/mod.rs @@ -46,7 +46,6 @@ macro_rules! rtunwrap { }; } -pub mod alloc; pub mod at_exit_imp; pub mod backtrace; pub mod bytestring; From cac0dd63b3514569ce79480b0cdf92335c5cf9f4 Mon Sep 17 00:00:00 2001 From: Christiaan Dirkx Date: Wed, 14 Apr 2021 14:03:00 +0200 Subject: [PATCH 04/10] Update documentation --- library/std/src/sys/common/alloc.rs | 2 -- library/std/src/sys/common/mod.rs | 12 ++++++++++++ library/std/src/sys_common/mod.rs | 8 +++++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/library/std/src/sys/common/alloc.rs b/library/std/src/sys/common/alloc.rs index 6c1bc0d839ad3..2a54e99020e38 100644 --- a/library/std/src/sys/common/alloc.rs +++ b/library/std/src/sys/common/alloc.rs @@ -1,5 +1,3 @@ -#![allow(dead_code)] - use crate::alloc::{GlobalAlloc, Layout, System}; use crate::cmp; use crate::ptr; diff --git a/library/std/src/sys/common/mod.rs b/library/std/src/sys/common/mod.rs index 920965d5944d7..ff64d2aa82515 100644 --- a/library/std/src/sys/common/mod.rs +++ b/library/std/src/sys/common/mod.rs @@ -1 +1,13 @@ +// This module contains code that is shared between all platforms, mostly utility or fallback code. +// This explicitly does not include code that is shared between only a few platforms, +// such as when reusing an implementation from `unix` or `unsupported`. +// In those cases the desired code should be included directly using the #[path] attribute, +// not moved to this module. +// +// Currently `sys_common` contains a lot of code that should live in this module, +// ideally `sys_common` would only contain platform-independent abstractions on top of `sys`. +// Progress on this is tracked in #84187. + +#![allow(dead_code)] + pub mod alloc; diff --git a/library/std/src/sys_common/mod.rs b/library/std/src/sys_common/mod.rs index 9700d1f6daa61..23a3a0e907dcf 100644 --- a/library/std/src/sys_common/mod.rs +++ b/library/std/src/sys_common/mod.rs @@ -8,9 +8,11 @@ //! rest of `std` is complex, with dependencies going in all //! directions: `std` depending on `sys_common`, `sys_common` //! depending on `sys`, and `sys` depending on `sys_common` and `std`. -//! Ideally `sys_common` would be split into two and the dependencies -//! between them all would form a dag, facilitating the extraction of -//! `std::sys` from the standard library. +//! This is because `sys_common` not only contains platform-independent code, +//! but also code that is shared between the different platforms in `sys`. +//! Ideally all that shared code should be moved to `sys::common`, +//! and the dependencies between `std`, `sys_common` and `sys` all would form a dag. +//! Progress on this is tracked in #84187. #![allow(missing_docs)] #![allow(missing_debug_implementations)] From 7b14eda52207a8e17d2e82b915512a232f76bbec Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Wed, 14 Apr 2021 22:16:56 +0800 Subject: [PATCH 05/10] test: add more cases --- ...acro-pat-pattern-followed-by-or-in-2021.rs | 20 ++++++++++++++ ...-pat-pattern-followed-by-or-in-2021.stderr | 26 +++++++++++++++++++ .../macro-pat-pattern-followed-by-or.rs | 20 ++++++++++++++ ...> macro-pat2021-pattern-followed-by-or.rs} | 0 ...cro-pat2021-pattern-followed-by-or.stderr} | 6 ++--- 5 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 src/test/ui/macros/macro-pat-pattern-followed-by-or-in-2021.rs create mode 100644 src/test/ui/macros/macro-pat-pattern-followed-by-or-in-2021.stderr create mode 100644 src/test/ui/macros/macro-pat-pattern-followed-by-or.rs rename src/test/ui/macros/{macro-or-patterns-2021.rs => macro-pat2021-pattern-followed-by-or.rs} (100%) rename src/test/ui/macros/{macro-or-patterns-2021.stderr => macro-pat2021-pattern-followed-by-or.stderr} (84%) diff --git a/src/test/ui/macros/macro-pat-pattern-followed-by-or-in-2021.rs b/src/test/ui/macros/macro-pat-pattern-followed-by-or-in-2021.rs new file mode 100644 index 0000000000000..20bfe7d7af704 --- /dev/null +++ b/src/test/ui/macros/macro-pat-pattern-followed-by-or-in-2021.rs @@ -0,0 +1,20 @@ +// edition:2021 +#![allow(unused_macros)] +macro_rules! foo { ($x:pat | $y:pat) => {} } //~ ERROR `$x:pat` is followed by `|`, which is not allowed for `pat` fragments +macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } //~ ERROR `$x:pat` is followed by `|`, which is not allowed for `pat` fragments +macro_rules! qux { ($x:pat) => {} } // should be ok +macro_rules! match_any { + ( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => { //~ ERROR `$pat:pat` may be followed by `|`, which is not allowed for `pat` fragments + match $expr { + $( + $( $pat => $expr_arm, )+ + )+ + } + }; +} + +fn main() { + let result: Result = Err(42); + let int: i64 = match_any!(result, Ok(i) | Err(i) => i.into()); + assert_eq!(int, 42); +} diff --git a/src/test/ui/macros/macro-pat-pattern-followed-by-or-in-2021.stderr b/src/test/ui/macros/macro-pat-pattern-followed-by-or-in-2021.stderr new file mode 100644 index 0000000000000..a5987a25551d2 --- /dev/null +++ b/src/test/ui/macros/macro-pat-pattern-followed-by-or-in-2021.stderr @@ -0,0 +1,26 @@ +error: `$x:pat` is followed by `|`, which is not allowed for `pat` fragments + --> $DIR/macro-pat-pattern-followed-by-or-in-2021.rs:3:28 + | +LL | macro_rules! foo { ($x:pat | $y:pat) => {} } + | ^ not allowed after `pat` fragments + | + = note: allowed there are: `=>`, `,`, `=`, `if` or `in` + +error: `$x:pat` is followed by `|`, which is not allowed for `pat` fragments + --> $DIR/macro-pat-pattern-followed-by-or-in-2021.rs:4:32 + | +LL | macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } + | ^ not allowed after `pat` fragments + | + = note: allowed there are: `=>`, `,`, `=`, `if` or `in` + +error: `$pat:pat` may be followed by `|`, which is not allowed for `pat` fragments + --> $DIR/macro-pat-pattern-followed-by-or-in-2021.rs:7:36 + | +LL | ( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => { + | ^ not allowed after `pat` fragments + | + = note: allowed there are: `=>`, `,`, `=`, `if` or `in` + +error: aborting due to 3 previous errors + diff --git a/src/test/ui/macros/macro-pat-pattern-followed-by-or.rs b/src/test/ui/macros/macro-pat-pattern-followed-by-or.rs new file mode 100644 index 0000000000000..c2658cdbffce9 --- /dev/null +++ b/src/test/ui/macros/macro-pat-pattern-followed-by-or.rs @@ -0,0 +1,20 @@ +// run-pass +#![allow(unused_macros)] +macro_rules! foo { ($x:pat | $y:pat) => {} } // should be ok +macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } // should be ok +macro_rules! qux { ($x:pat) => {} } // should be ok +macro_rules! match_any { + ( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => { // should be ok + match $expr { + $( + $( $pat => $expr_arm, )+ + )+ + } + }; +} + +fn main() { + let result: Result = Err(42); + let int: i64 = match_any!(result, Ok(i) | Err(i) => i.into()); + assert_eq!(int, 42); +} diff --git a/src/test/ui/macros/macro-or-patterns-2021.rs b/src/test/ui/macros/macro-pat2021-pattern-followed-by-or.rs similarity index 100% rename from src/test/ui/macros/macro-or-patterns-2021.rs rename to src/test/ui/macros/macro-pat2021-pattern-followed-by-or.rs diff --git a/src/test/ui/macros/macro-or-patterns-2021.stderr b/src/test/ui/macros/macro-pat2021-pattern-followed-by-or.stderr similarity index 84% rename from src/test/ui/macros/macro-or-patterns-2021.stderr rename to src/test/ui/macros/macro-pat2021-pattern-followed-by-or.stderr index 67feb0c2891f1..fe0b40cd86e12 100644 --- a/src/test/ui/macros/macro-or-patterns-2021.stderr +++ b/src/test/ui/macros/macro-pat2021-pattern-followed-by-or.stderr @@ -1,5 +1,5 @@ error: `$x:pat2021` is followed by `|`, which is not allowed for `pat2021` fragments - --> $DIR/macro-or-patterns-2021.rs:3:32 + --> $DIR/macro-pat2021-pattern-followed-by-or.rs:3:32 | LL | macro_rules! foo { ($x:pat2021 | $y:pat2021) => {} } | ^ not allowed after `pat2021` fragments @@ -7,7 +7,7 @@ LL | macro_rules! foo { ($x:pat2021 | $y:pat2021) => {} } = note: allowed there are: `=>`, `,`, `=`, `if` or `in` error: `$x:pat2021` is followed by `|`, which is not allowed for `pat2021` fragments - --> $DIR/macro-or-patterns-2021.rs:6:32 + --> $DIR/macro-pat2021-pattern-followed-by-or.rs:6:32 | LL | macro_rules! ogg { ($x:pat2021 | $y:pat2015) => {} } | ^ not allowed after `pat2021` fragments @@ -15,7 +15,7 @@ LL | macro_rules! ogg { ($x:pat2021 | $y:pat2015) => {} } = note: allowed there are: `=>`, `,`, `=`, `if` or `in` error: `$pat:pat2021` may be followed by `|`, which is not allowed for `pat2021` fragments - --> $DIR/macro-or-patterns-2021.rs:8:40 + --> $DIR/macro-pat2021-pattern-followed-by-or.rs:8:40 | LL | ( $expr:expr , $( $( $pat:pat2021 )|+ => $expr_arm:pat2021 ),+ ) => { | ^ not allowed after `pat2021` fragments From eb944c1466c4bfac0315a0f9e7727454147100a4 Mon Sep 17 00:00:00 2001 From: hi-rustin Date: Wed, 14 Apr 2021 22:31:44 +0800 Subject: [PATCH 06/10] test: add reasonable case --- src/test/ui/macros/macro-pat-pattern-followed-by-or-in-2021.rs | 2 +- src/test/ui/macros/macro-pat-pattern-followed-by-or.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/ui/macros/macro-pat-pattern-followed-by-or-in-2021.rs b/src/test/ui/macros/macro-pat-pattern-followed-by-or-in-2021.rs index 20bfe7d7af704..f5a97eca21bdb 100644 --- a/src/test/ui/macros/macro-pat-pattern-followed-by-or-in-2021.rs +++ b/src/test/ui/macros/macro-pat-pattern-followed-by-or-in-2021.rs @@ -2,7 +2,7 @@ #![allow(unused_macros)] macro_rules! foo { ($x:pat | $y:pat) => {} } //~ ERROR `$x:pat` is followed by `|`, which is not allowed for `pat` fragments macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } //~ ERROR `$x:pat` is followed by `|`, which is not allowed for `pat` fragments -macro_rules! qux { ($x:pat) => {} } // should be ok +macro_rules! qux { ($x:pat, $y:pat) => {} } // should be ok macro_rules! match_any { ( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => { //~ ERROR `$pat:pat` may be followed by `|`, which is not allowed for `pat` fragments match $expr { diff --git a/src/test/ui/macros/macro-pat-pattern-followed-by-or.rs b/src/test/ui/macros/macro-pat-pattern-followed-by-or.rs index c2658cdbffce9..54bd13d7ebce8 100644 --- a/src/test/ui/macros/macro-pat-pattern-followed-by-or.rs +++ b/src/test/ui/macros/macro-pat-pattern-followed-by-or.rs @@ -2,7 +2,7 @@ #![allow(unused_macros)] macro_rules! foo { ($x:pat | $y:pat) => {} } // should be ok macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } // should be ok -macro_rules! qux { ($x:pat) => {} } // should be ok +macro_rules! qux { ($x:pat, $y:pat) => {} } // should be ok macro_rules! match_any { ( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => { // should be ok match $expr { From e6fd96df983bf0e7f6622ebe80db453e5202a31b Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Wed, 14 Apr 2021 08:24:06 -0700 Subject: [PATCH 07/10] Update books --- src/doc/embedded-book | 2 +- src/doc/nomicon | 2 +- src/doc/reference | 2 +- src/doc/rust-by-example | 2 +- src/doc/rustc-dev-guide | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/doc/embedded-book b/src/doc/embedded-book index d3f2ace94d516..569c3391f5c0c 160000 --- a/src/doc/embedded-book +++ b/src/doc/embedded-book @@ -1 +1 @@ -Subproject commit d3f2ace94d51610cf3e3c265705bb8416d37f8e4 +Subproject commit 569c3391f5c0cc43433bc77831d17f8ff4d76602 diff --git a/src/doc/nomicon b/src/doc/nomicon index 6fe476943afd5..8551afbb2ca6f 160000 --- a/src/doc/nomicon +++ b/src/doc/nomicon @@ -1 +1 @@ -Subproject commit 6fe476943afd53a9a6e91f38a6ea7bb48811d8ff +Subproject commit 8551afbb2ca6f5ea37fe58380318b209785e4e02 diff --git a/src/doc/reference b/src/doc/reference index fd97729e2d82f..e1abb17cd94cd 160000 --- a/src/doc/reference +++ b/src/doc/reference @@ -1 +1 @@ -Subproject commit fd97729e2d82f8b08d68a31c9bfdf0c37a7fd542 +Subproject commit e1abb17cd94cd5a8a374b48e1bc8134a2208ed48 diff --git a/src/doc/rust-by-example b/src/doc/rust-by-example index 29d91f591c90d..c80f0b09fc15b 160000 --- a/src/doc/rust-by-example +++ b/src/doc/rust-by-example @@ -1 +1 @@ -Subproject commit 29d91f591c90dd18fdca6d23f1a9caf9c139d0d7 +Subproject commit c80f0b09fc15b9251825343be910c08531938ab2 diff --git a/src/doc/rustc-dev-guide b/src/doc/rustc-dev-guide index 0687daac28939..a9bd2bbf31e4f 160000 --- a/src/doc/rustc-dev-guide +++ b/src/doc/rustc-dev-guide @@ -1 +1 @@ -Subproject commit 0687daac28939c476df51778f5a1d1aff1a3fddf +Subproject commit a9bd2bbf31e4f92b5d3d8e80b22839d0cc7a2022 From 26da4b43554482f5a25f79a3923f46bfe5cacd41 Mon Sep 17 00:00:00 2001 From: Edd Barrett Date: Wed, 14 Apr 2021 16:25:16 +0100 Subject: [PATCH 08/10] Fix typos in rustc_codegen_ssa/src/back/write.rs. --- compiler/rustc_codegen_ssa/src/back/write.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/back/write.rs b/compiler/rustc_codegen_ssa/src/back/write.rs index 04d06864ee14f..c8688faa80bc3 100644 --- a/compiler/rustc_codegen_ssa/src/back/write.rs +++ b/compiler/rustc_codegen_ssa/src/back/write.rs @@ -1094,7 +1094,7 @@ fn start_executing_work( // only place where we have access to the compiler `Session`. // - LLVM work can be done on any thread. // - Codegen can only happen on the main thread. - // - Each thread doing substantial work most be in possession of a `Token` + // - Each thread doing substantial work must be in possession of a `Token` // from the `Jobserver`. // - The compiler process always holds one `Token`. Any additional `Tokens` // have to be requested from the `Jobserver`. @@ -1146,7 +1146,7 @@ fn start_executing_work( // if possible. These two goals are at odds with each other: If memory // consumption were not an issue, we could just let the main thread produce // LLVM WorkItems at full speed, assuring maximal utilization of - // Tokens/LLVM worker threads. However, since codegen usual is faster + // Tokens/LLVM worker threads. However, since codegen is usually faster // than LLVM processing, the queue of LLVM WorkItems would fill up and each // WorkItem potentially holds on to a substantial amount of memory. // From a77cd45e97153a27a787c872f456c0917a4dae56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Wed, 14 Apr 2021 21:25:43 +0300 Subject: [PATCH 09/10] :arrow_up: rust-analyzer --- src/tools/rust-analyzer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/rust-analyzer b/src/tools/rust-analyzer index 19e09a4a54c75..7be06139b632e 160000 --- a/src/tools/rust-analyzer +++ b/src/tools/rust-analyzer @@ -1 +1 @@ -Subproject commit 19e09a4a54c75312aeaac04577f2d0e067463ab6 +Subproject commit 7be06139b632ee615fc18af04dd67947e2c794b2 From a19e1034d43b86b37a69182638f281c57f31f197 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Wed, 14 Apr 2021 16:39:58 -0400 Subject: [PATCH 10/10] rustdoc: Note that forbidding anchors in links to primitives is a bug --- src/librustdoc/passes/collect_intra_doc_links.rs | 4 ++++ src/test/rustdoc-ui/intra-doc/anchors.stderr | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs index 4bc7544e33d1e..2e54e8f8f79b4 100644 --- a/src/librustdoc/passes/collect_intra_doc_links.rs +++ b/src/librustdoc/passes/collect_intra_doc_links.rs @@ -1913,6 +1913,10 @@ fn anchor_failure(cx: &DocContext<'_>, diag_info: DiagnosticInfo<'_>, failure: A if let Some(sp) = sp { diag.span_label(sp, "contains invalid anchor"); } + if let AnchorFailure::RustdocAnchorConflict(Res::Primitive(_)) = failure { + diag.note("this restriction may be lifted in a future release"); + diag.note("see https://github.com/rust-lang/rust/issues/83083 for more information"); + } }); } diff --git a/src/test/rustdoc-ui/intra-doc/anchors.stderr b/src/test/rustdoc-ui/intra-doc/anchors.stderr index 787a68ed969ef..42a8832185ae6 100644 --- a/src/test/rustdoc-ui/intra-doc/anchors.stderr +++ b/src/test/rustdoc-ui/intra-doc/anchors.stderr @@ -9,6 +9,8 @@ note: the lint level is defined here | LL | #![deny(rustdoc::broken_intra_doc_links)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: this restriction may be lifted in a future release + = note: see https://github.com/rust-lang/rust/issues/83083 for more information error: `Foo::f#hola` contains an anchor, but links to fields are already anchored --> $DIR/anchors.rs:25:15 @@ -33,6 +35,9 @@ error: `u32#hello` contains an anchor, but links to builtin types are already an | LL | /// [u32#hello] | ^^^^^^^^^ contains invalid anchor + | + = note: this restriction may be lifted in a future release + = note: see https://github.com/rust-lang/rust/issues/83083 for more information error: aborting due to 5 previous errors