Improve tests

This commit is contained in:
Joshua Nelson 2020-08-06 18:33:29 -04:00
parent 0c99d806ea
commit ef54cde625
3 changed files with 22 additions and 19 deletions

View file

@ -2,10 +2,6 @@
//~^ NOTE lint level is defined //~^ NOTE lint level is defined
pub enum S {} pub enum S {}
impl S {
fn assoc_fn() {}
}
macro_rules! m { macro_rules! m {
() => {}; () => {};
} }
@ -69,6 +65,4 @@ trait T {}
//~^ ERROR incompatible link kind for `f` //~^ ERROR incompatible link kind for `f`
//~| NOTE this link resolved //~| NOTE this link resolved
//~| HELP use its disambiguator //~| HELP use its disambiguator
/// Link to [S::assoc_fn()]
pub fn f() {} pub fn f() {}

View file

@ -1,5 +1,5 @@
error: incompatible link kind for `S` error: incompatible link kind for `S`
--> $DIR/intra-links-disambiguator-mismatch.rs:18:14 --> $DIR/intra-links-disambiguator-mismatch.rs:14:14
| |
LL | /// Link to [struct@S] LL | /// Link to [struct@S]
| ^^^^^^^^ help: to link to the enum, use its disambiguator: `enum@S` | ^^^^^^^^ help: to link to the enum, use its disambiguator: `enum@S`
@ -12,7 +12,7 @@ LL | #![deny(broken_intra_doc_links)]
= note: this link resolved to an enum, which is not a struct = note: this link resolved to an enum, which is not a struct
error: incompatible link kind for `S` error: incompatible link kind for `S`
--> $DIR/intra-links-disambiguator-mismatch.rs:23:14 --> $DIR/intra-links-disambiguator-mismatch.rs:19:14
| |
LL | /// Link to [mod@S] LL | /// Link to [mod@S]
| ^^^^^ help: to link to the enum, use its disambiguator: `enum@S` | ^^^^^ help: to link to the enum, use its disambiguator: `enum@S`
@ -20,7 +20,7 @@ LL | /// Link to [mod@S]
= note: this link resolved to an enum, which is not a module = note: this link resolved to an enum, which is not a module
error: incompatible link kind for `S` error: incompatible link kind for `S`
--> $DIR/intra-links-disambiguator-mismatch.rs:28:14 --> $DIR/intra-links-disambiguator-mismatch.rs:24:14
| |
LL | /// Link to [union@S] LL | /// Link to [union@S]
| ^^^^^^^ help: to link to the enum, use its disambiguator: `enum@S` | ^^^^^^^ help: to link to the enum, use its disambiguator: `enum@S`
@ -28,7 +28,7 @@ LL | /// Link to [union@S]
= note: this link resolved to an enum, which is not a union = note: this link resolved to an enum, which is not a union
error: incompatible link kind for `S` error: incompatible link kind for `S`
--> $DIR/intra-links-disambiguator-mismatch.rs:33:14 --> $DIR/intra-links-disambiguator-mismatch.rs:29:14
| |
LL | /// Link to [trait@S] LL | /// Link to [trait@S]
| ^^^^^^^ help: to link to the enum, use its disambiguator: `enum@S` | ^^^^^^^ help: to link to the enum, use its disambiguator: `enum@S`
@ -36,7 +36,7 @@ LL | /// Link to [trait@S]
= note: this link resolved to an enum, which is not a trait = note: this link resolved to an enum, which is not a trait
error: incompatible link kind for `T` error: incompatible link kind for `T`
--> $DIR/intra-links-disambiguator-mismatch.rs:38:14 --> $DIR/intra-links-disambiguator-mismatch.rs:34:14
| |
LL | /// Link to [struct@T] LL | /// Link to [struct@T]
| ^^^^^^^^ help: to link to the trait, use its disambiguator: `trait@T` | ^^^^^^^^ help: to link to the trait, use its disambiguator: `trait@T`
@ -44,7 +44,7 @@ LL | /// Link to [struct@T]
= note: this link resolved to a trait, which is not a struct = note: this link resolved to a trait, which is not a struct
error: incompatible link kind for `m` error: incompatible link kind for `m`
--> $DIR/intra-links-disambiguator-mismatch.rs:43:14 --> $DIR/intra-links-disambiguator-mismatch.rs:39:14
| |
LL | /// Link to [derive@m] LL | /// Link to [derive@m]
| ^^^^^^^^ help: to link to the macro, use its disambiguator: `m!` | ^^^^^^^^ help: to link to the macro, use its disambiguator: `m!`
@ -52,7 +52,7 @@ LL | /// Link to [derive@m]
= note: this link resolved to a macro, which is not a derive macro = note: this link resolved to a macro, which is not a derive macro
error: incompatible link kind for `s` error: incompatible link kind for `s`
--> $DIR/intra-links-disambiguator-mismatch.rs:48:14 --> $DIR/intra-links-disambiguator-mismatch.rs:44:14
| |
LL | /// Link to [const@s] LL | /// Link to [const@s]
| ^^^^^^^ help: to link to the static, use its disambiguator: `static@s` | ^^^^^^^ help: to link to the static, use its disambiguator: `static@s`
@ -60,7 +60,7 @@ LL | /// Link to [const@s]
= note: this link resolved to a static, which is not a constant = note: this link resolved to a static, which is not a constant
error: incompatible link kind for `c` error: incompatible link kind for `c`
--> $DIR/intra-links-disambiguator-mismatch.rs:53:14 --> $DIR/intra-links-disambiguator-mismatch.rs:49:14
| |
LL | /// Link to [static@c] LL | /// Link to [static@c]
| ^^^^^^^^ help: to link to the constant, use its disambiguator: `const@c` | ^^^^^^^^ help: to link to the constant, use its disambiguator: `const@c`
@ -68,7 +68,7 @@ LL | /// Link to [static@c]
= note: this link resolved to a constant, which is not a static = note: this link resolved to a constant, which is not a static
error: incompatible link kind for `c` error: incompatible link kind for `c`
--> $DIR/intra-links-disambiguator-mismatch.rs:58:14 --> $DIR/intra-links-disambiguator-mismatch.rs:54:14
| |
LL | /// Link to [fn@c] LL | /// Link to [fn@c]
| ^^^^ help: to link to the constant, use its disambiguator: `const@c` | ^^^^ help: to link to the constant, use its disambiguator: `const@c`
@ -76,7 +76,7 @@ LL | /// Link to [fn@c]
= note: this link resolved to a constant, which is not a function = note: this link resolved to a constant, which is not a function
error: incompatible link kind for `c` error: incompatible link kind for `c`
--> $DIR/intra-links-disambiguator-mismatch.rs:63:14 --> $DIR/intra-links-disambiguator-mismatch.rs:59:14
| |
LL | /// Link to [c()] LL | /// Link to [c()]
| ^^^ help: to link to the constant, use its disambiguator: `const@c` | ^^^ help: to link to the constant, use its disambiguator: `const@c`
@ -84,7 +84,7 @@ LL | /// Link to [c()]
= note: this link resolved to a constant, which is not a function = note: this link resolved to a constant, which is not a function
error: incompatible link kind for `f` error: incompatible link kind for `f`
--> $DIR/intra-links-disambiguator-mismatch.rs:68:14 --> $DIR/intra-links-disambiguator-mismatch.rs:64:14
| |
LL | /// Link to [const@f] LL | /// Link to [const@f]
| ^^^^^^^ help: to link to the function, use its disambiguator: `f()` | ^^^^^^^ help: to link to the function, use its disambiguator: `f()`

View file

@ -1,3 +1,12 @@
#![deny(broken_intra_doc_links_)] // allow-tidy-line-length
#![deny(broken_intra_doc_links)]
/// Link to [S::assoc_fn()]
/// Link to [Default::default()] /// Link to [Default::default()]
pub fn f() {} // @has intra_link_trait_item/struct.S.html '//*[@href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default"]' 'Default::default()'
// @has - '//*[@href="../intra_link_trait_item/struct.S.html#method.assoc_fn"]' 'S::assoc_fn()'
pub struct S;
impl S {
pub fn assoc_fn() {}
}