Skip to content

Commit

Permalink
update to Rust 1.82.0 (#6949)
Browse files Browse the repository at this point in the history
  • Loading branch information
iliana authored Oct 29, 2024
1 parent dbd69a2 commit d4263cb
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 19 deletions.
4 changes: 2 additions & 2 deletions nexus/db-queries/src/db/on_conflict_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ pub trait IncompleteOnConflictExt {
/// _logically implies_ the condition on the partial index. With something
/// like `time_deleted IS NULL` the value of that is not exactly clear, but
/// you can imagine a partial index on something like `col >= 10`, and
/// write `ON CONFLICT (...) WHERE col >= 20`. This is allowed because `col
/// >= 20` implies `col >= 10`. (But `WHERE col >= 5` is not allowed.)
/// write `ON CONFLICT (...) WHERE col >= 20`. This is allowed because
/// `col >= 20` implies `col >= 10`. (But `WHERE col >= 5` is not allowed.)
///
/// ## 4. A similar syntax with a different meaning
///
Expand Down
3 changes: 1 addition & 2 deletions nexus/db-queries/src/db/pool_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,13 @@ impl backend::Connector for DieselPgConnector {
})
.await
.expect("Task panicked establishing connection")
.map_err(|e| {
.inspect_err(|e| {
warn!(
self.log,
"Failed to make connection";
"error" => e.to_string(),
"backend" => backend.address,
);
e
})?;
Ok(conn)
}
Expand Down
11 changes: 5 additions & 6 deletions oximeter/db/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1185,17 +1185,16 @@ impl Client {
})?;

// Convert the HTTP response into a database response.
let response = handle_db_response(response).await.map_err(|err| {
probes::sql__query__done!(|| (&id));
err
})?;
let response =
handle_db_response(response).await.inspect_err(|_| {
probes::sql__query__done!(|| (&id));
})?;

// Extract the query summary, measuring resource usage and duration.
let summary =
QuerySummary::from_headers(start.elapsed(), response.headers())
.map_err(|err| {
.inspect_err(|_| {
probes::sql__query__done!(|| (&id));
err
})?;

// Extract the actual text of the response.
Expand Down
2 changes: 1 addition & 1 deletion oximeter/types/src/histogram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ where
let lo = base.pow(lo as _);
let hi = base.pow(hi as _);
let distance = hi - lo;
distance.is_multiple_of(&count)
Integer::is_multiple_of(&distance, &count)
})
}

Expand Down
6 changes: 2 additions & 4 deletions package/src/bin/omicron-package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1069,22 +1069,20 @@ async fn main() -> Result<()> {
let get_config = || -> Result<Config> {
let target_path = args.artifact_dir.join("target").join(&args.target);
let raw_target =
std::fs::read_to_string(&target_path).map_err(|e| {
std::fs::read_to_string(&target_path).inspect_err(|_| {
eprintln!(
"Failed to read build target: {}\n{}",
target_path,
target_help_str()
);
e
})?;
let target: Target = KnownTarget::from_str(&raw_target)
.map_err(|e| {
.inspect_err(|_| {
eprintln!(
"Failed to parse {} as target\n{}",
target_path,
target_help_str()
);
e
})?
.into();
debug!(log, "target[{}]: {:?}", args.target, target);
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[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.
channel = "1.80.1"
channel = "1.82.0"
profile = "default"
6 changes: 3 additions & 3 deletions sled-agent/src/instance_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl InstanceManager {
.tx
.send(InstanceManagerRequest::EnsureRegistered {
propolis_id,
instance,
instance: Box::new(instance),
sled_identifiers: Box::new(sled_identifiers),
tx,
})
Expand Down Expand Up @@ -335,12 +335,12 @@ impl InstanceManager {
enum InstanceManagerRequest {
EnsureRegistered {
propolis_id: PropolisUuid,
instance: InstanceEnsureBody,
// These are boxed because they are, apparently, quite large, and Clippy
// whinges about the overall size of this variant relative to the
// others. Since we will generally send `EnsureRegistered` requests much
// less frequently than most of the others, boxing this seems like a
// reasonable choice...
instance: Box<InstanceEnsureBody>,
sled_identifiers: Box<SledIdentifiers>,
tx: oneshot::Sender<Result<SledVmmState, Error>>,
},
Expand Down Expand Up @@ -462,7 +462,7 @@ impl InstanceManagerRunner {
sled_identifiers,
tx,
}) => {
tx.send(self.ensure_registered(propolis_id, instance, *sled_identifiers).await).map_err(|_| Error::FailedSendClientClosed)
tx.send(self.ensure_registered(propolis_id, *instance, *sled_identifiers).await).map_err(|_| Error::FailedSendClientClosed)
},
Some(EnsureUnregistered { propolis_id, tx }) => {
self.ensure_unregistered(tx, propolis_id)
Expand Down
1 change: 1 addition & 0 deletions workspace-hack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[package]
name = "omicron-workspace-hack"
version = "0.1.0"
edition = "2021"
description = "workspace-hack package, managed by hakari"
# You can choose to publish this crate: see https://docs.rs/cargo-hakari/latest/cargo_hakari/publishing.
publish = false
Expand Down

0 comments on commit d4263cb

Please sign in to comment.