Skip to content

Commit ade7ecf

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 54b0434 commit ade7ecf

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
@@ -1101,7 +1101,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
11011101
// ```
11021102
//
11031103
// Basically, we want `C::Baz` and `A::Foo` to show the same set of
1104-
// impls, which is easier if they both treat `/implementors/A/trait.Foo.js`
1104+
// impls, which is easier if they both treat `/trait.impl/A/trait.Foo.js`
11051105
// as the Single Source of Truth.
11061106
//
11071107
// We also want the `impl Baz for Quux` to be written to
@@ -1110,7 +1110,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
11101110
// because that'll load faster, and it's better for SEO. And we don't want
11111111
// the same impl to show up twice on the same page.
11121112
//
1113-
// To make this work, the implementors JS file has a structure kinda
1113+
// To make this work, the trait.impl/A/trait.Foo.js JS file has a structure kinda
11141114
// like this:
11151115
//
11161116
// ```js
@@ -1127,7 +1127,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
11271127
// So C's HTML will have something like this:
11281128
//
11291129
// ```html
1130-
// <script src="/implementors/A/trait.Foo.js"
1130+
// <script src="/trait.impl/A/trait.Foo.js"
11311131
// data-ignore-extern-crates="A,B" async></script>
11321132
// ```
11331133
//
@@ -1137,7 +1137,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
11371137
// [JSONP]: https://en.wikipedia.org/wiki/JSONP
11381138
let mut js_src_path: UrlPartsBuilder = std::iter::repeat("..")
11391139
.take(cx.current.len())
1140-
.chain(std::iter::once("implementors"))
1140+
.chain(std::iter::once("trait.impl"))
11411141
.collect();
11421142
if let Some(did) = it.item_id.as_def_id() &&
11431143
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
@@ -362,7 +362,7 @@ if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex};
362362
}
363363

364364
// Update the list of all implementors for traits
365-
let dst = cx.dst.join("implementors");
365+
let dst = cx.dst.join("trait.impl");
366366
let cache = cx.cache();
367367
for (&did, imps) in &cache.implementors {
368368
// 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

0 commit comments

Comments
 (0)