Skip to content

Commit

Permalink
Rename files to match current recommendations.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chris-morgan committed Nov 3, 2013
1 parent 318e1da commit 0369a41
Show file tree
Hide file tree
Showing 12 changed files with 7 additions and 10 deletions.
10 changes: 5 additions & 5 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -280,35 +280,35 @@ $(foreach target,$(CFG_TARGET),\
# Standard library variables
######################################################################

STDLIB_CRATE := $(S)src/libstd/std.rs
STDLIB_CRATE := $(S)src/libstd/lib.rs
STDLIB_INPUTS := $(wildcard $(addprefix $(S)src/libstd/, \
*.rs */*.rs */*/*rs */*/*/*rs))

######################################################################
# Extra library variables
######################################################################

EXTRALIB_CRATE := $(S)src/libextra/extra.rs
EXTRALIB_CRATE := $(S)src/libextra/lib.rs
EXTRALIB_INPUTS := $(wildcard $(addprefix $(S)src/libextra/, \
*.rs */*.rs))

######################################################################
# Rust UV library variables
######################################################################

LIBRUSTUV_CRATE := $(S)src/librustuv/rustuv.rs
LIBRUSTUV_CRATE := $(S)src/librustuv/lib.rs
LIBRUSTUV_INPUTS := $(wildcard $(addprefix $(S)src/librustuv/, \
*.rs */*.rs))

######################################################################
# rustc crate variables
######################################################################

COMPILER_CRATE := $(S)src/librustc/rustc.rs
COMPILER_CRATE := $(S)src/librustc/lib.rs
COMPILER_INPUTS := $(wildcard $(addprefix $(S)src/librustc/, \
*.rs */*.rs */*/*.rs */*/*/*.rs))

LIBSYNTAX_CRATE := $(S)src/libsyntax/syntax.rs
LIBSYNTAX_CRATE := $(S)src/libsyntax/lib.rs
LIBSYNTAX_INPUTS := $(wildcard $(addprefix $(S)src/libsyntax/, \
*.rs */*.rs */*/*.rs */*/*/*.rs))

Expand Down
4 changes: 2 additions & 2 deletions mk/tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ COMPILETEST_CRATE := $(S)src/compiletest/compiletest.rs
COMPILETEST_INPUTS := $(wildcard $(S)src/compiletest/*.rs)

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

# Rustdoc, the documentation tool
RUSTDOC_LIB := $(S)src/librustdoc/rustdoc.rs
RUSTDOC_LIB := $(S)src/librustdoc/lib.rs
RUSTDOC_INPUTS := $(wildcard $(addprefix $(S)src/librustdoc/, \
*.rs */*.rs */*/*.rs))

Expand Down
1 change: 0 additions & 1 deletion src/libextra/extra.rs → src/libextra/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ pub mod uuid;
#[cfg(unicode)]
mod unicode;

#[path="terminfo/terminfo.rs"]
pub mod terminfo;

// Compiler support modules
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions src/libstd/std.rs → src/libstd/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ pub mod vec;
pub mod at_vec;
pub mod str;

#[path = "str/ascii.rs"]
pub mod ascii;
pub mod send_str;

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

pub mod from_str;
#[path = "num/num.rs"]
pub mod num;
pub mod iter;
pub mod to_str;
Expand Down
File renamed without changes.
File renamed without changes.

5 comments on commit 0369a41

@bors
Copy link
Contributor

@bors bors commented on 0369a41 Nov 3, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from huonw
at chris-morgan@0369a41

@bors
Copy link
Contributor

@bors bors commented on 0369a41 Nov 3, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging chris-morgan/rust/filename-consistency = 0369a41 into auto

@bors
Copy link
Contributor

@bors bors commented on 0369a41 Nov 3, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chris-morgan/rust/filename-consistency = 0369a41 merged ok, testing candidate = dc079e1

@bors
Copy link
Contributor

@bors bors commented on 0369a41 Nov 3, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 0369a41 Nov 3, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = dc079e1

Please sign in to comment.