about summary refs log tree commit diff
path: root/src/test/rustdoc-ui
diff options
context:
space:
mode:
authorJoshua Nelson <jyn514@gmail.com>2020-08-04 23:31:36 -0400
committerJoshua Nelson <jyn514@gmail.com>2020-08-05 00:20:34 -0400
commit444f5a0556fc5779663e69ff1a3d5a7362ba9618 (patch)
tree055b0151ef2177d38773b950134c863504967fd2 /src/test/rustdoc-ui
parent99354f552df332c669d6e621e68dda403ea135fd (diff)
downloadrust-444f5a0556fc5779663e69ff1a3d5a7362ba9618.tar.gz
rust-444f5a0556fc5779663e69ff1a3d5a7362ba9618.zip
Give a much better error message if the struct failed to resolve
Diffstat (limited to 'src/test/rustdoc-ui')
-rw-r--r--src/test/rustdoc-ui/intra-links-disambiguator-mismatch.rs30
-rw-r--r--src/test/rustdoc-ui/intra-links-disambiguator-mismatch.stderr98
2 files changed, 49 insertions, 79 deletions
diff --git a/src/test/rustdoc-ui/intra-links-disambiguator-mismatch.rs b/src/test/rustdoc-ui/intra-links-disambiguator-mismatch.rs
index 6ab815eab54..9bf77a53fb5 100644
--- a/src/test/rustdoc-ui/intra-links-disambiguator-mismatch.rs
+++ b/src/test/rustdoc-ui/intra-links-disambiguator-mismatch.rs
@@ -13,41 +13,51 @@ trait T {}
 
 /// Link to [struct@S]
 //~^ ERROR unresolved link to `S`
-//~| NOTE did not match
+//~| NOTE this link resolved
+//~| HELP use its disambiguator
 
 /// Link to [mod@S]
 //~^ ERROR unresolved link to `S`
-//~| NOTE did not match
+//~| NOTE this link resolved
+//~| HELP use its disambiguator
 
 /// Link to [union@S]
 //~^ ERROR unresolved link to `S`
-//~| NOTE did not match
+//~| NOTE this link resolved
+//~| HELP use its disambiguator
 
 /// Link to [trait@S]
 //~^ ERROR unresolved link to `S`
-//~| NOTE did not match
+//~| NOTE this link resolved
+//~| HELP use its disambiguator
 
 /// Link to [struct@T]
 //~^ ERROR unresolved link to `T`
-//~| NOTE did not match
+//~| NOTE this link resolved
+//~| HELP use its disambiguator
 
 /// Link to [derive@m]
 //~^ ERROR unresolved link to `m`
-//~| NOTE did not match
+//~| NOTE this link resolved
+//~| HELP use its disambiguator
 
 /// Link to [const@s]
 //~^ ERROR unresolved link to `s`
-//~| NOTE did not match
+//~| NOTE this link resolved
+//~| HELP use its disambiguator
 
 /// Link to [static@c]
 //~^ ERROR unresolved link to `c`
-//~| NOTE did not match
+//~| NOTE this link resolved
+//~| HELP use its disambiguator
 
 /// Link to [fn@c]
 //~^ ERROR unresolved link to `c`
-//~| NOTE did not match
+//~| NOTE this link resolved
+//~| HELP use its disambiguator
 
 /// Link to [c()]
 //~^ ERROR unresolved link to `c`
-//~| NOTE did not match
+//~| NOTE this link resolved
+//~| HELP use its disambiguator
 pub fn f() {}
diff --git a/src/test/rustdoc-ui/intra-links-disambiguator-mismatch.stderr b/src/test/rustdoc-ui/intra-links-disambiguator-mismatch.stderr
index c40c720f879..d0a3ebf2c6a 100644
--- a/src/test/rustdoc-ui/intra-links-disambiguator-mismatch.stderr
+++ b/src/test/rustdoc-ui/intra-links-disambiguator-mismatch.stderr
@@ -2,126 +2,86 @@ error: unresolved link to `S`
   --> $DIR/intra-links-disambiguator-mismatch.rs:14:14
    |
 LL | /// Link to [struct@S]
-   |              ^^^^^^^^
+   |              ^^^^^^^^ help: to link to the enum, use its disambiguator: `enum@S`
    |
 note: the lint level is defined here
   --> $DIR/intra-links-disambiguator-mismatch.rs:1:9
    |
 LL | #![deny(broken_intra_doc_links)]
    |         ^^^^^^^^^^^^^^^^^^^^^^
-note: this link resolved to an enum, which did not match the disambiguator 'struct'
-  --> $DIR/intra-links-disambiguator-mismatch.rs:14:14
-   |
-LL | /// Link to [struct@S]
-   |              ^^^^^^^^
+   = note: this link resolved to an enum, which is not a struct
 
 error: unresolved link to `S`
-  --> $DIR/intra-links-disambiguator-mismatch.rs:18:14
+  --> $DIR/intra-links-disambiguator-mismatch.rs:19:14
    |
 LL | /// Link to [mod@S]
-   |              ^^^^^
+   |              ^^^^^ help: to link to the enum, use its disambiguator: `enum@S`
    |
-note: this link resolved to an enum, which did not match the disambiguator 'mod'
-  --> $DIR/intra-links-disambiguator-mismatch.rs:18:14
-   |
-LL | /// Link to [mod@S]
-   |              ^^^^^
+   = note: this link resolved to an enum, which is not a module
 
 error: unresolved link to `S`
-  --> $DIR/intra-links-disambiguator-mismatch.rs:22:14
+  --> $DIR/intra-links-disambiguator-mismatch.rs:24:14
    |
 LL | /// Link to [union@S]
-   |              ^^^^^^^
-   |
-note: this link resolved to an enum, which did not match the disambiguator 'union'
-  --> $DIR/intra-links-disambiguator-mismatch.rs:22:14
+   |              ^^^^^^^ help: to link to the enum, use its disambiguator: `enum@S`
    |
-LL | /// Link to [union@S]
-   |              ^^^^^^^
+   = note: this link resolved to an enum, which is not a union
 
 error: unresolved link to `S`
-  --> $DIR/intra-links-disambiguator-mismatch.rs:26:14
+  --> $DIR/intra-links-disambiguator-mismatch.rs:29:14
    |
 LL | /// Link to [trait@S]
-   |              ^^^^^^^
-   |
-note: this link resolved to an enum, which did not match the disambiguator 'trait'
-  --> $DIR/intra-links-disambiguator-mismatch.rs:26:14
+   |              ^^^^^^^ help: to link to the enum, use its disambiguator: `enum@S`
    |
-LL | /// Link to [trait@S]
-   |              ^^^^^^^
+   = note: this link resolved to an enum, which is not a trait
 
 error: unresolved link to `T`
-  --> $DIR/intra-links-disambiguator-mismatch.rs:30:14
+  --> $DIR/intra-links-disambiguator-mismatch.rs:34:14
    |
 LL | /// Link to [struct@T]
-   |              ^^^^^^^^
-   |
-note: this link resolved to a trait, which did not match the disambiguator 'struct'
-  --> $DIR/intra-links-disambiguator-mismatch.rs:30:14
+   |              ^^^^^^^^ help: to link to the trait, use its disambiguator: `trait@T`
    |
-LL | /// Link to [struct@T]
-   |              ^^^^^^^^
+   = note: this link resolved to a trait, which is not a struct
 
 error: unresolved link to `m`
-  --> $DIR/intra-links-disambiguator-mismatch.rs:34:14
+  --> $DIR/intra-links-disambiguator-mismatch.rs:39:14
    |
 LL | /// Link to [derive@m]
-   |              ^^^^^^^^
-   |
-note: this link resolved to a macro, which did not match the disambiguator 'derive'
-  --> $DIR/intra-links-disambiguator-mismatch.rs:34:14
+   |              ^^^^^^^^ help: to link to the macro, use its disambiguator: `m!`
    |
-LL | /// Link to [derive@m]
-   |              ^^^^^^^^
+   = note: this link resolved to a macro, which is not a derive macro
 
 error: unresolved link to `s`
-  --> $DIR/intra-links-disambiguator-mismatch.rs:38:14
+  --> $DIR/intra-links-disambiguator-mismatch.rs:44:14
    |
 LL | /// Link to [const@s]
-   |              ^^^^^^^
-   |
-note: this link resolved to a static, which did not match the disambiguator 'const'
-  --> $DIR/intra-links-disambiguator-mismatch.rs:38:14
+   |              ^^^^^^^ help: to link to the static, use its disambiguator: `static@s`
    |
-LL | /// Link to [const@s]
-   |              ^^^^^^^
+   = note: this link resolved to a static, which is not a constant
 
 error: unresolved link to `c`
-  --> $DIR/intra-links-disambiguator-mismatch.rs:42:14
+  --> $DIR/intra-links-disambiguator-mismatch.rs:49:14
    |
 LL | /// Link to [static@c]
-   |              ^^^^^^^^
+   |              ^^^^^^^^ help: to link to the constant, use its disambiguator: `const@c`
    |
-note: this link resolved to a constant, which did not match the disambiguator 'static'
-  --> $DIR/intra-links-disambiguator-mismatch.rs:42:14
-   |
-LL | /// Link to [static@c]
-   |              ^^^^^^^^
+   = note: this link resolved to a constant, which is not a static
 
 error: unresolved link to `c`
-  --> $DIR/intra-links-disambiguator-mismatch.rs:46:14
+  --> $DIR/intra-links-disambiguator-mismatch.rs:54:14
    |
 LL | /// Link to [fn@c]
-   |              ^^^^
-   |
-note: this link resolved to a constant, which did not match the disambiguator 'fn'
-  --> $DIR/intra-links-disambiguator-mismatch.rs:46:14
+   |              ^^^^ help: to link to the constant, use its disambiguator: `const@c`
    |
-LL | /// Link to [fn@c]
-   |              ^^^^
+   = note: this link resolved to a constant, which is not a function
 
 error: unresolved link to `c`
-  --> $DIR/intra-links-disambiguator-mismatch.rs:50:14
+  --> $DIR/intra-links-disambiguator-mismatch.rs:59:14
    |
 LL | /// Link to [c()]
-   |              ^^^
-   |
-note: this link resolved to a constant, which did not match the disambiguator 'fn'
-  --> $DIR/intra-links-disambiguator-mismatch.rs:50:14
+   |              ^^^ help: to link to the constant, use its disambiguator: `const@c`
    |
-LL | /// Link to [c()]
-   |              ^^^
+   = note: this link resolved to a constant, which is not a function
 
 error: aborting due to 10 previous errors