Skip to content
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
8 changes: 4 additions & 4 deletions src/dist/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1070,10 +1070,10 @@ impl<'cfg, 'a> DistOptions<'cfg, 'a> {
// the components that the user currently has installed. Let's try the previous
// nightlies in reverse chronological order until we find a nightly that does,
// starting at one date earlier than the current manifest's date.
let try_next = try_date
.unwrap_or_else(|e| panic!("{e}"))
.pred_opt()
.unwrap();
let try_next = match try_date {
Ok(date) => date.pred_opt().unwrap(),
Err(e) => break Err(anyhow!(e)),
};
toolchain.date = Some(try_next.format("%Y-%m-%d").to_string());
};

Expand Down
15 changes: 15 additions & 0 deletions tests/suite/cli_exact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,21 @@ error: no release found for 'nightly-2016-01-01'
"#]]);
}

#[tokio::test]
async fn update_missing_undated_nightly_manifest() {
let cx = CliTestContext::new(Scenario::Empty).await;
cx.config
.expect(["rustup", "update", "nightly"])
.await
.has_code(1)
.with_stdout(snapbox::str![[""]])
.with_stderr(snapbox::str![[r#"
info: syncing channel updates for nightly-[HOST_TUPLE]
error: manifest date not found for toolchain `nightly-[HOST_TUPLE]`

"#]]);
}

// Issue #111
#[tokio::test]
async fn update_custom_toolchain() {
Expand Down
Loading