diff --git a/clients/dpd-client/src/lib.rs b/clients/dpd-client/src/lib.rs index dd119689fc..a0608a5c7d 100644 --- a/clients/dpd-client/src/lib.rs +++ b/clients/dpd-client/src/lib.rs @@ -9,8 +9,6 @@ // That test passes for code that lives in omicron, but fails for code imported // by omicron. #![allow(rustdoc::broken_intra_doc_links)] -// Temporary workaround while Rust is being updated to 1.84. -#![allow(unknown_lints)] use std::net::IpAddr; diff --git a/cockroach-admin/types/src/lib.rs b/cockroach-admin/types/src/lib.rs index 3653cc616b..973c86bced 100644 --- a/cockroach-admin/types/src/lib.rs +++ b/cockroach-admin/types/src/lib.rs @@ -75,7 +75,7 @@ where D: serde::Deserializer<'de>, { struct CockroachTimestampVisitor; - impl<'de> de::Visitor<'de> for CockroachTimestampVisitor { + impl de::Visitor<'_> for CockroachTimestampVisitor { type Value = DateTime; fn expecting( @@ -185,7 +185,7 @@ where { struct CockroachNodeMembershipVisitor; - impl<'de> de::Visitor<'de> for CockroachNodeMembershipVisitor { + impl de::Visitor<'_> for CockroachNodeMembershipVisitor { type Value = NodeMembership; fn expecting( diff --git a/common/src/api/external/error.rs b/common/src/api/external/error.rs index ec293ebeb3..2de8ebebf7 100644 --- a/common/src/api/external/error.rs +++ b/common/src/api/external/error.rs @@ -147,7 +147,7 @@ impl MessagePair { struct MessagePairDisplayInternal<'a>(&'a MessagePair); -impl<'a> Display for MessagePairDisplayInternal<'a> { +impl Display for MessagePairDisplayInternal<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{}", self.0.external_message)?; if !self.0.internal_context.is_empty() { diff --git a/dev-tools/downloader/src/lib.rs b/dev-tools/downloader/src/lib.rs index 3f6b32261b..f98f0f5655 100644 --- a/dev-tools/downloader/src/lib.rs +++ b/dev-tools/downloader/src/lib.rs @@ -458,7 +458,7 @@ async fn download_file_and_verify( Ok(()) } -impl<'a> Downloader<'a> { +impl Downloader<'_> { async fn download_cargo_hack(&self) -> Result<()> { let os = os_name()?; let arch = arch()?; diff --git a/dev-tools/omdb/src/bin/omdb/mgs.rs b/dev-tools/omdb/src/bin/omdb/mgs.rs index 0db1731ca6..7d8ddf2a50 100644 --- a/dev-tools/omdb/src/bin/omdb/mgs.rs +++ b/dev-tools/omdb/src/bin/omdb/mgs.rs @@ -197,7 +197,7 @@ fn show_sp_ids(sp_ids: &[SpIdentifier]) -> Result<(), anyhow::Error> { slot: u32, } - impl<'a> From<&'a SpIdentifier> for SpIdRow { + impl From<&SpIdentifier> for SpIdRow { fn from(id: &SpIdentifier) -> Self { SpIdRow { type_: sp_type_to_str(&id.type_), slot: id.slot } } @@ -224,7 +224,7 @@ fn show_sps_from_ignition( system_type: String, } - impl<'a> From<&'a SpIgnitionInfo> for IgnitionRow { + impl From<&SpIgnitionInfo> for IgnitionRow { fn from(value: &SpIgnitionInfo) -> Self { IgnitionRow { type_: sp_type_to_str(&value.id.type_), diff --git a/dev-tools/releng/src/job.rs b/dev-tools/releng/src/job.rs index dcb58a0b92..51368c20fb 100644 --- a/dev-tools/releng/src/job.rs +++ b/dev-tools/releng/src/job.rs @@ -164,7 +164,7 @@ impl Job { } } -impl<'a> Selector<'a> { +impl Selector<'_> { #[track_caller] pub(crate) fn after(self, other: impl AsRef) -> Self { let (sender, receiver) = oneshot::channel(); diff --git a/dns-server/src/storage.rs b/dns-server/src/storage.rs index 306d751e66..73e6cff100 100644 --- a/dns-server/src/storage.rs +++ b/dns-server/src/storage.rs @@ -711,7 +711,7 @@ struct UpdateGuard<'store, 'req_id> { finished: bool, } -impl<'a, 'b> UpdateGuard<'a, 'b> { +impl UpdateGuard<'_, '_> { async fn finish(mut self) { let store = self.store; let mut update = store.updating.lock().await; @@ -732,7 +732,7 @@ impl<'a, 'b> UpdateGuard<'a, 'b> { } } -impl<'a, 'b> Drop for UpdateGuard<'a, 'b> { +impl Drop for UpdateGuard<'_, '_> { fn drop(&mut self) { // UpdateGuard exists because we must enforce at most one Update is // happening at a time, but we also want to catch the case where an diff --git a/illumos-utils/src/svc.rs b/illumos-utils/src/svc.rs index a16795771c..467df6c758 100644 --- a/illumos-utils/src/svc.rs +++ b/illumos-utils/src/svc.rs @@ -25,9 +25,15 @@ mod inner { // properties to not exist when the command returns. // // We workaround this by querying for these properties in a loop. - pub async fn wait_for_service<'a, 'b>( + // + // TODO: remove this when clippy no longer flags + // https://github.com/rust-lang/rust-clippy/issues/13923 (ideally we'd have + // used `expect` but on 1.84, it says that it's unfulfilled even though it + // is fulfilled?) + #[allow(clippy::needless_lifetimes)] + pub async fn wait_for_service<'a>( zone: Option<&'a str>, - fmri: &'b str, + fmri: &str, log: Logger, ) -> Result<(), Error> { let name = smf::PropertyName::new("restarter", "state").unwrap(); diff --git a/installinator/src/write.rs b/installinator/src/write.rs index 8f350bfe27..7274ef4ad5 100644 --- a/installinator/src/write.rs +++ b/installinator/src/write.rs @@ -352,7 +352,7 @@ struct SlotWriteContext<'a> { progress: DriveWriteProgress, } -impl<'a> SlotWriteContext<'a> { +impl SlotWriteContext<'_> { fn register_steps<'b>( &'b self, engine: &UpdateEngine<'b, WriteSpec>, @@ -518,12 +518,12 @@ struct ArtifactsToWrite<'a> { impl ArtifactsToWrite<'_> { /// Attempt to write the host phase 2 image. - async fn write_host_phase_2<'b, WT: WriteTransport>( + async fn write_host_phase_2( &self, log: &Logger, slot: M2Slot, destinations: &ArtifactDestination, - transport: &'b mut WT, + transport: &mut WT, cx: &StepContext, ) -> Result, WriteSpec>, WriteError> { let block_size = write_artifact_impl( diff --git a/internal-dns/types/src/diff.rs b/internal-dns/types/src/diff.rs index 85cd38642f..868d7aee57 100644 --- a/internal-dns/types/src/diff.rs +++ b/internal-dns/types/src/diff.rs @@ -136,7 +136,7 @@ impl<'a> DnsDiff<'a> { } } -impl<'a> std::fmt::Display for DnsDiff<'a> { +impl std::fmt::Display for DnsDiff<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let names_changed = !self.is_empty(); let zone_name = &self.zone_name; diff --git a/nexus/authz-macros/src/lib.rs b/nexus/authz-macros/src/lib.rs index 0548113339..59ae8d9a96 100644 --- a/nexus/authz-macros/src/lib.rs +++ b/nexus/authz-macros/src/lib.rs @@ -12,6 +12,10 @@ use quote::{format_ident, quote}; use serde_tokenstream::ParseWrapper; use syn::parse_quote; +// Allow private intra-doc links. This is useful because the `Input` struct +// cannot be exported (since we're a proc macro crate, and we can't expose +// a struct), but its documentation is very useful. +#[allow(rustdoc::private_intra_doc_links)] /// Defines a structure and helpers for describing an API resource for authz /// /// For context, see the module-level documentation for `omicron-nexus::authz`. @@ -141,11 +145,6 @@ use syn::parse_quote; /// polar_snippet = FleetChild, /// } /// ``` - -// Allow private intra-doc links. This is useful because the `Input` struct -// cannot be exported (since we're a proc macro crate, and we can't expose -// a struct), but its documentation is very useful. -#[allow(rustdoc::private_intra_doc_links)] #[proc_macro] pub fn authz_resource( input: proc_macro::TokenStream, diff --git a/nexus/db-queries/src/db/datastore/dns.rs b/nexus/db-queries/src/db/datastore/dns.rs index 114d553aac..60f677cf35 100644 --- a/nexus/db-queries/src/db/datastore/dns.rs +++ b/nexus/db-queries/src/db/datastore/dns.rs @@ -706,7 +706,7 @@ pub trait DataStoreDnsTest: Send + Sync { opctx: &'a OpContext, dns_group: DnsGroup, version: omicron_common::api::external::Generation, - ) -> BoxFuture<'_, Result>; + ) -> BoxFuture<'a, Result>; } impl DataStoreDnsTest for DataStore { @@ -715,7 +715,7 @@ impl DataStoreDnsTest for DataStore { opctx: &'a OpContext, dns_group: DnsGroup, version: omicron_common::api::external::Generation, - ) -> BoxFuture<'_, Result> { + ) -> BoxFuture<'a, Result> { async move { use db::schema::dns_version::dsl; let dns_version = dsl::dns_version diff --git a/nexus/db-queries/src/db/datastore/instance.rs b/nexus/db-queries/src/db/datastore/instance.rs index 5894e4dba2..65d42fbe7c 100644 --- a/nexus/db-queries/src/db/datastore/instance.rs +++ b/nexus/db-queries/src/db/datastore/instance.rs @@ -1560,7 +1560,6 @@ impl DataStore { /// using [`DataStore::instance_updater_unlock`], or use /// [`DataStore::instance_commit_update`] to release the lock and write back /// a new [`InstanceRuntimeState`] in a single atomic query. - /// /// This method is idempotent: if the instance is already locked by the same /// saga, it will succeed, as though the lock was acquired. diff --git a/nexus/db-queries/src/db/datastore/region.rs b/nexus/db-queries/src/db/datastore/region.rs index 67bd37cf69..4bfe89fdbb 100644 --- a/nexus/db-queries/src/db/datastore/region.rs +++ b/nexus/db-queries/src/db/datastore/region.rs @@ -170,9 +170,7 @@ impl DataStore { let size = size.to_bytes(); // allocate enough extents to fit all the disk blocks, rounding up. - let extent_count = size / Self::EXTENT_SIZE - + ((size % Self::EXTENT_SIZE) + Self::EXTENT_SIZE - 1) - / Self::EXTENT_SIZE; + let extent_count = size.div_ceil(Self::EXTENT_SIZE); (blocks_per_extent, extent_count) } diff --git a/nexus/inventory/src/collector.rs b/nexus/inventory/src/collector.rs index d32d00ed8f..9201780357 100644 --- a/nexus/inventory/src/collector.rs +++ b/nexus/inventory/src/collector.rs @@ -535,21 +535,21 @@ mod test { } write!(&mut s, "\nerrors:\n").unwrap(); + let os_error_re = regex::Regex::new(r"os error \d+").unwrap(); + let comm_error_re = + regex::Regex::new(r"Communication Error.*").unwrap(); for e in &collection.errors { // Some error strings have OS error numbers in them. We want to // ignore those, particularly for CI, which runs these tests on // multiple OSes. - let message = regex::Regex::new(r"os error \d+") - .unwrap() - .replace_all(&e, "os error <>"); + let message = os_error_re.replace_all(&e, "os error <>"); // Communication errors differ based on the configuration of the // machine running the test. For example whether or not the machine // has IPv6 configured will determine if an error is network // unreachable or a timeout due to sending a packet to a known // discard prefix. So just key in on the communication error in a // general sense. - let message = regex::Regex::new(r"Communication Error.*") - .unwrap() + let message = comm_error_re .replace_all(&message, "Communication Error <>"); write!(&mut s, "error: {}\n", message).unwrap(); } diff --git a/nexus/saga-recovery/src/recovery.rs b/nexus/saga-recovery/src/recovery.rs index 0b13e68a49..79458b4e27 100644 --- a/nexus/saga-recovery/src/recovery.rs +++ b/nexus/saga-recovery/src/recovery.rs @@ -318,7 +318,7 @@ struct PlanBuilder<'a> { impl<'a> PlanBuilder<'a> { /// Begin building a `Plan` - fn new(log: &'a slog::Logger) -> PlanBuilder { + fn new(log: &'a slog::Logger) -> Self { PlanBuilder { log, needs_recovery: BTreeMap::new(), diff --git a/nexus/src/app/background/tasks/blueprint_execution.rs b/nexus/src/app/background/tasks/blueprint_execution.rs index 678d4ea1ec..98991a0af1 100644 --- a/nexus/src/app/background/tasks/blueprint_execution.rs +++ b/nexus/src/app/background/tasks/blueprint_execution.rs @@ -62,10 +62,7 @@ impl BlueprintExecutor { /// The presence of `boxed()` in `BackgroundTask::activate` has caused some /// confusion with compilation errors in the past. So separate this method /// out. - async fn activate_impl<'a>( - &mut self, - opctx: &OpContext, - ) -> serde_json::Value { + async fn activate_impl(&mut self, opctx: &OpContext) -> serde_json::Value { // Get the latest blueprint, cloning to prevent holding a read lock // on the watch. let update = self.rx_blueprint.borrow_and_update().clone(); diff --git a/nexus/src/app/background/tasks/inventory_collection.rs b/nexus/src/app/background/tasks/inventory_collection.rs index 0b361b2014..619ab85a3b 100644 --- a/nexus/src/app/background/tasks/inventory_collection.rs +++ b/nexus/src/app/background/tasks/inventory_collection.rs @@ -215,7 +215,7 @@ struct DbSledAgentEnumerator<'a> { datastore: &'a DataStore, } -impl<'a> nexus_inventory::SledAgentEnumerator for DbSledAgentEnumerator<'a> { +impl nexus_inventory::SledAgentEnumerator for DbSledAgentEnumerator<'_> { fn list_sled_agents( &self, ) -> BoxFuture<'_, Result, InventoryError>> { diff --git a/nexus/src/app/background/tasks/support_bundle_collector.rs b/nexus/src/app/background/tasks/support_bundle_collector.rs index 89becc5320..cfaadc4e62 100644 --- a/nexus/src/app/background/tasks/support_bundle_collector.rs +++ b/nexus/src/app/background/tasks/support_bundle_collector.rs @@ -421,7 +421,7 @@ struct BundleCollection<'a> { bundle: &'a SupportBundle, } -impl<'a> BundleCollection<'a> { +impl BundleCollection<'_> { // Collect the bundle within Nexus, and store it on a target sled. async fn collect_bundle_and_store_on_sled( &self, diff --git a/nexus/src/app/background/tasks/sync_switch_configuration.rs b/nexus/src/app/background/tasks/sync_switch_configuration.rs index 6a82f1634c..a595a70086 100644 --- a/nexus/src/app/background/tasks/sync_switch_configuration.rs +++ b/nexus/src/app/background/tasks/sync_switch_configuration.rs @@ -85,8 +85,8 @@ impl SwitchPortSettingsManager { Self { datastore, resolver } } - async fn switch_ports<'a>( - &'a mut self, + async fn switch_ports( + &mut self, opctx: &OpContext, log: &slog::Logger, ) -> Result, serde_json::Value> { @@ -115,8 +115,8 @@ impl SwitchPortSettingsManager { Ok(port_list) } - async fn changes<'a>( - &'a mut self, + async fn changes( + &mut self, port_list: Vec, opctx: &OpContext, log: &slog::Logger, @@ -188,8 +188,8 @@ impl SwitchPortSettingsManager { Ok(changes) } - async fn db_loopback_addresses<'a>( - &'a mut self, + async fn db_loopback_addresses( + &mut self, opctx: &OpContext, log: &slog::Logger, ) -> Result< @@ -224,8 +224,8 @@ impl SwitchPortSettingsManager { Ok(set) } - async fn bfd_peer_configs_from_db<'a>( - &'a mut self, + async fn bfd_peer_configs_from_db( + &mut self, opctx: &OpContext, ) -> Result< Vec, @@ -299,7 +299,7 @@ impl BackgroundTask for SwitchPortSettingsManager { let racks = match self.datastore.rack_list_initialized(opctx, &DataPageParams::max_page()).await { Ok(racks) => racks, Err(e) => { - error!(log, "failed to retrieve racks from database"; + error!(log, "failed to retrieve racks from database"; "error" => %DisplayErrorChain::new(&e) ); return json!({ @@ -329,7 +329,7 @@ impl BackgroundTask for SwitchPortSettingsManager { { Ok(addrs) => addrs, Err(e) => { - error!(log, "failed to resolve addresses for Dendrite services"; + error!(log, "failed to resolve addresses for Dendrite services"; "error" => %DisplayErrorChain::new(&e)); continue; }, @@ -935,7 +935,7 @@ impl BackgroundTask for SwitchPortSettingsManager { }, }; - // TODO https://github.com/oxidecomputer/omicron/issues/3062 + // TODO https://github.com/oxidecomputer/omicron/issues/3062 let tx_eq = if let Some(Some(c)) = info.tx_eq.get(0) { Some(TxEqConfig { pre1: c.pre1.map(Into::into), @@ -1844,7 +1844,7 @@ async fn apply_switch_port_changes( } } -async fn static_routes_on_switch<'a>( +async fn static_routes_on_switch( mgd_clients: &HashMap, log: &slog::Logger, ) -> HashMap { @@ -1935,7 +1935,7 @@ async fn delete_static_routes( } } -async fn add_static_routes<'a>( +async fn add_static_routes( mgd_clients: &HashMap, routes_to_add: HashMap, log: &slog::Logger, diff --git a/nexus/tests/integration_tests/silos.rs b/nexus/tests/integration_tests/silos.rs index 111a5eb122..90166cc1ac 100644 --- a/nexus/tests/integration_tests/silos.rs +++ b/nexus/tests/integration_tests/silos.rs @@ -1619,6 +1619,10 @@ async fn test_silo_user_views(cptestctx: &ControlPlaneTestContext) { let test_silo2 = TestSilo { silo: &silo2, expected_users: silo2_expected_users }; + // Strip the identifier out of error messages because the uuid changes each + // time. + let id_re = regex::Regex::new("\".*?\"").unwrap(); + let mut output = String::new(); for test_silo in [test_silo1, test_silo2] { let silo_name = &test_silo.silo.identity().name; @@ -1696,10 +1700,7 @@ async fn test_silo_user_views(cptestctx: &ControlPlaneTestContext) { let error = test_response .parsed_body::() .unwrap(); - // Strip the identifier out of the error message because the - // uuid changes each time. - let pattern = regex::Regex::new("\".*?\"").unwrap(); - let message = pattern.replace_all(&error.message, "..."); + let message = id_re.replace_all(&error.message, "..."); write!(&mut output, " (message = {:?})", message).unwrap(); } diff --git a/nexus/tests/integration_tests/unauthorized.rs b/nexus/tests/integration_tests/unauthorized.rs index 6581dcb9e9..07e5076955 100644 --- a/nexus/tests/integration_tests/unauthorized.rs +++ b/nexus/tests/integration_tests/unauthorized.rs @@ -159,7 +159,6 @@ G GET PUT POST DEL TRCE G URL /// associated to the results of the setup request with any `{id}` params in the /// URL replaced with the result's URL. This is used to later verify ID /// endpoints without first having to know the ID. - enum SetupReq { Get { url: &'static str, diff --git a/nexus/types/src/deployment.rs b/nexus/types/src/deployment.rs index f1f4bc7e2f..8236d6389f 100644 --- a/nexus/types/src/deployment.rs +++ b/nexus/types/src/deployment.rs @@ -383,7 +383,7 @@ pub struct BlueprintDisplay<'a> { // TODO: add colorization with a stylesheet } -impl<'a> BlueprintDisplay<'a> { +impl BlueprintDisplay<'_> { fn make_cockroachdb_table(&self) -> KvListWithHeading { let fingerprint = if self.blueprint.cockroachdb_fingerprint.is_empty() { NONE_PARENS.to_string() @@ -452,7 +452,7 @@ impl<'a> BlueprintDisplay<'a> { } } -impl<'a> fmt::Display for BlueprintDisplay<'a> { +impl fmt::Display for BlueprintDisplay<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let b = self.blueprint; writeln!(f, "blueprint {}", b.id)?; diff --git a/nexus/types/src/deployment/blueprint_diff.rs b/nexus/types/src/deployment/blueprint_diff.rs index 057b8a54a8..78897bd9cc 100644 --- a/nexus/types/src/deployment/blueprint_diff.rs +++ b/nexus/types/src/deployment/blueprint_diff.rs @@ -1590,7 +1590,7 @@ impl<'diff> BlueprintDiffDisplay<'diff> { } } -impl<'diff> fmt::Display for BlueprintDiffDisplay<'diff> { +impl fmt::Display for BlueprintDiffDisplay<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let diff = self.diff; diff --git a/nexus/types/src/external_api/params.rs b/nexus/types/src/external_api/params.rs index 4e616e698f..d4d09ad46a 100644 --- a/nexus/types/src/external_api/params.rs +++ b/nexus/types/src/external_api/params.rs @@ -601,7 +601,7 @@ pub struct DerEncodedKeyPair { struct X509CertVisitor; -impl<'de> Visitor<'de> for X509CertVisitor { +impl Visitor<'_> for X509CertVisitor { type Value = String; fn expecting( @@ -646,7 +646,7 @@ where struct KeyVisitor; -impl<'de> Visitor<'de> for KeyVisitor { +impl Visitor<'_> for KeyVisitor { type Value = String; fn expecting( diff --git a/oximeter/instruments/src/kstat/mod.rs b/oximeter/instruments/src/kstat/mod.rs index a5020b9b61..e010545329 100644 --- a/oximeter/instruments/src/kstat/mod.rs +++ b/oximeter/instruments/src/kstat/mod.rs @@ -229,7 +229,7 @@ pub trait ConvertNamedData { fn as_u64(&self) -> Result; } -impl<'a> ConvertNamedData for NamedData<'a> { +impl ConvertNamedData for NamedData<'_> { fn as_i32(&self) -> Result { if let NamedData::Int32(x) = self { Ok(*x) diff --git a/oximeter/oxql-types/src/point.rs b/oximeter/oxql-types/src/point.rs index 6e3c7143dc..a201c34722 100644 --- a/oximeter/oxql-types/src/point.rs +++ b/oximeter/oxql-types/src/point.rs @@ -209,7 +209,7 @@ pub struct Point<'a> { pub values: Vec<(Datum<'a>, MetricType)>, } -impl<'a> fmt::Display for Point<'a> { +impl fmt::Display for Point<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { const TIMESTAMP_FMT: &str = "%Y-%m-%d %H:%M:%S.%f"; match &self.start_time { @@ -231,7 +231,7 @@ impl<'a> fmt::Display for Point<'a> { } } -impl<'a> Point<'a> { +impl Point<'_> { /// Return the dimensionality of this point. pub fn dimensionality(&self) -> usize { self.values.len() @@ -249,7 +249,7 @@ pub enum Datum<'a> { DoubleDistribution(Option<&'a Distribution>), } -impl<'a> fmt::Display for Datum<'a> { +impl fmt::Display for Datum<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Datum::Boolean(Some(inner)) => write!(f, "{}", inner), diff --git a/package/src/cargo_plan.rs b/package/src/cargo_plan.rs index 1788d24ba1..05ddccdc6a 100644 --- a/package/src/cargo_plan.rs +++ b/package/src/cargo_plan.rs @@ -99,7 +99,7 @@ impl<'a> CargoPlan<'a> { /// Displays a `CargoPlan` in a human-readable format with the provided /// command name. - pub fn display_human(&'a self, command: &'a str) -> DisplayCargoPlan<'_> { + pub fn display_human(&'a self, command: &'a str) -> DisplayCargoPlan<'a> { DisplayCargoPlan { plan: self, command } } } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 7325e53a1b..db40dacb74 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,11 +1,6 @@ [toolchain] # We choose a specific toolchain (rather than "stable") for repeatability. The # intent is to keep this up-to-date with recently-released stable Rust. -# -# NOTE: Rust 1.82 has a large compile time regression in Diesel-generated -# code: https://github.com/rust-lang/rust/issues/132064. Before moving to a -# newer Rust, ensure that the regression is addressed and that nexus-db-queries -# and omicron-nexus don't take much longer to compile! -channel = "1.81.0" +channel = "1.84.0" profile = "default" diff --git a/sled-agent/src/services.rs b/sled-agent/src/services.rs index 54b0a559cd..31348a8ab4 100644 --- a/sled-agent/src/services.rs +++ b/sled-agent/src/services.rs @@ -5071,10 +5071,7 @@ mod illumos_tests { } impl<'a> LedgerTestHelper<'a> { - async fn new( - log: slog::Logger, - test_config: &'a TestConfig, - ) -> LedgerTestHelper { + async fn new(log: slog::Logger, test_config: &'a TestConfig) -> Self { let ddmd_client = DdmAdminClient::localhost(&log).unwrap(); let storage_test_harness = setup_storage(&log).await; let zone_bundler = ZoneBundler::new( diff --git a/tufaceous-lib/src/archive.rs b/tufaceous-lib/src/archive.rs index 675cba7eee..60be5799b2 100644 --- a/tufaceous-lib/src/archive.rs +++ b/tufaceous-lib/src/archive.rs @@ -216,7 +216,7 @@ enum InvalidPath<'a> { InvalidComponent(Utf8Component<'a>), } -impl<'a> fmt::Display for InvalidPath<'a> { +impl fmt::Display for InvalidPath<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { InvalidPath::AbsolutePath => { diff --git a/tufaceous-lib/src/assemble/manifest.rs b/tufaceous-lib/src/assemble/manifest.rs index d87d4a6a6d..fa5df79982 100644 --- a/tufaceous-lib/src/assemble/manifest.rs +++ b/tufaceous-lib/src/assemble/manifest.rs @@ -583,7 +583,7 @@ where struct Visitor; - impl<'de> serde::de::Visitor<'de> for Visitor { + impl serde::de::Visitor<'_> for Visitor { type Value = u64; fn expecting( diff --git a/update-engine/src/display/line_display_shared.rs b/update-engine/src/display/line_display_shared.rs index 73a0e44e19..c11aadf3e5 100644 --- a/update-engine/src/display/line_display_shared.rs +++ b/update-engine/src/display/line_display_shared.rs @@ -62,7 +62,7 @@ pub(super) struct LineDisplaySharedContext<'a> { formatter: &'a LineDisplayFormatter, } -impl<'a> LineDisplaySharedContext<'a> { +impl LineDisplaySharedContext<'_> { /// Produces a generic line from the prefix and message. /// /// This line does not have a trailing newline; adding one is the caller's diff --git a/update-engine/src/display/utils.rs b/update-engine/src/display/utils.rs index f026fb6a1c..987002235b 100644 --- a/update-engine/src/display/utils.rs +++ b/update-engine/src/display/utils.rs @@ -128,7 +128,7 @@ impl<'a, S: StepSpec> AbortMessageDisplay<'a, S> { } } -impl<'a, S: StepSpec> fmt::Display for AbortMessageDisplay<'a, S> { +impl fmt::Display for AbortMessageDisplay<'_, S> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self.reason { AbortReason::StepAborted(info) => { diff --git a/update-engine/src/engine.rs b/update-engine/src/engine.rs index 454fd6f343..35c4f1cab1 100644 --- a/update-engine/src/engine.rs +++ b/update-engine/src/engine.rs @@ -437,7 +437,7 @@ pub struct ExecutionHandle<'a, S: StepSpec> { abort_handle: AbortHandle, } -impl<'a, S: StepSpec> ExecutionHandle<'a, S> { +impl ExecutionHandle<'_, S> { /// Aborts this engine execution with a message. /// /// This sends the message immediately, and returns a future that can be @@ -463,7 +463,7 @@ impl<'a, S: StepSpec> ExecutionHandle<'a, S> { } } -impl<'a, S: StepSpec> Future for ExecutionHandle<'a, S> { +impl Future for ExecutionHandle<'_, S> { type Output = Result, ExecutionError>; fn poll( @@ -620,7 +620,7 @@ pub struct NewStep<'engine, 'a, S: StepSpec, T> { metadata_fn: Option>>, } -impl<'engine, 'a, S: StepSpec, T> NewStep<'engine, 'a, S, T> { +impl<'a, S: StepSpec, T> NewStep<'_, 'a, S, T> { /// Adds a metadata-generating function to the step. /// /// This function is expected to produce @@ -854,7 +854,7 @@ struct StepMetadataGen<'a, S: StepSpec> { metadata_fn: Option>>, } -impl<'a, S: StepSpec> StepMetadataGen<'a, S> { +impl StepMetadataGen<'_, S> { fn to_step_info( &self, index: usize, @@ -895,7 +895,7 @@ struct StepExec<'a, S: StepSpec> { exec_fn: DebugIgnore>, } -impl<'a, S: StepSpec> StepExec<'a, S> { +impl StepExec<'_, S> { async fn execute usize>( self, log: &slog::Logger, diff --git a/wicket/src/events.rs b/wicket/src/events.rs index 0e39d131b4..55f28f5acb 100644 --- a/wicket/src/events.rs +++ b/wicket/src/events.rs @@ -75,8 +75,6 @@ impl Event { } } -/// An event that can be recorded. - /// Instructions for the [`crate::Runner`] /// /// Event's fed through the [`crate::Control::on`] methods return an [`Action`] diff --git a/wicket/src/keymap.rs b/wicket/src/keymap.rs index e6b5869448..3a994b6a6c 100644 --- a/wicket/src/keymap.rs +++ b/wicket/src/keymap.rs @@ -34,18 +34,17 @@ pub enum Cmd { /// Collapse the current tree context Collapse, - /// Raw mode directly passes key presses through to the underlying - /// [`crate::Control`]s where the user needs to directly input text. - /// - /// When a user `Select`s a user input an [`crate::Action`] will be - /// returned that establishes Raw mode. When the context is exited, `Raw` - /// mode will be disabled. - /// - /// TODO: This is currently commented out because we need to translate key - /// presses to something we can serialize/deserialize once we decide to use - /// it. - /// Raw(KeyEvent), - + // /// Raw mode directly passes key presses through to the underlying + // /// [`crate::Control`]s where the user needs to directly input text. + // /// + // /// When a user `Select`s a user input an [`crate::Action`] will be + // /// returned that establishes Raw mode. When the context is exited, `Raw` + // /// mode will be disabled. + // + // TODO: This is currently commented out because we need to translate key + // presses to something we can serialize/deserialize once we decide to use + // it. + // Raw(KeyEvent), /// Display details for the given selection /// This can be used to do things like open a scrollable popup for a given /// `Control`. diff --git a/wicket/src/ui/widgets/animated_logo.rs b/wicket/src/ui/widgets/animated_logo.rs index f8919bad1d..c73afb51bc 100644 --- a/wicket/src/ui/widgets/animated_logo.rs +++ b/wicket/src/ui/widgets/animated_logo.rs @@ -34,7 +34,7 @@ pub struct Logo<'a> { // Styling is mandatory! impl<'a> Logo<'a> { - pub fn new(state: &'a LogoState) -> Logo { + pub fn new(state: &'a LogoState) -> Self { Logo { state, stale_style: Style::default(), @@ -58,7 +58,7 @@ impl<'a> Logo<'a> { } } -impl<'a> Widget for Logo<'a> { +impl Widget for Logo<'_> { fn render(self, area: Rect, buf: &mut Buffer) { // Delay painting for 8 frames let paint_point = diff --git a/wicket/src/ui/widgets/popup.rs b/wicket/src/ui/widgets/popup.rs index 8e666ab003..d4b1eef246 100644 --- a/wicket/src/ui/widgets/popup.rs +++ b/wicket/src/ui/widgets/popup.rs @@ -60,7 +60,7 @@ pub struct PopupBuilder<'a> { pub buttons: Vec>, } -impl<'a> PopupBuilder<'a> { +impl PopupBuilder<'_> { /// Builds a non-scrollable popup. pub fn build(&self, full_screen: Rect) -> Popup<'_, NonScrollable> { Popup::new( @@ -297,7 +297,7 @@ impl<'a, S: PopupScrollability> Popup<'a, S> { } } -impl<'a> Popup<'a, Scrollable> { +impl Popup<'_, Scrollable> { /// Returns the effective, or actual, scroll offset after the text is laid /// out, in the form of a `PopupScrollOffset`. /// @@ -388,7 +388,7 @@ pub struct PopupData<'a> { buttons: Vec>, } -impl<'a> PopupData<'a> { +impl PopupData<'_> { pub fn height(&self) -> u16 { let button_height: u16 = if self.buttons.is_empty() { 0 } else { BUTTON_HEIGHT }; diff --git a/wicket/src/ui/widgets/rack.rs b/wicket/src/ui/widgets/rack.rs index 7a69f120c1..19c93951ae 100644 --- a/wicket/src/ui/widgets/rack.rs +++ b/wicket/src/ui/widgets/rack.rs @@ -35,7 +35,7 @@ pub struct Rack<'a> { pub border_selected_style: Style, } -impl<'a> Rack<'a> { +impl Rack<'_> { fn draw_sled(&self, buf: &mut Buffer, sled: Rect, i: u8) { let component_id = ComponentId::Sled(i); let presence = @@ -214,7 +214,7 @@ fn borders(height: u16) -> Borders { } } -impl<'a> Widget for Rack<'a> { +impl Widget for Rack<'_> { fn render(self, rect: Rect, buf: &mut Buffer) { match resize(rect) { ComponentRects::Displayed { rects_map, .. } => { diff --git a/wicket/src/ui/wrap.rs b/wicket/src/ui/wrap.rs index 9cd57d45d5..07fbc68aca 100644 --- a/wicket/src/ui/wrap.rs +++ b/wicket/src/ui/wrap.rs @@ -303,7 +303,7 @@ impl<'a> StyledWord<'a> { } } -impl<'a> Fragment for StyledWord<'a> { +impl Fragment for StyledWord<'_> { fn width(&self) -> f64 { // self.width is the display width, which is what we care about here. self.width as f64 diff --git a/wicketd/src/update_tracker.rs b/wicketd/src/update_tracker.rs index 9241163e61..b1fb5ae326 100644 --- a/wicketd/src/update_tracker.rs +++ b/wicketd/src/update_tracker.rs @@ -442,7 +442,7 @@ struct RealSpawnUpdateDriver<'tr> { } #[async_trait::async_trait] -impl<'tr> SpawnUpdateDriver for RealSpawnUpdateDriver<'tr> { +impl SpawnUpdateDriver for RealSpawnUpdateDriver<'_> { type Setup = watch::Receiver; async fn setup(&mut self, plan: &UpdatePlan) -> Self::Setup { @@ -1755,7 +1755,7 @@ struct UpdateContext { } impl UpdateContext { - async fn process_installinator_reports<'engine>( + async fn process_installinator_reports( &self, cx: &StepContext, mut ipr_receiver: watch::Receiver>, @@ -2035,7 +2035,7 @@ impl UpdateContext { &'a self, available_artifacts: &'a Vec, caboose: Option<&SpComponentCaboose>, - ) -> Result<&ArtifactIdData, UpdateTerminalError> { + ) -> Result<&'a ArtifactIdData, UpdateTerminalError> { let cmpa = match self .mgs_client .sp_rot_cmpa_get( @@ -2913,7 +2913,7 @@ impl<'a> SpComponentUpdateContext<'a> { // Both the active and pending slots should be valid after this spot if let Some(error) = stage0_error { return Err(SpComponentUpdateTerminalError::RotBootloaderError { - error: anyhow!(format!("{error:?}")) + error: anyhow!(format!("{error:?}")) }); } if let Some(error) = stage0next_error {