Skip to content

Commit 0369a41

Browse files
committed
Rename files to match current recommendations.
New standards have arisen in recent months, mostly for the use of rustpkg, but the main Rust codebase has not been altered to match these new specifications. This changeset rectifies most of these issues. - Renamed the crate source files `src/libX/X.rs` to `lib.rs`, for consistency with current styles; this affects extra, rustc, rustdoc, rustpkg, rustuv, std, syntax. - Renamed `X/X.rs` to `X/mod.rs,` as is now recommended style, for `std::num` and `std::terminfo`. - Shifted `src/libstd/str/ascii.rs` out of the otherwise unused `str` directory, to be consistent with its import path of `std::ascii`; libstd is flat at present so it's more appropriate thus. While this removes some `#[path = "..."]` directives, it does not remove all of them, and leaves certain other inconsistencies, such as `std::u8` et al. which are actually stored in `src/libstd/num/` (one subdirectory down). No quorum has been reached on this issue, so I felt it best to leave them all alone at present. #9208 deals with the possibility of making libstd more hierarchical (such as changing the crate to match the current filesystem structure, which would make the module path `std::num::u8`). There is one thing remaining in which this repository is not rustpkg-compliant: rustpkg would have `src/std/` et al. rather than `src/libstd/` et al. I have not endeavoured to change that at this point as it would guarantee prompt bitrot and confusion. A change of that magnitude needs to be discussed first.
1 parent 318e1da commit 0369a41

File tree

12 files changed

+7
-10
lines changed

12 files changed

+7
-10
lines changed

Makefile.in

+5-5
Original file line numberDiff line numberDiff line change
@@ -280,35 +280,35 @@ $(foreach target,$(CFG_TARGET),\
280280
# Standard library variables
281281
######################################################################
282282

283-
STDLIB_CRATE := $(S)src/libstd/std.rs
283+
STDLIB_CRATE := $(S)src/libstd/lib.rs
284284
STDLIB_INPUTS := $(wildcard $(addprefix $(S)src/libstd/, \
285285
*.rs */*.rs */*/*rs */*/*/*rs))
286286

287287
######################################################################
288288
# Extra library variables
289289
######################################################################
290290

291-
EXTRALIB_CRATE := $(S)src/libextra/extra.rs
291+
EXTRALIB_CRATE := $(S)src/libextra/lib.rs
292292
EXTRALIB_INPUTS := $(wildcard $(addprefix $(S)src/libextra/, \
293293
*.rs */*.rs))
294294

295295
######################################################################
296296
# Rust UV library variables
297297
######################################################################
298298

299-
LIBRUSTUV_CRATE := $(S)src/librustuv/rustuv.rs
299+
LIBRUSTUV_CRATE := $(S)src/librustuv/lib.rs
300300
LIBRUSTUV_INPUTS := $(wildcard $(addprefix $(S)src/librustuv/, \
301301
*.rs */*.rs))
302302

303303
######################################################################
304304
# rustc crate variables
305305
######################################################################
306306

307-
COMPILER_CRATE := $(S)src/librustc/rustc.rs
307+
COMPILER_CRATE := $(S)src/librustc/lib.rs
308308
COMPILER_INPUTS := $(wildcard $(addprefix $(S)src/librustc/, \
309309
*.rs */*.rs */*/*.rs */*/*/*.rs))
310310

311-
LIBSYNTAX_CRATE := $(S)src/libsyntax/syntax.rs
311+
LIBSYNTAX_CRATE := $(S)src/libsyntax/lib.rs
312312
LIBSYNTAX_INPUTS := $(wildcard $(addprefix $(S)src/libsyntax/, \
313313
*.rs */*.rs */*/*.rs */*/*/*.rs))
314314

mk/tools.mk

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ COMPILETEST_CRATE := $(S)src/compiletest/compiletest.rs
1616
COMPILETEST_INPUTS := $(wildcard $(S)src/compiletest/*.rs)
1717

1818
# Rustpkg, the package manager and build system
19-
RUSTPKG_LIB := $(S)src/librustpkg/rustpkg.rs
19+
RUSTPKG_LIB := $(S)src/librustpkg/lib.rs
2020
RUSTPKG_INPUTS := $(wildcard $(S)src/librustpkg/*.rs)
2121

2222
# Rustdoc, the documentation tool
23-
RUSTDOC_LIB := $(S)src/librustdoc/rustdoc.rs
23+
RUSTDOC_LIB := $(S)src/librustdoc/lib.rs
2424
RUSTDOC_INPUTS := $(wildcard $(addprefix $(S)src/librustdoc/, \
2525
*.rs */*.rs */*/*.rs))
2626

src/libextra/extra.rs renamed to src/libextra/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ pub mod uuid;
9898
#[cfg(unicode)]
9999
mod unicode;
100100

101-
#[path="terminfo/terminfo.rs"]
102101
pub mod terminfo;
103102

104103
// Compiler support modules
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/libstd/std.rs renamed to src/libstd/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ pub mod vec;
122122
pub mod at_vec;
123123
pub mod str;
124124

125-
#[path = "str/ascii.rs"]
126125
pub mod ascii;
127126
pub mod send_str;
128127

@@ -143,7 +142,6 @@ pub mod rc;
143142
/* Common traits */
144143

145144
pub mod from_str;
146-
#[path = "num/num.rs"]
147145
pub mod num;
148146
pub mod iter;
149147
pub mod to_str;
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)