XDXDY3CX5KPQWKSFJS7ER5DYTWZFJRXGUWRBITFEYTV565K4IEKQC F2XQXDESA5KNZTPLVXPLLXNFQSFW6PKCCUVWS5NAFCVSD3WSPCEAC FU7S4JHV267EBWLMNE3B7EESCDEDLFJ67UMK75C76CSDONRY3OSAC MAVDUPWDQS4KHMH7THPDZYX53CLT4FTIXBU2DW5G22UTYY5BBWZQC HINOSPQOA75CMI27YWJOFB5ICZYR7WZS576BFUFH57R75W6LNPQQC BAT5B53OT72O5HVR5LJOOUERGYHZCUE7XNQ4XJ775YND6W5F35LAC FPOXMH3V37OTUSYHUFNMBJKX7LUNMJRECCPKLN2IDIJHQLWJVAVAC 226QFOMLVBJD4O4ZUVUQQHHFQWEOCXJUKYZ4KU67GFKCV2ZTXOTAC 5FI47NSAKGGGPLIQSUI3PWOPVYJT7ZYKWVLARNAMUBBYYCUBIOZAC # Make sure that Rust is roughly up-to-date (less than a week old)# rust-overlay's selectLatestNightlyWith silently keeps older versions if components/targets are no longer valid# This code should catch if that happenslet new_rust_version = get-rust-version;assert greater $new_rust_version ((date now) - 7day) $"This version of Rust was built (ansi red_bold)($new_rust_version | date humanize)(ansi reset)!Check that all specified targets and extensions are valid.(ansi yellow_bold)HINT(ansi reset): replace `selectLatestNightlyWith` with `nightly.latest.default.override` to debug.";
# Make sure that Rust is up-to-dateenforce-rust-version;
# Since the Rust version has changed anyways, clean all Rust target directoriesif $old_rust_version != $new_rust_version {print $"Removing old Rust target directories: ($new_rust_version - $old_rust_version) newer";# `cargo-sweep` seems to require the `time` parameter, so just set it to 0cargo sweep --time 0 --recursive ~/Projects/Rust}
# Prevent rustc from getting too out-of-date;# rust-overlay's selectLatestNightlyWith silently keeps older versions if components/targets are no longer validuse std assert;
# Get the release date of the current Rust version
let version_date = $version_info.date | first | into datetime;# Return an error if the version is more than one week oldassert greater $version_date ((date now) - 7day) $"This version of Rust was built (ansi red_bold)($version_date | date humanize)(ansi reset)!Check that all specified targets and extensions are valid.(ansi yellow_bold)HINT(ansi reset): replace `selectLatestNightlyWith` with `nightly.latest.default.override` to debug.";}
$version_info.date | first | into datetime}