Skip to content

Commit

Permalink
Rollup merge of #79527 - jyn514:intra-doc-tests, r=Manishearth
Browse files Browse the repository at this point in the history
Move intra-doc link tests into a subdirectory

They were starting to get unwieldy.

r? `@Manishearth`
  • Loading branch information
Dylan-DPC authored Nov 30, 2020
2 parents 82630a6 + 872acb0 commit 0be0ff5
Show file tree
Hide file tree
Showing 94 changed files with 352 additions and 387 deletions.
33 changes: 1 addition & 32 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -688,38 +688,6 @@ impl Step for RustdocJSNotStd {
}
}

#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct RustdocUi {
pub target: TargetSelection,
pub compiler: Compiler,
}

impl Step for RustdocUi {
type Output = ();
const DEFAULT: bool = true;
const ONLY_HOSTS: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.path("src/test/rustdoc-ui")
}

fn make_run(run: RunConfig<'_>) {
let compiler = run.builder.compiler(run.builder.top_stage, run.build_triple());
run.builder.ensure(RustdocUi { target: run.target, compiler });
}

fn run(self, builder: &Builder<'_>) {
builder.ensure(Compiletest {
compiler: self.compiler,
target: self.target,
mode: "ui",
suite: "rustdoc-ui",
path: "src/test/rustdoc-ui",
compare_mode: None,
})
}
}

#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub struct Tidy;

Expand Down Expand Up @@ -934,6 +902,7 @@ default_test!(Debuginfo { path: "src/test/debuginfo", mode: "debuginfo", suite:
host_test!(UiFullDeps { path: "src/test/ui-fulldeps", mode: "ui", suite: "ui-fulldeps" });

host_test!(Rustdoc { path: "src/test/rustdoc", mode: "rustdoc", suite: "rustdoc" });
host_test!(RustdocUi { path: "src/test/rustdoc-ui", mode: "ui", suite: "rustdoc-ui" });

host_test!(Pretty { path: "src/test/pretty", mode: "pretty", suite: "pretty" });

Expand Down
1 change: 0 additions & 1 deletion src/test/rustdoc-ui/.gitattributes

This file was deleted.

1 change: 1 addition & 0 deletions src/test/rustdoc-ui/intra-doc/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
warning-crlf.rs eol=crlf
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error: unresolved link to `TypeAlias::hoge`
--> $DIR/intra-doc-alias-ice.rs:5:30
--> $DIR/alias-ice.rs:5:30
|
LL | /// [broken cross-reference](TypeAlias::hoge)
| ^^^^^^^^^^^^^^^ the type alias `TypeAlias` has no associated item named `hoge`
|
note: the lint level is defined here
--> $DIR/intra-doc-alias-ice.rs:1:9
--> $DIR/alias-ice.rs:1:9
|
LL | #![deny(broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error: `true` is both a module and a builtin type
--> $DIR/intra-links-ambiguity.rs:38:6
--> $DIR/ambiguity.rs:38:6
|
LL | /// [true]
| ^^^^ ambiguous link
|
note: the lint level is defined here
--> $DIR/intra-links-ambiguity.rs:1:9
--> $DIR/ambiguity.rs:1:9
|
LL | #![deny(broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -19,7 +19,7 @@ LL | /// [prim@true]
| ^^^^^^^^^

error: `ambiguous` is both a struct and a function
--> $DIR/intra-links-ambiguity.rs:27:6
--> $DIR/ambiguity.rs:27:6
|
LL | /// [`ambiguous`] is ambiguous.
| ^^^^^^^^^^^ ambiguous link
Expand All @@ -34,7 +34,7 @@ LL | /// [`ambiguous()`] is ambiguous.
| ^^^^^^^^^^^^^

error: `ambiguous` is both a struct and a function
--> $DIR/intra-links-ambiguity.rs:29:6
--> $DIR/ambiguity.rs:29:6
|
LL | /// [ambiguous] is ambiguous.
| ^^^^^^^^^ ambiguous link
Expand All @@ -49,7 +49,7 @@ LL | /// [ambiguous()] is ambiguous.
| ^^^^^^^^^^^

error: `multi_conflict` is a struct, a function, and a macro
--> $DIR/intra-links-ambiguity.rs:31:6
--> $DIR/ambiguity.rs:31:6
|
LL | /// [`multi_conflict`] is a three-way conflict.
| ^^^^^^^^^^^^^^^^ ambiguous link
Expand All @@ -68,7 +68,7 @@ LL | /// [`multi_conflict!`] is a three-way conflict.
| ^^^^^^^^^^^^^^^^^

error: `type_and_value` is both a module and a constant
--> $DIR/intra-links-ambiguity.rs:33:16
--> $DIR/ambiguity.rs:33:16
|
LL | /// Ambiguous [type_and_value].
| ^^^^^^^^^^^^^^ ambiguous link
Expand All @@ -83,7 +83,7 @@ LL | /// Ambiguous [const@type_and_value].
| ^^^^^^^^^^^^^^^^^^^^

error: `foo::bar` is both an enum and a function
--> $DIR/intra-links-ambiguity.rs:35:42
--> $DIR/ambiguity.rs:35:42
|
LL | /// Ambiguous non-implied shortcut link [`foo::bar`].
| ^^^^^^^^^^ ambiguous link
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
error: `Foo::f#hola` contains an anchor, but links to fields are already anchored
--> $DIR/intra-links-anchors.rs:25:15
--> $DIR/anchors.rs:25:15
|
LL | /// Or maybe [Foo::f#hola].
| ^^^^^^^^^^^ contains invalid anchor
|
note: the lint level is defined here
--> $DIR/intra-links-anchors.rs:1:9
--> $DIR/anchors.rs:1:9
|
LL | #![deny(broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^

error: `hello#people#!` contains multiple anchors
--> $DIR/intra-links-anchors.rs:31:28
--> $DIR/anchors.rs:31:28
|
LL | /// Another anchor error: [hello#people#!].
| ^^^^^^^^^^^^^^ contains invalid anchor

error: `Enum::A#whatever` contains an anchor, but links to variants are already anchored
--> $DIR/intra-links-anchors.rs:37:28
--> $DIR/anchors.rs:37:28
|
LL | /// Damn enum's variants: [Enum::A#whatever].
| ^^^^^^^^^^^^^^^^ contains invalid anchor

error: `u32#hello` contains an anchor, but links to builtin types are already anchored
--> $DIR/intra-links-anchors.rs:43:6
--> $DIR/anchors.rs:43:6
|
LL | /// [u32#hello]
| ^^^^^^^^^ contains invalid anchor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,90 +1,90 @@
error: incompatible link kind for `S`
--> $DIR/intra-links-disambiguator-mismatch.rs:14:14
--> $DIR/disambiguator-mismatch.rs:14:14
|
LL | /// Link to [struct@S]
| ^^^^^^^^ help: to link to the enum, prefix with `enum@`: `enum@S`
|
note: the lint level is defined here
--> $DIR/intra-links-disambiguator-mismatch.rs:1:9
--> $DIR/disambiguator-mismatch.rs:1:9
|
LL | #![deny(broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^
= note: this link resolved to an enum, which is not a struct

error: incompatible link kind for `S`
--> $DIR/intra-links-disambiguator-mismatch.rs:19:14
--> $DIR/disambiguator-mismatch.rs:19:14
|
LL | /// Link to [mod@S]
| ^^^^^ help: to link to the enum, prefix with `enum@`: `enum@S`
|
= note: this link resolved to an enum, which is not a module

error: incompatible link kind for `S`
--> $DIR/intra-links-disambiguator-mismatch.rs:24:14
--> $DIR/disambiguator-mismatch.rs:24:14
|
LL | /// Link to [union@S]
| ^^^^^^^ help: to link to the enum, prefix with `enum@`: `enum@S`
|
= note: this link resolved to an enum, which is not a union

error: incompatible link kind for `S`
--> $DIR/intra-links-disambiguator-mismatch.rs:29:14
--> $DIR/disambiguator-mismatch.rs:29:14
|
LL | /// Link to [trait@S]
| ^^^^^^^ help: to link to the enum, prefix with `enum@`: `enum@S`
|
= note: this link resolved to an enum, which is not a trait

error: incompatible link kind for `T`
--> $DIR/intra-links-disambiguator-mismatch.rs:34:14
--> $DIR/disambiguator-mismatch.rs:34:14
|
LL | /// Link to [struct@T]
| ^^^^^^^^ help: to link to the trait, prefix with `trait@`: `trait@T`
|
= note: this link resolved to a trait, which is not a struct

error: incompatible link kind for `m`
--> $DIR/intra-links-disambiguator-mismatch.rs:39:14
--> $DIR/disambiguator-mismatch.rs:39:14
|
LL | /// Link to [derive@m]
| ^^^^^^^^ help: to link to the macro, add an exclamation mark: `m!`
|
= note: this link resolved to a macro, which is not a derive macro

error: incompatible link kind for `s`
--> $DIR/intra-links-disambiguator-mismatch.rs:44:14
--> $DIR/disambiguator-mismatch.rs:44:14
|
LL | /// Link to [const@s]
| ^^^^^^^ help: to link to the static, prefix with `static@`: `static@s`
|
= note: this link resolved to a static, which is not a constant

error: incompatible link kind for `c`
--> $DIR/intra-links-disambiguator-mismatch.rs:49:14
--> $DIR/disambiguator-mismatch.rs:49:14
|
LL | /// Link to [static@c]
| ^^^^^^^^ help: to link to the constant, prefix with `const@`: `const@c`
|
= note: this link resolved to a constant, which is not a static

error: incompatible link kind for `c`
--> $DIR/intra-links-disambiguator-mismatch.rs:54:14
--> $DIR/disambiguator-mismatch.rs:54:14
|
LL | /// Link to [fn@c]
| ^^^^ help: to link to the constant, prefix with `const@`: `const@c`
|
= note: this link resolved to a constant, which is not a function

error: incompatible link kind for `c`
--> $DIR/intra-links-disambiguator-mismatch.rs:59:14
--> $DIR/disambiguator-mismatch.rs:59:14
|
LL | /// Link to [c()]
| ^^^ help: to link to the constant, prefix with `const@`: `const@c`
|
= note: this link resolved to a constant, which is not a function

error: incompatible link kind for `f`
--> $DIR/intra-links-disambiguator-mismatch.rs:64:14
--> $DIR/disambiguator-mismatch.rs:64:14
|
LL | /// Link to [const@f]
| ^^^^^^^ help: to link to the function, add parentheses: `f()`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: `with#anchor#error` contains multiple anchors
--> $DIR/intra-link-double-anchor.rs:5:18
--> $DIR/double-anchor.rs:5:18
|
LL | /// docs [label][with#anchor#error]
| ^^^^^^^^^^^^^^^^^ contains invalid anchor
Expand Down
File renamed without changes.
Loading

0 comments on commit 0be0ff5

Please sign in to comment.