Skip to content

Commit e7087f0

Browse files
authored
Rollup merge of rust-lang#47404 - integer32llc:reexport-to-re-export, r=steveklabnik
Standardize on "re-export" rather than "reexport" While working on the book with our editors, it was brought to our attention that we're not consistent with when we use "re-export" versus "reexport". For the book, we've decided (with our editors) to go with "re-export"; in prose, I think that looks better. In code, I'm fine with "reexport". However, the rustdoc generated section is currently "Reexports", so when we have a screenshot of generated documentation with the prose where we use "re-export", it's inconsistent. It's too late to fix this for the book because we're using 1.21.0 for the output in the book, and it's really only one spot so it's not a huge deal, but I'd like to advocate for changing the documentation header so that a future edition of the book can be consistent. The first commit here only changes the documentation section heading text and rustdoc documentation that references it. This is the commit that's most important to me. The second commit changes error messages and associated tests to also be consistent with the use of re-export. This is the next most important commit to me, but I could be argued out of this one because then it won't match code like the `macro_reexports` feature name, which ostensibly should change to `macro_re_exports` to be most consistent but I didn't want to change code. The last commit changes re-export anywhere else in prose: either in documentation comments or regular comments. This is least important as most of them aren't user-visible. Instances like these will likely sneak back in over time. I'm totally fine dropping this commit if anyone wants, but [the hobgoblins made me do it](http://www.bartleby.com/100/420.47.html) and it sets a good example. r? @steveklabnik
2 parents 29c2aa7 + e168aa3 commit e7087f0

Some content is hidden

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

42 files changed

+102
-99
lines changed

RELEASES.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ Compatibility Notes
577577
a warning.
578578
- [From the pound escape, lines consisting of multiple `#`s are
579579
now visible][41785]
580-
- [It is an error to reexport private enum variants][42460]. This is
580+
- [It is an error to re-export private enum variants][42460]. This is
581581
known to break a number of crates that depend on an older version of
582582
mustache.
583583
- [On Windows, if `VCINSTALLDIR` is set incorrectly, `rustc` will try
@@ -2251,10 +2251,10 @@ Rustdoc
22512251
-------
22522252

22532253
* [Fix empty implementation section on some module pages](https://github.com/rust-lang/rust/pull/34536)
2254-
* [Fix inlined renamed reexports in import lists](https://github.com/rust-lang/rust/pull/34479)
2254+
* [Fix inlined renamed re-exports in import lists](https://github.com/rust-lang/rust/pull/34479)
22552255
* [Fix search result layout for enum variants and struct fields](https://github.com/rust-lang/rust/pull/34477)
22562256
* [Fix issues with source links to external crates](https://github.com/rust-lang/rust/pull/34387)
2257-
* [Fix redirect pages for renamed reexports](https://github.com/rust-lang/rust/pull/34245)
2257+
* [Fix redirect pages for renamed re-exports](https://github.com/rust-lang/rust/pull/34245)
22582258

22592259
Tooling
22602260
-------
@@ -4988,7 +4988,7 @@ Version 0.10 (2014-04-03)
49884988
* std: The `vec` module has been renamed to `slice`.
49894989
* std: A new vector type, `Vec<T>`, has been added in preparation for DST.
49904990
This will become the only growable vector in the future.
4991-
* std: `std::io` now has more public-reexports. Types such as `BufferedReader`
4991+
* std: `std::io` now has more public re-exports. Types such as `BufferedReader`
49924992
are now found at `std::io::BufferedReader` instead of
49934993
`std::io::buffered::BufferedReader`.
49944994
* std: `print` and `println` are no longer in the prelude, the `print!` and
@@ -5079,8 +5079,8 @@ Version 0.10 (2014-04-03)
50795079
* render standalone markdown files.
50805080
* the --test flag tests all code blocks by default.
50815081
* exported macros are displayed.
5082-
* reexported types have their documentation inlined at the location of the
5083-
first reexport.
5082+
* re-exported types have their documentation inlined at the location of the
5083+
first re-export.
50845084
* search works across crates that have been rendered to the same output
50855085
directory.
50865086

@@ -5467,7 +5467,7 @@ Version 0.7 (2013-07-03)
54675467
incl. `any`, `all`. removed.
54685468
* std: The `finalize` method of `Drop` renamed to `drop`.
54695469
* std: The `drop` method now takes `&mut self` instead of `&self`.
5470-
* std: The prelude no longer reexports any modules, only types and traits.
5470+
* std: The prelude no longer re-exports any modules, only types and traits.
54715471
* std: Prelude additions: `print`, `println`, `FromStr`, `ApproxEq`, `Equiv`,
54725472
`Iterator`, `IteratorUtil`, many numeric traits, many tuple traits.
54735473
* std: New numeric traits: `Fractional`, `Real`, `RealExt`, `Integer`, `Ratio`,

src/doc/rustdoc/src/the-doc-attribute.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The `#[doc]` attribute
22

33
The `#[doc]` attribute lets you control various aspects of how `rustdoc` does
4-
its job.
4+
its job.
55

66
The most basic function of `#[doc]` is to handle the actual documentation
77
text. That is, `///` is syntax sugar for `#[doc]`. This means that these two
@@ -143,7 +143,7 @@ pub mod bar {
143143
}
144144
```
145145

146-
The documentation will generate a "Reexports" section, and say `pub use bar::Bar;`, where
146+
The documentation will generate a "Re-exports" section, and say `pub use bar::Bar;`, where
147147
`Bar` is a link to its page.
148148

149149
If we change the `use` line like this:
@@ -184,7 +184,7 @@ mod bar {
184184
}
185185
```
186186

187-
Now we'll have a `Reexports` line, and `Bar` will not link to anywhere.
187+
Now we'll have a `Re-exports` line, and `Bar` will not link to anywhere.
188188

189189
## `#[doc(hidden)]`
190190

src/liballoc/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//!
1616
//! This library, like libcore, is not intended for general usage, but rather as
1717
//! a building block of other libraries. The types and interfaces in this
18-
//! library are reexported through the [standard library](../std/index.html),
18+
//! library are re-exported through the [standard library](../std/index.html),
1919
//! and should not be used through this library.
2020
//!
2121
//! ## Boxed values
@@ -52,7 +52,7 @@
5252
//! ## Collections
5353
//!
5454
//! Implementations of the most common general purpose data structures are
55-
//! defined in this library. They are reexported through the
55+
//! defined in this library. They are re-exported through the
5656
//! [standard collections library](../std/collections/index.html).
5757
//!
5858
//! ## Heap interfaces

src/libcore/prelude/v1.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@
1616
1717
#![stable(feature = "core_prelude", since = "1.4.0")]
1818

19-
// Reexported core operators
19+
// Re-exported core operators
2020
#[stable(feature = "core_prelude", since = "1.4.0")]
2121
#[doc(no_inline)]
2222
pub use marker::{Copy, Send, Sized, Sync};
2323
#[stable(feature = "core_prelude", since = "1.4.0")]
2424
#[doc(no_inline)]
2525
pub use ops::{Drop, Fn, FnMut, FnOnce};
2626

27-
// Reexported functions
27+
// Re-exported functions
2828
#[stable(feature = "core_prelude", since = "1.4.0")]
2929
#[doc(no_inline)]
3030
pub use mem::drop;
3131

32-
// Reexported types and traits
32+
// Re-exported types and traits
3333
#[stable(feature = "core_prelude", since = "1.4.0")]
3434
#[doc(no_inline)]
3535
pub use clone::Clone;
@@ -55,7 +55,7 @@ pub use option::Option::{self, Some, None};
5555
#[doc(no_inline)]
5656
pub use result::Result::{self, Ok, Err};
5757

58-
// Reexported extension traits for primitive types
58+
// Re-exported extension traits for primitive types
5959
#[stable(feature = "core_prelude", since = "1.4.0")]
6060
#[doc(no_inline)]
6161
pub use slice::SliceExt;

src/libcore/slice/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
// a lot of stuff defined here. Let's keep it clean.
2323
//
2424
// Since slices don't support inherent methods; all operations
25-
// on them are defined on traits, which are then reexported from
25+
// on them are defined on traits, which are then re-exported from
2626
// the prelude for convenience. So there are a lot of traits here.
2727
//
2828
// The layout of this file is thus:

src/librustc/hir/lowering.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2119,7 +2119,7 @@ impl<'a> LoweringContext<'a> {
21192119

21202120
// Privatize the degenerate import base, used only to check
21212121
// the stability of `use a::{};`, to avoid it showing up as
2122-
// a reexport by accident when `pub`, e.g. in documentation.
2122+
// a re-export by accident when `pub`, e.g. in documentation.
21232123
let path = P(self.lower_path(id, &prefix, ParamMode::Explicit, true));
21242124
*vis = hir::Inherited;
21252125
hir::ItemUse(path, hir::UseKind::ListStem)

src/librustc/lint/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ declare_lint! {
127127
declare_lint! {
128128
pub PUB_USE_OF_PRIVATE_EXTERN_CRATE,
129129
Deny,
130-
"detect public reexports of private extern crates"
130+
"detect public re-exports of private extern crates"
131131
}
132132

133133
declare_lint! {

src/librustc/middle/privacy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ pub enum AccessLevel {
2626
// public, then type `T` is reachable. Its values can be obtained by other crates
2727
// even if the type itself is not nameable.
2828
Reachable,
29-
// Public items + items accessible to other crates with help of `pub use` reexports
29+
// Public items + items accessible to other crates with help of `pub use` re-exports
3030
Exported,
31-
// Items accessible to other crates directly, without help of reexports
31+
// Items accessible to other crates directly, without help of re-exports
3232
Public,
3333
}
3434

src/librustc_metadata/decoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,8 +702,8 @@ impl<'a, 'tcx> CrateMetadata {
702702
let vis = self.get_visibility(child_index);
703703
let is_import = false;
704704
callback(def::Export { def, ident, vis, span, is_import });
705-
// For non-reexport structs and variants add their constructors to children.
706-
// Reexport lists automatically contain constructors when necessary.
705+
// For non-re-export structs and variants add their constructors to children.
706+
// Re-export lists automatically contain constructors when necessary.
707707
match def {
708708
Def::Struct(..) => {
709709
if let Some(ctor_def_id) = self.get_struct_ctor_def_id(child_index) {

src/librustc_privacy/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ impl<'a, 'tcx> Visitor<'tcx> for EmbargoVisitor<'a, 'tcx> {
219219
hir::ItemExternCrate(..) => {}
220220
// All nested items are checked by visit_item
221221
hir::ItemMod(..) => {}
222-
// Reexports are handled in visit_mod
222+
// Re-exports are handled in visit_mod
223223
hir::ItemUse(..) => {}
224224
// The interface is empty
225225
hir::ItemGlobalAsm(..) => {}
@@ -1049,7 +1049,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> {
10491049

10501050
fn visit_item(&mut self, item: &'tcx hir::Item) {
10511051
match item.node {
1052-
// contents of a private mod can be reexported, so we need
1052+
// contents of a private mod can be re-exported, so we need
10531053
// to check internals.
10541054
hir::ItemMod(_) => {}
10551055

0 commit comments

Comments
 (0)