Skip to content

docs, comments: Editing and style cleanup #2715

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# rustup: the Rust toolchain installer
# Rustup: the Rust toolchain installer

| Master CI | Build Status |
|--------------|----------------------------------------------------------|
| Windows | ![Windows builds][actions-windows-master] |
| macOS | ![maOS builds][actions-macos-master] |
| Linux Etc | ![Linux (etc) builds][actions-linux-master] |

*rustup* installs [The Rust Programming Language][rustlang] from the official
*Rustup* installs [The Rust Programming Language][rustlang] from the official
release channels, enabling you to easily switch between stable, beta,
and nightly compilers and keep them updated. It makes cross-compiling
simpler with binary builds of the standard library for common platforms.
Expand All @@ -16,16 +16,16 @@ And it runs on all platforms Rust supports, including Windows.

## Documentation

See [**The rustup book**](https://rust-lang.github.io/rustup/) for
documentation on installing and using rustup.
See [**The Rustup book**](https://rust-lang.github.io/rustup/) for
documentation on installing and using Rustup.

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for information on contributing to rustup.
See [CONTRIBUTING.md](CONTRIBUTING.md) for information on contributing to Rustup.

## License

Copyright Diggory Blake, the Mozilla Corporation, and rustup
Copyright Diggory Blake, the Mozilla Corporation, and Rustup
contributors.

Licensed under either of
Expand Down
18 changes: 9 additions & 9 deletions doc/src/installation/other.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
The primary installation method, as described at <https://rustup.rs>, differs
by platform:

* On Windows, download and run the [rustup-init.exe built for
`i686-pc-windows-gnu` target][setup]. In general, this is the build of
`rustup` one should install on Windows. Despite being built against the GNU
toolchain, _the Windows build of `rustup` will install Rust for the MSVC
toolchain if it detects that MSVC is installed_. If you prefer to install
GNU toolchains or x86_64 toolchains by default this can be modified at
install time, either interactively or with the `--default-host` flag, or
after installation via `rustup set default-host`.
* On Windows, download and run the [`rustup-init.exe` built for the
`x86_64-pc-windows-msvc` target][setup]. In general, this is the build of
`rustup` one should install on Windows. This will require the Visual C++
Build Tools 2019 or equivalent (Visual Studio 2019, etc.) to already be
installed. If you would prefer to install GNU toolchains or the i686
toolchains by default this can be modified at install time, either
interactively, with the `--default-host` flag, or after installation
via `rustup set default-host`.
* On Unix, run `curl https://sh.rustup.rs -sSf | sh` in your shell. This
downloads and runs [`rustup-init.sh`], which in turn downloads and runs the
correct version of the `rustup-init` executable for your platform.

[setup]: https://static.rust-lang.org/rustup/dist/i686-pc-windows-gnu/rustup-init.exe
[setup]: https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe
[`rustup-init.sh`]: https://static.rust-lang.org/rustup/rustup-init.sh

`rustup-init` accepts arguments, which can be passed through the shell script.
Expand Down
15 changes: 7 additions & 8 deletions src/bin/rustup-init.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
//! The main rustup commandline application
//! The main Rustup command-line interface
//!
//! The rustup binary is a chimera, changing its behavior based on the
//! name of the binary. This is used most prominently to enable
//! rustup's tool 'proxies' - that is, rustup itself and the rustup
//! proxies are the same binary; when the binary is called 'rustup' or
//! 'rustup.exe' rustup behaves like the rustup commandline
//! application; when it is called 'rustc' it behaves as a proxy to
//! 'rustc'.
//! Rustup's tool 'proxies' - that is, rustup itself and the rustup
//! proxies are the same binary: when the binary is called 'rustup' or
//! 'rustup.exe' it offers the Rustup command-line interface, and
//! when it is called 'rustc' it behaves as a proxy to 'rustc'.
//!
//! This scheme is further used to distinguish the rustup installer,
//! called 'rustup-init' which is again just the rustup binary under a
//! This scheme is further used to distinguish the Rustup installer,
//! called 'rustup-init', which is again just the rustup binary under a
//! different name.

#![recursion_limit = "1024"]
Expand Down
4 changes: 2 additions & 2 deletions src/cli/help.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pub static RUSTUP_HELP: &str = r"DISCUSSION:
rustup installs The Rust Programming Language from the official
Rustup installs The Rust Programming Language from the official
release channels, enabling you to easily switch between stable,
beta, and nightly compilers and keep them updated. It makes
cross-compiling simpler with binary builds of the standard library
Expand Down Expand Up @@ -105,7 +105,7 @@ pub static TOOLCHAIN_LINK_HELP: &str = r"DISCUSSION:
toolchain 'latest-stage1' will be used.";

pub static OVERRIDE_HELP: &str = r"DISCUSSION:
Overrides configure rustup to use a specific toolchain when
Overrides configure Rustup to use a specific toolchain when
running in a specific directory.

Directories can be assigned their own Rust toolchain with `rustup
Expand Down
2 changes: 1 addition & 1 deletion src/cli/job.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// FIXME: stolen from cargo. Should be extracted into a common crate.

//! Job management (mostly for windows)
//! Job management (mostly for Windows)
//!
//! Most of the time when you're running cargo you expect Ctrl-C to actually
//! terminate the entire tree of processes in play, not just the one at the top
Expand Down
4 changes: 2 additions & 2 deletions src/cli/self_update/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//!
//! Rustup addresses this by:
//! 1) using a shell script that updates PATH if the path is not in PATH
//! 2) sourcing this script in any known and appropriate rc file
//! 2) sourcing this script (`. /path/to/script`) in any appropriate rc file

use std::path::PathBuf;

Expand Down Expand Up @@ -82,7 +82,7 @@ pub trait UnixShell {
// heuristic should be used, assuming shells exist if any traces do.
fn does_exist(&self) -> bool;

// Gives all rcfiles of a given shell that rustup is concerned with.
// Gives all rcfiles of a given shell that Rustup is concerned with.
// Used primarily in checking rcfiles for cleanup.
fn rcfiles(&self) -> Vec<PathBuf>;

Expand Down
13 changes: 3 additions & 10 deletions src/cli/self_update/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,7 @@ pub fn do_remove_from_programs() -> Result<()> {
}

/// Tell the upgrader to replace the rustup bins, then delete
/// itself. Like with uninstallation, on Windows we're going to
/// have to jump through hoops to make everything work right.
///
/// On windows we're not going to wait for it to finish before exiting
/// successfully, so it should not do much, and it should try
/// really hard to succeed, because at this point the upgrade is
/// considered successful.
/// itself.
pub fn run_update(setup_path: &Path) -> Result<utils::ExitCode> {
let status = Command::new(setup_path)
.arg("--self-replace")
Expand All @@ -151,8 +145,7 @@ pub fn run_update(setup_path: &Path) -> Result<utils::ExitCode> {

/// This function is as the final step of a self-upgrade. It replaces
/// `CARGO_HOME`/bin/rustup with the running exe, and updates the the
/// links to it. On windows this will run *after* the original
/// rustup process exits.
/// links to it.
pub fn self_replace() -> Result<utils::ExitCode> {
install_bins()?;

Expand Down Expand Up @@ -181,7 +174,7 @@ fn remove_legacy_source_command(source_cmd: String) -> Result<()> {

fn remove_legacy_paths() -> Result<()> {
// Before the work to support more kinds of shells, which was released in
// version 1.23.0 of rustup, we always inserted this line instead, which is
// version 1.23.0 of Rustup, we always inserted this line instead, which is
// now considered legacy
remove_legacy_source_command(format!(
"export PATH=\"{}/bin:$PATH\"\n",
Expand Down
4 changes: 2 additions & 2 deletions src/cli/self_update/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,15 +383,15 @@ pub fn self_replace() -> Result<utils::ExitCode> {
// like when they are running.
//
// Here's what we're going to do:
// - Copy rustup to a temporary file in
// - Copy rustup.exe to a temporary file in
// CARGO_HOME/../rustup-gc-$random.exe.
// - Open the gc exe with the FILE_FLAG_DELETE_ON_CLOSE and
// FILE_SHARE_DELETE flags. This is going to be the last
// file to remove, and the OS is going to do it for us.
// This file is opened as inheritable so that subsequent
// processes created with the option to inherit handles
// will also keep them open.
// - Run the gc exe, which waits for the original rustup
// - Run the gc exe, which waits for the original rustup.exe
// process to close, then deletes CARGO_HOME. This process
// has inherited a FILE_FLAG_DELETE_ON_CLOSE handle to itself.
// - Finally, spawn yet another system binary with the inherit handles
Expand Down
2 changes: 1 addition & 1 deletion src/utils/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
///! Utility functions for rustup
///! Utility functions for Rustup
pub mod notifications;
pub mod raw;
pub mod toml_utils;
Expand Down