Skip to content

Commit ea9e442

Browse files
committed
rustdoc: Rename "Type Definition" to "Type Alias"
This matches the name used by the Rust Reference [1], which is also what people usually call these items. [1]: https://doc.rust-lang.org/reference/items/type-aliases.html
1 parent 6ef7d16 commit ea9e442

File tree

7 files changed

+10
-11
lines changed

7 files changed

+10
-11
lines changed

src/librustdoc/html/render/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2123,7 +2123,7 @@ impl ItemSection {
21232123
Self::Unions => "Unions",
21242124
Self::Enums => "Enums",
21252125
Self::Functions => "Functions",
2126-
Self::TypeDefinitions => "Type Definitions",
2126+
Self::TypeDefinitions => "Type Aliases",
21272127
Self::Statics => "Statics",
21282128
Self::Constants => "Constants",
21292129
Self::Traits => "Traits",

src/librustdoc/html/render/print_item.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ pub(super) fn print_item(
198198
clean::StructItem(..) => "Struct ",
199199
clean::UnionItem(..) => "Union ",
200200
clean::EnumItem(..) => "Enum ",
201-
clean::TypedefItem(..) => "Type Definition ",
201+
clean::TypedefItem(..) => "Type Alias ",
202202
clean::MacroItem(..) => "Macro ",
203203
clean::ProcMacroItem(ref mac) => match mac.kind {
204204
MacroKind::Bang => "Macro ",

src/librustdoc/html/static/js/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ function preLoadCss(cssUrl) {
499499
block("static", "static", "Statics");
500500
block("trait", "traits", "Traits");
501501
block("fn", "functions", "Functions");
502-
block("type", "types", "Type Definitions");
502+
block("type", "types", "Type Aliases");
503503
block("foreigntype", "foreign-types", "Foreign Types");
504504
block("keyword", "keywords", "Keywords");
505505
block("traitalias", "trait-aliases", "Trait Aliases");

tests/rustdoc/issue-105735-overlapping-reexport-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// @has - '//*[@class="item-name"]/a[@class="constant"]' 'AtomicU8'
99
// We also ensure we don't have another item displayed.
1010
// @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 2
11-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Type Definitions'
11+
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Type Aliases'
1212
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Constants'
1313

1414
mod other {

tests/rustdoc/issue-109449-doc-hidden-reexports.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub mod glob_reexport {
104104
// @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 3
105105
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Re-exports'
106106
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Structs'
107-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Type Definitions'
107+
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Type Aliases'
108108

109109
// Now we check we have 1 re-export and 2 inlined items.
110110
// If not item from a glob re-export is visible, we don't show the re-export.
@@ -135,9 +135,9 @@ pub mod doc_hidden_reexport {
135135
// @has - '//a[@class="struct"]' 'Reexport'
136136
// Check that the `#[doc(hidden)]` re-export's attributes are not taken into account.
137137
// @has - '//*[@class="desc docblock-short"]' 'Visible. Original.'
138+
/// Visible.
139+
pub use self::Bar3 as Reexport;
138140
/// Hidden.
139141
#[doc(hidden)]
140142
pub use crate::private::Bar3;
141-
/// Visible.
142-
pub use self::Bar3 as Reexport;
143143
}

tests/rustdoc/sidebar-all-page.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![crate_name = "foo"]
2-
32
#![feature(rustc_attrs)]
43

54
// @has 'foo/all.html'
@@ -9,7 +8,7 @@
98
// @has - '//*[@class="sidebar-elems"]//li' 'Functions'
109
// @has - '//*[@class="sidebar-elems"]//li' 'Traits'
1110
// @has - '//*[@class="sidebar-elems"]//li' 'Macros'
12-
// @has - '//*[@class="sidebar-elems"]//li' 'Type Definitions'
11+
// @has - '//*[@class="sidebar-elems"]//li' 'Type Aliases'
1312
// @has - '//*[@class="sidebar-elems"]//li' 'Constants'
1413
// @has - '//*[@class="sidebar-elems"]//li' 'Statics'
1514
// @has - '//*[@class="sidebar-elems"]//li' 'Primitive Types'
@@ -26,7 +25,7 @@ pub fn foo() {}
2625
pub trait Trait {}
2726
#[macro_export]
2827
macro_rules! foo {
29-
() => {}
28+
() => {};
3029
}
3130
pub type Type = u8;
3231
pub const FOO: u8 = 0;

tests/rustdoc/titles.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub struct FooStruct;
3030
// @matches 'foo/enum.FooEnum.html' '//h2[@class="location"]' 'FooEnum'
3131
pub enum FooEnum {}
3232

33-
// @matches 'foo/type.FooType.html' '//h1' 'Type Definition foo::FooType'
33+
// @matches 'foo/type.FooType.html' '//h1' 'Type Alias foo::FooType'
3434
// @matches 'foo/type.FooType.html' '//h2[@class="location"]' 'FooType'
3535
pub type FooType = FooStruct;
3636

0 commit comments

Comments
 (0)