Skip to content

Commit d6c3d16

Browse files
authored
Rollup merge of rust-lang#79527 - jyn514:intra-doc-tests, r=Manishearth
Move intra-doc link tests into a subdirectory They were starting to get unwieldy. r? `@Manishearth`
2 parents 89f36d4 + 872acb0 commit d6c3d16

File tree

94 files changed

+352
-387
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+352
-387
lines changed

src/bootstrap/test.rs

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -688,38 +688,6 @@ impl Step for RustdocJSNotStd {
688688
}
689689
}
690690

691-
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
692-
pub struct RustdocUi {
693-
pub target: TargetSelection,
694-
pub compiler: Compiler,
695-
}
696-
697-
impl Step for RustdocUi {
698-
type Output = ();
699-
const DEFAULT: bool = true;
700-
const ONLY_HOSTS: bool = true;
701-
702-
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
703-
run.path("src/test/rustdoc-ui")
704-
}
705-
706-
fn make_run(run: RunConfig<'_>) {
707-
let compiler = run.builder.compiler(run.builder.top_stage, run.build_triple());
708-
run.builder.ensure(RustdocUi { target: run.target, compiler });
709-
}
710-
711-
fn run(self, builder: &Builder<'_>) {
712-
builder.ensure(Compiletest {
713-
compiler: self.compiler,
714-
target: self.target,
715-
mode: "ui",
716-
suite: "rustdoc-ui",
717-
path: "src/test/rustdoc-ui",
718-
compare_mode: None,
719-
})
720-
}
721-
}
722-
723691
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
724692
pub struct Tidy;
725693

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

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

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

src/test/rustdoc-ui/.gitattributes

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
warning-crlf.rs eol=crlf

src/test/rustdoc-ui/intra-doc-alias-ice.stderr renamed to src/test/rustdoc-ui/intra-doc/alias-ice.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: unresolved link to `TypeAlias::hoge`
2-
--> $DIR/intra-doc-alias-ice.rs:5:30
2+
--> $DIR/alias-ice.rs:5:30
33
|
44
LL | /// [broken cross-reference](TypeAlias::hoge)
55
| ^^^^^^^^^^^^^^^ the type alias `TypeAlias` has no associated item named `hoge`
66
|
77
note: the lint level is defined here
8-
--> $DIR/intra-doc-alias-ice.rs:1:9
8+
--> $DIR/alias-ice.rs:1:9
99
|
1010
LL | #![deny(broken_intra_doc_links)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^

src/test/rustdoc-ui/intra-links-ambiguity.stderr renamed to src/test/rustdoc-ui/intra-doc/ambiguity.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: `true` is both a module and a builtin type
2-
--> $DIR/intra-links-ambiguity.rs:38:6
2+
--> $DIR/ambiguity.rs:38:6
33
|
44
LL | /// [true]
55
| ^^^^ ambiguous link
66
|
77
note: the lint level is defined here
8-
--> $DIR/intra-links-ambiguity.rs:1:9
8+
--> $DIR/ambiguity.rs:1:9
99
|
1010
LL | #![deny(broken_intra_doc_links)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -19,7 +19,7 @@ LL | /// [prim@true]
1919
| ^^^^^^^^^
2020

2121
error: `ambiguous` is both a struct and a function
22-
--> $DIR/intra-links-ambiguity.rs:27:6
22+
--> $DIR/ambiguity.rs:27:6
2323
|
2424
LL | /// [`ambiguous`] is ambiguous.
2525
| ^^^^^^^^^^^ ambiguous link
@@ -34,7 +34,7 @@ LL | /// [`ambiguous()`] is ambiguous.
3434
| ^^^^^^^^^^^^^
3535

3636
error: `ambiguous` is both a struct and a function
37-
--> $DIR/intra-links-ambiguity.rs:29:6
37+
--> $DIR/ambiguity.rs:29:6
3838
|
3939
LL | /// [ambiguous] is ambiguous.
4040
| ^^^^^^^^^ ambiguous link
@@ -49,7 +49,7 @@ LL | /// [ambiguous()] is ambiguous.
4949
| ^^^^^^^^^^^
5050

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

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

8585
error: `foo::bar` is both an enum and a function
86-
--> $DIR/intra-links-ambiguity.rs:35:42
86+
--> $DIR/ambiguity.rs:35:42
8787
|
8888
LL | /// Ambiguous non-implied shortcut link [`foo::bar`].
8989
| ^^^^^^^^^^ ambiguous link

src/test/rustdoc-ui/intra-links-anchors.stderr renamed to src/test/rustdoc-ui/intra-doc/anchors.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
error: `Foo::f#hola` contains an anchor, but links to fields are already anchored
2-
--> $DIR/intra-links-anchors.rs:25:15
2+
--> $DIR/anchors.rs:25:15
33
|
44
LL | /// Or maybe [Foo::f#hola].
55
| ^^^^^^^^^^^ contains invalid anchor
66
|
77
note: the lint level is defined here
8-
--> $DIR/intra-links-anchors.rs:1:9
8+
--> $DIR/anchors.rs:1:9
99
|
1010
LL | #![deny(broken_intra_doc_links)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^
1212

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

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

2525
error: `u32#hello` contains an anchor, but links to builtin types are already anchored
26-
--> $DIR/intra-links-anchors.rs:43:6
26+
--> $DIR/anchors.rs:43:6
2727
|
2828
LL | /// [u32#hello]
2929
| ^^^^^^^^^ contains invalid anchor

0 commit comments

Comments
 (0)