Skip to content

Commit a46f3c9

Browse files
authored
Merge pull request #1553 from mati865/required_component
Return Ok status when trying to add required component
2 parents d7c2687 + 56823f8 commit a46f3c9

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/rustup/toolchain.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -636,12 +636,14 @@ impl<'a> Toolchain<'a> {
636636
.expect("installed manifest should have a known target");
637637

638638
if targ_pkg.components.contains(&component) {
639-
return Err(
639+
// Treat it as a warning, see https://github.com/rust-lang/rustup.rs/issues/441
640+
return Ok(println!(
641+
"{}",
640642
ErrorKind::AddingRequiredComponent(
641643
self.name.to_string(),
642644
component.description(&manifest),
643-
).into(),
644-
);
645+
),
646+
));
645647
}
646648

647649
if !targ_pkg.extensions.contains(&component) {

tests/cli-v2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ fn add_target_host() {
636636
setup(&|config| {
637637
let trip = TargetTriple::from_build();
638638
expect_ok(config, &["rustup", "default", "nightly"]);
639-
expect_err(config, &["rustup", "target", "add", &trip.to_string()],
639+
expect_stdout_ok(config, &["rustup", "target", "add", &trip.to_string()],
640640
for_host!("component 'rust-std' for target '{0}' was automatically added because it is required for toolchain 'nightly-{0}'"));
641641
});
642642
}

0 commit comments

Comments
 (0)