Skip to content

Commit

Permalink
Merge branch 'rust-lang:master' into bump-clap
Browse files Browse the repository at this point in the history
  • Loading branch information
zohnannor committed Aug 29, 2022
2 parents 92d93cb + 8f6b536 commit d145959
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 16 deletions.
7 changes: 5 additions & 2 deletions doc/src/concepts/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ toolchains. The following is an overview of the different components:
* `rust-docs` — This is a local copy of the [Rust documentation]. Use the
`rustup doc` command to open the documentation in a web browser. Run `rustup
doc --help` for more options.
* `rls` — [RLS] is a language server that provides support for editors and
IDEs.
* `rust-analyzer`[rust-analyzer] is a language server that provides support
for editors and IDEs.
* `rls`[RLS] is a language server that is deprecated and has been replaced
by rust-analyzer.
* `clippy` — [Clippy] is a lint tool that provides extra checks for common
mistakes and stylistic choices.
* `miri` — [Miri] is an experimental Rust interpreter, which can be used for
Expand Down Expand Up @@ -76,6 +78,7 @@ details.
[build-std]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std
[miri]: https://github.com/rust-lang/miri/
[RLS]: https://github.com/rust-lang/rls
[rust-analyzer]: https://rust-analyzer.github.io/
[rustdoc]: https://doc.rust-lang.org/rustdoc/
[cargo]: https://doc.rust-lang.org/cargo/
[clippy]: https://github.com/rust-lang/rust-clippy
Expand Down
2 changes: 1 addition & 1 deletion doc/src/concepts/profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ available at this time are `minimal`, `default`, and `complete`:
`rustup`. This should never be used, as it includes *every* component ever
included in the metadata and thus will almost always fail. If you are
looking for a way to install devtools such as `miri` or IDE integration
tools (`rls`), you should use the `default` profile and
tools (`rust-analyzer`), you should use the `default` profile and
install the needed additional components manually, either by using `rustup
component add` or by using `-c` when installing the toolchain.

Expand Down
4 changes: 3 additions & 1 deletion doc/src/concepts/proxies.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ The list of proxies is currently static in `rustup` and is as follows:

- `rust-lldb`, `rust-gdb`, and `rust-gdbgui` are simple wrappers around the `lldb`, `gdb`, and `gdbgui` debuggers respectively. The wrappers enable some pretty-printing of Rust values and add some convenience features to the debuggers by means of their scripting interfaces.

- `rls` is part of the Rust IDE integration tooling. It implements the language-server protocol to permit IDEs and editors such as Visual Studio Code, ViM, or Emacs, access to the semantics of the Rust code you are editing. It comes from the `rls` component.
- `rust-analyzer` is part of the Rust IDE integration tooling. It implements the language-server protocol to permit IDEs and editors such as Visual Studio Code, ViM, or Emacs, access to the semantics of the Rust code you are editing. It comes from the `rust-analyzer` component.

- `cargo-clippy` and `clippy-driver` are related to the `clippy` linting tool which provides extra checks for common mistakes and stylistic choices and it comes from the `clippy` component.

- `cargo-miri` is an experimental interpreter for Rust's mid-level intermediate representation (MIR) and it comes from the `miri` component.

- `rls` is a deprecated IDE tool that has been replaced by `rust-analyzer`. It comes from the `rls` component.
3 changes: 3 additions & 0 deletions rustup-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@ get_architecture() {
riscv64)
_cputype=riscv64gc
;;
loongarch64)
_cputype=loongarch64
;;
*)
err "unknown CPU type: $_cputype"

Expand Down
4 changes: 4 additions & 0 deletions src/cli/self_update/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,10 +523,14 @@ pub(crate) fn do_add_to_programs() -> Result<()> {
vtype: RegType::REG_SZ,
};

let current_version: &str = env!("CARGO_PKG_VERSION");

key.set_raw_value("UninstallString", &reg_value)
.context("Failed to set uninstall string")?;
key.set_value("DisplayName", &"Rustup: the Rust toolchain installer")
.context("Failed to set display name")?;
key.set_value("DisplayVersion", &current_version)
.context("Failed to set display version")?;

Ok(())
}
Expand Down
9 changes: 6 additions & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -673,13 +673,16 @@ impl Cfg {
};

if let Ok(contents) = contents {
let override_file = Cfg::parse_override_file(contents, parse_mode)?;
let add_file_context = || format!("in {}", toolchain_file.to_string_lossy());
let override_file = Cfg::parse_override_file(contents, parse_mode)
.with_context(add_file_context)?;
if let Some(toolchain_name) = &override_file.toolchain.channel {
let all_toolchains = self.list_toolchains()?;
let all_toolchains = self.list_toolchains().with_context(add_file_context)?;
if !all_toolchains.iter().any(|s| s == toolchain_name) {
// The given name is not resolvable as a toolchain, so
// instead check it's plausible for installation later
dist::validate_channel_name(toolchain_name)?;
dist::validate_channel_name(toolchain_name)
.with_context(add_file_context)?;
}
}

Expand Down
1 change: 1 addition & 0 deletions src/dist/triple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ static LIST_ARCHS: &[&str] = &[
"powerpc64le",
"riscv64gc",
"s390x",
"loongarch64",
];
static LIST_OSES: &[&str] = &[
"pc-windows",
Expand Down
16 changes: 8 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub static TOOLS: &[&str] = &[
// Tools which are commonly installed by Cargo as well as rustup. We take a bit
// more care with these to ensure we don't overwrite the user's previous
// installation.
pub static DUP_TOOLS: &[&str] = &["rustfmt", "cargo-fmt"];
pub static DUP_TOOLS: &[&str] = &["rust-analyzer", "rustfmt", "cargo-fmt"];

// If the given name is one of the tools we proxy.
pub fn is_proxyable_tools(tool: &str) -> Result<()> {
Expand Down Expand Up @@ -110,12 +110,12 @@ mod tests {
for tool in DUP_TOOLS {
assert!(is_proxyable_tools(tool).is_ok());
}
let message = &"unknown proxy name: 'unknown-tool'; valid proxy names are 'rustc', \
'rustdoc', 'cargo', 'rust-lldb', 'rust-gdb', 'rust-gdbgui', 'rls', 'cargo-clippy', \
'clippy-driver', 'cargo-miri', 'rustfmt', 'cargo-fmt'";
assert!(is_proxyable_tools("unknown-tool")
.unwrap_err()
.to_string()
.eq(message));
let message = "unknown proxy name: 'unknown-tool'; valid proxy names are 'rustc', \
'rustdoc', 'cargo', 'rust-lldb', 'rust-gdb', 'rust-gdbgui', 'rls', \
'cargo-clippy', 'clippy-driver', 'cargo-miri', 'rust-analyzer', 'rustfmt', 'cargo-fmt'";
assert_eq!(
is_proxyable_tools("unknown-tool").unwrap_err().to_string(),
message
);
}
}
2 changes: 2 additions & 0 deletions src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ pub fn this_host_triple() -> String {
"riscv64gc"
} else if cfg!(target_arch = "aarch64") {
"aarch64"
} else if cfg!(target_arch = "loongarch64") {
"loongarch64"
} else {
unimplemented!()
};
Expand Down
5 changes: 4 additions & 1 deletion tests/cli-misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,10 @@ fn rustup_failed_path_search() {
expect_err(
config,
broken,
"unknown proxy name: 'fake_proxy'; valid proxy names are 'rustc', 'rustdoc', 'cargo', 'rust-lldb', 'rust-gdb', 'rust-gdbgui', 'rls', 'cargo-clippy', 'clippy-driver', 'cargo-miri', 'rustfmt', 'cargo-fmt'",
"unknown proxy name: 'fake_proxy'; valid proxy names are \
'rustc', 'rustdoc', 'cargo', 'rust-lldb', 'rust-gdb', 'rust-gdbgui', \
'rls', 'cargo-clippy', 'clippy-driver', 'cargo-miri', \
'rust-analyzer', 'rustfmt', 'cargo-fmt'",
);

// Hardlink will be automatically cleaned up by test setup code
Expand Down

0 comments on commit d145959

Please sign in to comment.