Skip to content

Commit eceb915

Browse files
sunshowershawkw
authored andcommitted
update to Rust 1.85 (#7573)
This is a major update (Rust 2024, async closures!), so let's kick it off now so that we can gradually migrate over. I ran a quick `cargo check --all-targets` to time it: ``` before: 901.01s user 158.67s system 957% cpu 1:50.66 total after: 903.61s user 153.73s system 950% cpu 1:51.24 total ``` -- basically even.
1 parent ad530fa commit eceb915

File tree

8 files changed

+17
-23
lines changed

8 files changed

+17
-23
lines changed

nexus/db-model/src/ipv6net.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl Ipv6Net {
6161
StdRng::from_entropy()
6262
};
6363
let random =
64-
u128::from(rng.next_u64()) << 64 | u128::from(rng.next_u64());
64+
(u128::from(rng.next_u64()) << 64) | u128::from(rng.next_u64());
6565

6666
// Generate a mask for the new address.
6767
//

nexus/src/app/background/tasks/networking.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ pub(crate) fn api_to_dpd_port_settings(
6565
let link_id = LinkId(0);
6666
let tx_eq = if let Some(Some(t)) = settings.tx_eq.get(0) {
6767
Some(TxEq {
68-
pre1: t.pre1.map(Into::into),
69-
pre2: t.pre2.map(Into::into),
70-
main: t.main.map(Into::into),
71-
post2: t.post2.map(Into::into),
72-
post1: t.post2.map(Into::into),
68+
pre1: t.pre1,
69+
pre2: t.pre2,
70+
main: t.main,
71+
post2: t.post2,
72+
post1: t.post2,
7373
})
7474
} else {
7575
None

nexus/src/app/background/tasks/sync_switch_configuration.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -938,11 +938,11 @@ impl BackgroundTask for SwitchPortSettingsManager {
938938
// TODO https://github.com/oxidecomputer/omicron/issues/3062
939939
let tx_eq = if let Some(Some(c)) = info.tx_eq.get(0) {
940940
Some(TxEqConfig {
941-
pre1: c.pre1.map(Into::into),
942-
pre2: c.pre2.map(Into::into),
943-
main: c.main.map(Into::into),
944-
post2: c.post2.map(Into::into),
945-
post1: c.post1.map(Into::into),
941+
pre1: c.pre1,
942+
pre2: c.pre2,
943+
main: c.main,
944+
post2: c.post2,
945+
post1: c.post1,
946946
})
947947
} else {
948948
None

oximeter/instruments/src/kstat/link.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ mod tests {
231231
rand::thread_rng()
232232
.sample_iter(Uniform::new('a', 'z'))
233233
.take(5)
234-
.map(char::from)
235234
.collect::<String>(),
236235
);
237236
Self::create(&name);

oximeter/oxql-types/src/point.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ impl Points {
821821
let mut new = Vec::with_capacity(doubles.len());
822822
for maybe_double in doubles.iter().copied() {
823823
match maybe_double {
824-
Some(d) if d == 0.0 => new.push(Some(false)),
824+
Some(0.0) => new.push(Some(false)),
825825
Some(_) => new.push(Some(true)),
826826
None => new.push(None),
827827
}

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# We choose a specific toolchain (rather than "stable") for repeatability. The
33
# intent is to keep this up-to-date with recently-released stable Rust.
44

5-
channel = "1.84.1"
5+
channel = "1.85.0"
66
profile = "default"

sled-agent/src/rack_setup/service.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -972,12 +972,7 @@ impl ServiceInner {
972972
.iter()
973973
.map(|config| NexusTypes::BgpConfig {
974974
asn: config.asn,
975-
originate: config
976-
.originate
977-
.iter()
978-
.cloned()
979-
.map(Into::into)
980-
.collect(),
975+
originate: config.originate.to_vec(),
981976
shaper: config.shaper.clone(),
982977
checker: config.checker.clone(),
983978
})

sled-hardware/types/src/underlay.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ fn mac_to_bootstrap_ip(mac: MacAddr, interface_id: u64) -> Ipv6Addr {
4848
(u16::from(mac_bytes[0]) << 8) | u16::from(mac_bytes[1]),
4949
(u16::from(mac_bytes[2]) << 8) | u16::from(mac_bytes[3]),
5050
(u16::from(mac_bytes[4]) << 8) | u16::from(mac_bytes[5]),
51-
(interface_id >> 48 & 0xffff).try_into().unwrap(),
52-
(interface_id >> 32 & 0xffff).try_into().unwrap(),
53-
(interface_id >> 16 & 0xffff).try_into().unwrap(),
51+
((interface_id >> 48) & 0xffff).try_into().unwrap(),
52+
((interface_id >> 32) & 0xffff).try_into().unwrap(),
53+
((interface_id >> 16) & 0xffff).try_into().unwrap(),
5454
(interface_id & 0xfff).try_into().unwrap(),
5555
)
5656
}

0 commit comments

Comments
 (0)