Skip to content

Commit 50fbbeb

Browse files
authored
Merge pull request #2613 from hi-rustin/rustin-patch-fix
Report error once when got invalid toolchain name
2 parents c44e884 + 736cb0a commit 50fbbeb

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/config.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -576,13 +576,7 @@ impl Cfg {
576576
if !all_toolchains.iter().any(|s| s == toolchain_name) {
577577
// The given name is not resolvable as a toolchain, so
578578
// instead check it's plausible for installation later
579-
dist::validate_channel_name(&toolchain_name).chain_err(|| {
580-
format!(
581-
"invalid channel name '{}' in '{}'",
582-
toolchain_name,
583-
toolchain_file.display()
584-
)
585-
})?;
579+
dist::validate_channel_name(&toolchain_name)?;
586580
}
587581
}
588582

tests/cli-rustup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1735,7 +1735,7 @@ fn bad_file_override() {
17351735
expect_err(
17361736
config,
17371737
&["rustc", "--version"],
1738-
"invalid channel name 'gumbo' in",
1738+
"invalid toolchain name: 'gumbo'",
17391739
);
17401740
});
17411741
}

0 commit comments

Comments
 (0)