Skip to content

Commit f45e695

Browse files
authored
Rollup merge of #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 99e075f + 872acb0 commit f45e695

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

+1-32
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

-1
This file was deleted.
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

+2-2
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

+7-7
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

+5-5
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

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

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,90 @@
11
error: incompatible link kind for `S`
2-
--> $DIR/intra-links-disambiguator-mismatch.rs:14:14
2+
--> $DIR/disambiguator-mismatch.rs:14:14
33
|
44
LL | /// Link to [struct@S]
55
| ^^^^^^^^ help: to link to the enum, prefix with `enum@`: `enum@S`
66
|
77
note: the lint level is defined here
8-
--> $DIR/intra-links-disambiguator-mismatch.rs:1:9
8+
--> $DIR/disambiguator-mismatch.rs:1:9
99
|
1010
LL | #![deny(broken_intra_doc_links)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^
1212
= note: this link resolved to an enum, which is not a struct
1313

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

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

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

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

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

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

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

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

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

8686
error: incompatible link kind for `f`
87-
--> $DIR/intra-links-disambiguator-mismatch.rs:64:14
87+
--> $DIR/disambiguator-mismatch.rs:64:14
8888
|
8989
LL | /// Link to [const@f]
9090
| ^^^^^^^ help: to link to the function, add parentheses: `f()`

src/test/rustdoc-ui/intra-link-double-anchor.stderr renamed to src/test/rustdoc-ui/intra-doc/double-anchor.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: `with#anchor#error` contains multiple anchors
2-
--> $DIR/intra-link-double-anchor.rs:5:18
2+
--> $DIR/double-anchor.rs:5:18
33
|
44
LL | /// docs [label][with#anchor#error]
55
| ^^^^^^^^^^^^^^^^^ contains invalid anchor

0 commit comments

Comments
 (0)