about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-04-21 19:28:16 +0000
committerbors <bors@rust-lang.org>2025-04-21 19:28:16 +0000
commitd6c1e454aa8af5e7e59fbf5c4e7d3128d2f99582 (patch)
treee12c3de53a1d961026e0de6bd56a3662aa88723e /src
parent8f2819b0e3428d0aee05fa60e91e0211c2aea053 (diff)
parent1cb9a0d450c935cda211bb970446d7e8cf504311 (diff)
Auto merge of #140127 - ChrisDenton:rollup-2kye32h, r=ChrisDenton
Rollup of 11 pull requests

Successful merges:

 - #134213 (Stabilize `naked_functions`)
 - #139711 (Hermit: Unify `std::env::args` with Unix)
 - #139795 (Clarify why SGX code specifies linkage/symbol names for certain statics)
 - #140036 (Advent of `tests/ui` (misc cleanups and improvements) [4/N])
 - #140047 (remove a couple clones)
 - #140052 (Fix error when an intra doc link is trying to resolve an empty associated item)
 - #140074 (rustdoc-json: Improve test for auto-trait impls)
 - #140076 (jsondocck: Require command is at start of line)
 - #140107 (rustc-dev-guide subtree update)
 - #140111 (cleanup redundant pattern instances)
 - #140118 ({B,C}Str: minor cleanup)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src')
-rw-r--r--src/doc/rustc-dev-guide/rust-version2
-rw-r--r--src/doc/rustc-dev-guide/src/tests/ui.md13
-rw-r--r--src/doc/unstable-book/src/compiler-flags/sanitizer.md2
-rw-r--r--src/librustdoc/passes/collect_intra_doc_links.rs7
-rw-r--r--src/tools/jsondocck/src/main.rs1
5 files changed, 15 insertions, 10 deletions
diff --git a/src/doc/rustc-dev-guide/rust-version b/src/doc/rustc-dev-guide/rust-version
index 67de4a98165..dc52e0928cc 100644
--- a/src/doc/rustc-dev-guide/rust-version
+++ b/src/doc/rustc-dev-guide/rust-version
@@ -1 +1 @@
-a7c39b68616668a45f0afd62849a1da7c8ad2516
+b8005bff3248cfc6e327faf4fa631ac49bb49ba9
diff --git a/src/doc/rustc-dev-guide/src/tests/ui.md b/src/doc/rustc-dev-guide/src/tests/ui.md
index 7c4e2a0fdae..6232c8bcc0a 100644
--- a/src/doc/rustc-dev-guide/src/tests/ui.md
+++ b/src/doc/rustc-dev-guide/src/tests/ui.md
@@ -303,7 +303,7 @@ It should be preferred to using `error-pattern`, which is imprecise and non-exha
 ### `error-pattern`
 
 The `error-pattern` [directive](directives.md) can be used for runtime messages, which don't
-have a specific span, or in exceptional cases for compile time messages.
+have a specific span, or in exceptional cases, for compile time messages.
 
 Let's think about this test:
 
@@ -316,7 +316,7 @@ fn main() {
 }
 ```
 
-We want to ensure this shows "index out of bounds" but we cannot use the `ERROR`
+We want to ensure this shows "index out of bounds", but we cannot use the `ERROR`
 annotation since the runtime error doesn't have any span. Then it's time to use the
 `error-pattern` directive:
 
@@ -333,18 +333,19 @@ fn main() {
 Use of `error-pattern` is not recommended in general.
 
 For strict testing of compile time output, try to use the line annotations `//~` as much as
-possible, including `//~?` annotations for diagnostics without span.
+possible, including `//~?` annotations for diagnostics without spans.
 
 If the compile time output is target dependent or too verbose, use directive
 `//@ dont-require-annotations: <diagnostic-kind>` to make the line annotation checking
-non-exhaustive, some of the compiler messages can stay uncovered by annotations in this mode.
+non-exhaustive.
+Some of the compiler messages can stay uncovered by annotations in this mode.
 
-For checking runtime output `//@ check-run-results` may be preferable.
+For checking runtime output, `//@ check-run-results` may be preferable.
 
 Only use `error-pattern` if none of the above works.
 
 Line annotations `//~` are still checked in tests using `error-pattern`.
-In exceptional cases use `//@ compile-flags: --error-format=human` to opt out of these checks.
+In exceptional cases, use `//@ compile-flags: --error-format=human` to opt out of these checks.
 
 ### Diagnostic kinds (error levels)
 
diff --git a/src/doc/unstable-book/src/compiler-flags/sanitizer.md b/src/doc/unstable-book/src/compiler-flags/sanitizer.md
index f2e1bb80cb2..2f9d4d22e5a 100644
--- a/src/doc/unstable-book/src/compiler-flags/sanitizer.md
+++ b/src/doc/unstable-book/src/compiler-flags/sanitizer.md
@@ -245,8 +245,6 @@ See the [Clang ControlFlowIntegrity documentation][clang-cfi] for more details.
 ## Example 1: Redirecting control flow using an indirect branch/call to an invalid destination
 
 ```rust,ignore (making doc tests pass cross-platform is hard)
-#![feature(naked_functions)]
-
 use std::arch::naked_asm;
 use std::mem;
 
diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs
index 297597b3dea..36f5889dcf4 100644
--- a/src/librustdoc/passes/collect_intra_doc_links.rs
+++ b/src/librustdoc/passes/collect_intra_doc_links.rs
@@ -59,7 +59,12 @@ fn filter_assoc_items_by_name_and_namespace(
     ident: Ident,
     ns: Namespace,
 ) -> impl Iterator<Item = &ty::AssocItem> {
-    tcx.associated_items(assoc_items_of).filter_by_name_unhygienic(ident.name).filter(move |item| {
+    let iter: Box<dyn Iterator<Item = &ty::AssocItem>> = if !ident.name.is_empty() {
+        Box::new(tcx.associated_items(assoc_items_of).filter_by_name_unhygienic(ident.name))
+    } else {
+        Box::new([].iter())
+    };
+    iter.filter(move |item| {
         item.namespace() == ns && tcx.hygienic_eq(ident, item.ident(tcx), assoc_items_of)
     })
 }
diff --git a/src/tools/jsondocck/src/main.rs b/src/tools/jsondocck/src/main.rs
index 79e419884c6..65ad38da98b 100644
--- a/src/tools/jsondocck/src/main.rs
+++ b/src/tools/jsondocck/src/main.rs
@@ -154,6 +154,7 @@ impl CommandKind {
 static LINE_PATTERN: LazyLock<Regex> = LazyLock::new(|| {
     RegexBuilder::new(
         r#"
+        ^\s*
         //@\s+
         (?P<negated>!?)
         (?P<cmd>[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)