mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-25 11:14:46 +00:00
Don't trigger an update when looking for suggestions.
This commit is contained in:
parent
a93bfcbdff
commit
afe7314ede
@ -245,12 +245,7 @@ fn render_suggestions(
|
||||
let mut sources: HashMap<_, _> = source_ids
|
||||
.into_iter()
|
||||
.filter_map(|sid| {
|
||||
let unlocked = sid.clone().with_precise(None);
|
||||
let mut source = map.load(unlocked, &HashSet::new()).ok()?;
|
||||
// Ignore errors updating.
|
||||
if let Err(e) = source.update() {
|
||||
log::debug!("failed to update source: {:?}", e);
|
||||
}
|
||||
let source = map.load(sid, &HashSet::new()).ok()?;
|
||||
Some((sid, source))
|
||||
})
|
||||
.collect();
|
||||
|
@ -325,6 +325,15 @@ fn suggestions_for_updates() {
|
||||
.file("src/lib.rs", "")
|
||||
.publish();
|
||||
|
||||
// This is a hack to force cargo to update the index. Cargo can't do this
|
||||
// automatically because doing a network update on every build would be a
|
||||
// bad idea. Under normal circumstances, we'll hope the user has done
|
||||
// something else along the way to trigger an update (building some other
|
||||
// project or something). This could use some more consideration of how to
|
||||
// handle this better (maybe only trigger an update if it hasn't updated
|
||||
// in a long while?).
|
||||
p.cargo("update -p without_updates").run();
|
||||
|
||||
p.cargo("check -Zfuture-incompat-report")
|
||||
.masquerade_as_nightly_cargo()
|
||||
.with_stderr_contains("[..]cargo report future-incompatibilities --id 1[..]")
|
||||
|
Loading…
x
Reference in New Issue
Block a user