From 91d3ac74501be922f08887f825bab9e069bc6a3a Mon Sep 17 00:00:00 2001 From: bohan Date: Thu, 27 Jun 2024 21:37:36 +0800 Subject: [PATCH] add test for #126986 --- .../disambiguator-endswith-named-suffix.rs | 1 + ...disambiguator-endswith-named-suffix.stderr | 172 +++++++++--------- ...isambiguator-macro-endswith-exclamatory.rs | 11 ++ ...biguator-macro-endswith-exclamatory.stderr | 11 ++ 4 files changed, 109 insertions(+), 86 deletions(-) create mode 100644 tests/rustdoc-ui/disambiguator-macro-endswith-exclamatory.rs create mode 100644 tests/rustdoc-ui/disambiguator-macro-endswith-exclamatory.stderr diff --git a/tests/rustdoc-ui/disambiguator-endswith-named-suffix.rs b/tests/rustdoc-ui/disambiguator-endswith-named-suffix.rs index 3a59cc2247b..c3da1fdd7cc 100644 --- a/tests/rustdoc-ui/disambiguator-endswith-named-suffix.rs +++ b/tests/rustdoc-ui/disambiguator-endswith-named-suffix.rs @@ -1,4 +1,5 @@ //@ check-pass +//@ normalize-stderr-test: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL" //! [struct@m!()] //~ WARN: unmatched disambiguator `struct` and suffix `!()` //! [struct@m!{}] diff --git a/tests/rustdoc-ui/disambiguator-endswith-named-suffix.stderr b/tests/rustdoc-ui/disambiguator-endswith-named-suffix.stderr index 8d430152a83..f4e40a48873 100644 --- a/tests/rustdoc-ui/disambiguator-endswith-named-suffix.stderr +++ b/tests/rustdoc-ui/disambiguator-endswith-named-suffix.stderr @@ -1,134 +1,134 @@ warning: unmatched disambiguator `struct` and suffix `!()` - --> $DIR/disambiguator-endswith-named-suffix.rs:3:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:4:6 | LL | //! [struct@m!()] | ^^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default warning: unmatched disambiguator `struct` and suffix `()` - --> $DIR/disambiguator-endswith-named-suffix.rs:6:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:7:6 | LL | //! [struct@f()] | ^^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `struct` and suffix `!` - --> $DIR/disambiguator-endswith-named-suffix.rs:7:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:8:6 | LL | //! [struct@m!] | ^^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `enum` and suffix `!()` - --> $DIR/disambiguator-endswith-named-suffix.rs:9:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:10:6 | LL | //! [enum@m!()] | ^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `enum` and suffix `()` - --> $DIR/disambiguator-endswith-named-suffix.rs:12:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:13:6 | LL | //! [enum@f()] | ^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `enum` and suffix `!` - --> $DIR/disambiguator-endswith-named-suffix.rs:13:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:14:6 | LL | //! [enum@m!] | ^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `trait` and suffix `!()` - --> $DIR/disambiguator-endswith-named-suffix.rs:15:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:16:6 | LL | //! [trait@m!()] | ^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `trait` and suffix `()` - --> $DIR/disambiguator-endswith-named-suffix.rs:18:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:19:6 | LL | //! [trait@f()] | ^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `trait` and suffix `!` - --> $DIR/disambiguator-endswith-named-suffix.rs:19:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:20:6 | LL | //! [trait@m!] | ^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `module` and suffix `!()` - --> $DIR/disambiguator-endswith-named-suffix.rs:21:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:22:6 | LL | //! [module@m!()] | ^^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `module` and suffix `()` - --> $DIR/disambiguator-endswith-named-suffix.rs:24:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:25:6 | LL | //! [module@f()] | ^^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `module` and suffix `!` - --> $DIR/disambiguator-endswith-named-suffix.rs:25:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:26:6 | LL | //! [module@m!] | ^^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `mod` and suffix `!()` - --> $DIR/disambiguator-endswith-named-suffix.rs:27:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:28:6 | LL | //! [mod@m!()] | ^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `mod` and suffix `()` - --> $DIR/disambiguator-endswith-named-suffix.rs:30:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:31:6 | LL | //! [mod@f()] | ^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `mod` and suffix `!` - --> $DIR/disambiguator-endswith-named-suffix.rs:31:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:32:6 | LL | //! [mod@m!] | ^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `const` and suffix `!()` - --> $DIR/disambiguator-endswith-named-suffix.rs:33:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:34:6 | LL | //! [const@m!()] | ^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: incompatible link kind for `f` - --> $DIR/disambiguator-endswith-named-suffix.rs:36:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:37:6 | LL | //! [const@f()] | ^^^^^^^^^ this link resolved to a function, which is not a constant @@ -140,23 +140,23 @@ LL + //! [f()] | warning: unmatched disambiguator `const` and suffix `!` - --> $DIR/disambiguator-endswith-named-suffix.rs:37:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:38:6 | LL | //! [const@m!] | ^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `constant` and suffix `!()` - --> $DIR/disambiguator-endswith-named-suffix.rs:39:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:40:6 | LL | //! [constant@m!()] | ^^^^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: incompatible link kind for `f` - --> $DIR/disambiguator-endswith-named-suffix.rs:42:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:43:6 | LL | //! [constant@f()] | ^^^^^^^^^^^^ this link resolved to a function, which is not a constant @@ -168,23 +168,23 @@ LL + //! [f()] | warning: unmatched disambiguator `constant` and suffix `!` - --> $DIR/disambiguator-endswith-named-suffix.rs:43:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:44:6 | LL | //! [constant@m!] | ^^^^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `static` and suffix `!()` - --> $DIR/disambiguator-endswith-named-suffix.rs:45:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:46:6 | LL | //! [static@m!()] | ^^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: incompatible link kind for `f` - --> $DIR/disambiguator-endswith-named-suffix.rs:48:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:49:6 | LL | //! [static@f()] | ^^^^^^^^^^ this link resolved to a function, which is not a static @@ -196,63 +196,63 @@ LL + //! [f()] | warning: unmatched disambiguator `static` and suffix `!` - --> $DIR/disambiguator-endswith-named-suffix.rs:49:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:50:6 | LL | //! [static@m!] | ^^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `function` and suffix `!()` - --> $DIR/disambiguator-endswith-named-suffix.rs:51:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:52:6 | LL | //! [function@m!()] | ^^^^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `function` and suffix `!` - --> $DIR/disambiguator-endswith-named-suffix.rs:55:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:56:6 | LL | //! [function@m!] | ^^^^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `fn` and suffix `!()` - --> $DIR/disambiguator-endswith-named-suffix.rs:57:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:58:6 | LL | //! [fn@m!()] | ^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `fn` and suffix `!` - --> $DIR/disambiguator-endswith-named-suffix.rs:61:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:62:6 | LL | //! [fn@m!] | ^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `method` and suffix `!()` - --> $DIR/disambiguator-endswith-named-suffix.rs:63:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:64:6 | LL | //! [method@m!()] | ^^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `method` and suffix `!` - --> $DIR/disambiguator-endswith-named-suffix.rs:67:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:68:6 | LL | //! [method@m!] | ^^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: incompatible link kind for `m` - --> $DIR/disambiguator-endswith-named-suffix.rs:69:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:70:6 | LL | //! [derive@m!()] | ^^^^^^^^^^^ this link resolved to a macro, which is not a derive macro @@ -264,7 +264,7 @@ LL + //! [m!!()] | warning: incompatible link kind for `m` - --> $DIR/disambiguator-endswith-named-suffix.rs:70:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:71:6 | LL | //! [derive@m!{}] | ^^^^^^^^^^^ this link resolved to a macro, which is not a derive macro @@ -276,15 +276,15 @@ LL + //! [m!!{}] | warning: unmatched disambiguator `derive` and suffix `()` - --> $DIR/disambiguator-endswith-named-suffix.rs:72:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:73:6 | LL | //! [derive@f()] | ^^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: incompatible link kind for `m` - --> $DIR/disambiguator-endswith-named-suffix.rs:73:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:74:6 | LL | //! [derive@m!] | ^^^^^^^^^ this link resolved to a macro, which is not a derive macro @@ -296,100 +296,100 @@ LL + //! [m!!] | warning: unmatched disambiguator `type` and suffix `!()` - --> $DIR/disambiguator-endswith-named-suffix.rs:75:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:76:6 | LL | //! [type@m!()] | ^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `type` and suffix `()` - --> $DIR/disambiguator-endswith-named-suffix.rs:78:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:79:6 | LL | //! [type@f()] | ^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `type` and suffix `!` - --> $DIR/disambiguator-endswith-named-suffix.rs:79:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:80:6 | LL | //! [type@m!] | ^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `value` and suffix `!()` - --> $DIR/disambiguator-endswith-named-suffix.rs:81:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:82:6 | LL | //! [value@m!()] | ^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `value` and suffix `!` - --> $DIR/disambiguator-endswith-named-suffix.rs:85:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:86:6 | LL | //! [value@m!] | ^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `macro` and suffix `()` - --> $DIR/disambiguator-endswith-named-suffix.rs:90:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:91:6 | LL | //! [macro@f()] | ^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `prim` and suffix `!()` - --> $DIR/disambiguator-endswith-named-suffix.rs:93:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:94:6 | LL | //! [prim@m!()] | ^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `prim` and suffix `()` - --> $DIR/disambiguator-endswith-named-suffix.rs:96:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:97:6 | LL | //! [prim@f()] | ^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `prim` and suffix `!` - --> $DIR/disambiguator-endswith-named-suffix.rs:97:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:98:6 | LL | //! [prim@m!] | ^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `primitive` and suffix `!()` - --> $DIR/disambiguator-endswith-named-suffix.rs:99:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:100:6 | LL | //! [primitive@m!()] | ^^^^^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `primitive` and suffix `()` - --> $DIR/disambiguator-endswith-named-suffix.rs:102:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:103:6 | LL | //! [primitive@f()] | ^^^^^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: unmatched disambiguator `primitive` and suffix `!` - --> $DIR/disambiguator-endswith-named-suffix.rs:103:6 + --> $DIR/disambiguator-endswith-named-suffix.rs:104:6 | LL | //! [primitive@m!] | ^^^^^^^^^ | - = note: see https://doc.rust-lang.org/nightly/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators + = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/write-documentation/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators warning: 46 warnings emitted diff --git a/tests/rustdoc-ui/disambiguator-macro-endswith-exclamatory.rs b/tests/rustdoc-ui/disambiguator-macro-endswith-exclamatory.rs new file mode 100644 index 00000000000..b955090e894 --- /dev/null +++ b/tests/rustdoc-ui/disambiguator-macro-endswith-exclamatory.rs @@ -0,0 +1,11 @@ +//@ check-pass + +//! [macro@m!] //~ WARN: unresolved link to `m` + +//issue#126986 + +macro_rules! m { + () => {}; +} + +fn main() {} diff --git a/tests/rustdoc-ui/disambiguator-macro-endswith-exclamatory.stderr b/tests/rustdoc-ui/disambiguator-macro-endswith-exclamatory.stderr new file mode 100644 index 00000000000..2ada7f1a4be --- /dev/null +++ b/tests/rustdoc-ui/disambiguator-macro-endswith-exclamatory.stderr @@ -0,0 +1,11 @@ +warning: unresolved link to `m` + --> $DIR/disambiguator-macro-endswith-exclamatory.rs:3:6 + | +LL | //! [macro@m!] + | ^^^^^^^^ no item named `m` in scope + | + = note: `macro_rules` named `m` exists in this crate, but it is not in scope at this link's location + = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default + +warning: 1 warning emitted +