Skip to content

Commit 2a291ce

Browse files
committed
rustdoc: rename /implementors to /impl.trait
This is shorter, avoids potential conflicts with a crate named `implementors`[^1], and will be less confusing when JS include files are added for type aliases. [^1]: AFAIK, this couldn't actually cause any problems right now, but it's simpler just to make it impossible than relying on never having a file named `trait.Foo.js` in the crate data area.
1 parent cf9fd95 commit 2a291ce

12 files changed

+19
-19
lines changed

src/librustdoc/html/render/print_item.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
10991099
// ```
11001100
//
11011101
// Basically, we want `C::Baz` and `A::Foo` to show the same set of
1102-
// impls, which is easier if they both treat `/implementors/A/trait.Foo.js`
1102+
// impls, which is easier if they both treat `/trait.impl/A/trait.Foo.js`
11031103
// as the Single Source of Truth.
11041104
//
11051105
// We also want the `impl Baz for Quux` to be written to
@@ -1108,7 +1108,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
11081108
// because that'll load faster, and it's better for SEO. And we don't want
11091109
// the same impl to show up twice on the same page.
11101110
//
1111-
// To make this work, the implementors JS file has a structure kinda
1111+
// To make this work, the trait.impl/A/trait.Foo.js JS file has a structure kinda
11121112
// like this:
11131113
//
11141114
// ```js
@@ -1125,7 +1125,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
11251125
// So C's HTML will have something like this:
11261126
//
11271127
// ```html
1128-
// <script src="/implementors/A/trait.Foo.js"
1128+
// <script src="/trait.impl/A/trait.Foo.js"
11291129
// data-ignore-extern-crates="A,B" async></script>
11301130
// ```
11311131
//
@@ -1135,7 +1135,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
11351135
// [JSONP]: https://en.wikipedia.org/wiki/JSONP
11361136
let mut js_src_path: UrlPartsBuilder = std::iter::repeat("..")
11371137
.take(cx.current.len())
1138-
.chain(std::iter::once("implementors"))
1138+
.chain(std::iter::once("trait.impl"))
11391139
.collect();
11401140
if let Some(did) = it.item_id.as_def_id() &&
11411141
let get_extern = { || cache.external_paths.get(&did).map(|s| &s.0) } &&

src/librustdoc/html/render/write_shared.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex};
361361
}
362362

363363
// Update the list of all implementors for traits
364-
let dst = cx.dst.join("implementors");
364+
let dst = cx.dst.join("trait.impl");
365365
let cache = cx.cache();
366366
for (&did, imps) in &cache.implementors {
367367
// Private modules can leak through to this phase of rustdoc, which

tests/rustdoc-gui/code-tags.goml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This test ensures that items and documentation code blocks are wrapped in <pre><code>
22

3-
// We need to disable this check because `implementors/test_docs/trait.AnotherOne.js`
3+
// We need to disable this check because `trait.impl/test_docs/trait.AnotherOne.js`
44
// doesn't exist.
55
fail-on-request-error: false
66
go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"

tests/rustdoc-gui/item-decl-colors.goml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This test ensures that the color of the items in the type decl are working as expected.
22

3-
// We need to disable this check because `implementors/test_docs/trait.TraitWithoutGenerics.js`
3+
// We need to disable this check because `trait.impl/test_docs/trait.TraitWithoutGenerics.js`
44
// doesn't exist.
55
fail-on-request-error: false
66

tests/rustdoc-gui/no-docblock.goml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This test checks that there are margins applied to methods with no docblocks.
22

3-
// We need to disable this check because `implementors/test_docs/trait.TraitWithNoDocblock.js`
3+
// We need to disable this check because `trait.impl/test_docs/trait.TraitWithNoDocblock.js`
44
// doesn't exist.
55
fail-on-request-error: false
66

tests/rustdoc-gui/setting-auto-hide-content-large-items.goml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This test ensures that the "Auto-hide item contents for large items" setting is working as
22
// expected.
33

4-
// We need to disable this check because `implementors/test_docs/trait.Iterator.js` doesn't exist.
4+
// We need to disable this check because `trait.impl/test_docs/trait.Iterator.js` doesn't exist.
55
fail-on-request-error: false
66

77
define-function: (

tests/rustdoc-gui/trait-sidebar-item-order.goml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Checks that the elements in the sidebar are alphabetically sorted.
22

3-
// We need to disable this check because `implementors/test_docs/trait.AnotherOne.js`
3+
// We need to disable this check because `trait.impl/test_docs/trait.AnotherOne.js`
44
// doesn't exist.
55
fail-on-request-error: false
66

tests/rustdoc-gui/type-declation-overflow.goml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// This test ensures that the items declaration content overflow is handled inside the <pre> directly.
33

44
// We need to disable this check because
5-
// `implementors/test_docs/trait.ALongNameBecauseItHelpsTestingTheCurrentProblem.js`
5+
// `trait.impl/test_docs/trait.ALongNameBecauseItHelpsTestingTheCurrentProblem.js`
66
// doesn't exist.
77
fail-on-request-error: false
88

tests/rustdoc/hidden-impls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ pub mod __hidden {
1212

1313
// @has foo/trait.Clone.html
1414
// @!hasraw - 'Foo'
15-
// @has implementors/core/clone/trait.Clone.js
15+
// @has trait.impl/core/clone/trait.Clone.js
1616
// @!hasraw - 'Foo'
1717
pub use std::clone::Clone;

tests/rustdoc/impl-parts-crosscrate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub struct Bar<T> { t: T }
1212
// full impl string. Instead, just make sure something from each part
1313
// is mentioned.
1414

15-
// @hasraw implementors/rustdoc_impl_parts_crosscrate/trait.AnAutoTrait.js Bar
15+
// @hasraw trait.impl/rustdoc_impl_parts_crosscrate/trait.AnAutoTrait.js Bar
1616
// @hasraw - Send
1717
// @hasraw - !AnAutoTrait
1818
// @hasraw - Copy

tests/rustdoc/inline_cross/implementors-js.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
extern crate implementors_inline;
66

7-
// @!has implementors/implementors_js/trait.MyTrait.js
8-
// @has implementors/implementors_inline/my_trait/trait.MyTrait.js
9-
// @!has implementors/implementors_inline/prelude/trait.MyTrait.js
7+
// @!has trait.impl/implementors_js/trait.MyTrait.js
8+
// @has trait.impl/implementors_inline/my_trait/trait.MyTrait.js
9+
// @!has trait.impl/implementors_inline/prelude/trait.MyTrait.js
1010
// @has implementors_inline/my_trait/trait.MyTrait.html
11-
// @has - '//script/@src' '../../implementors/implementors_inline/my_trait/trait.MyTrait.js'
11+
// @has - '//script/@src' '../../trait.impl/implementors_inline/my_trait/trait.MyTrait.js'
1212
// @has implementors_js/trait.MyTrait.html
13-
// @has - '//script/@src' '../implementors/implementors_inline/my_trait/trait.MyTrait.js'
13+
// @has - '//script/@src' '../trait.impl/implementors_inline/my_trait/trait.MyTrait.js'
1414
/// When re-exporting this trait, the HTML will be inlined,
1515
/// but, vitally, the JavaScript will be located only at the
1616
/// one canonical path.

tests/rustdoc/issue-43701.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
pub use std::vec::Vec;
44

5-
// @!has implementors/core/clone/trait.Clone.js
5+
// @!has trait.impl/core/clone/trait.Clone.js

0 commit comments

Comments
 (0)