From e5dac02ef8dffe1179c319f70b1e77745c54a88a Mon Sep 17 00:00:00 2001 From: Lucas Franceschino Date: Thu, 4 Jul 2024 20:57:30 +0200 Subject: [PATCH] fix: kill dependency `const_format` --- Cargo.lock | 28 ---------------------------- cli/driver/Cargo.toml | 1 - cli/driver/src/driver.rs | 5 ++--- cli/subcommands/Cargo.toml | 1 - cli/subcommands/src/cargo_hax.rs | 5 +---- 5 files changed, 3 insertions(+), 37 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c2a963053..fc3e2cff3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -162,7 +162,6 @@ dependencies = [ "cargo_metadata", "clap", "colored", - "const_format", "hax-frontend-exporter", "hax-frontend-exporter-options", "hax-lib-macros-types", @@ -301,26 +300,6 @@ dependencies = [ "windows-sys 0.45.0", ] -[[package]] -name = "const_format" -version = "0.2.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673" -dependencies = [ - "const_format_proc_macros", -] - -[[package]] -name = "const_format_proc_macros" -version = "0.2.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - [[package]] name = "crossterm" version = "0.25.0" @@ -502,7 +481,6 @@ version = "0.1.0-pre.1" dependencies = [ "clap", "colored", - "const_format", "hax-frontend-exporter", "hax-frontend-exporter-options", "hax-lib-macros-types", @@ -1597,12 +1575,6 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - [[package]] name = "utf8parse" version = "0.2.1" diff --git a/cli/driver/Cargo.toml b/cli/driver/Cargo.toml index 52e558ad6..9629f3278 100644 --- a/cli/driver/Cargo.toml +++ b/cli/driver/Cargo.toml @@ -27,7 +27,6 @@ hax-frontend-exporter-options.workspace = true hax-lib-macros-types.workspace = true itertools.workspace = true which.workspace = true -const_format = "0.2" tracing.workspace = true tracing-subscriber.workspace = true tracing-tree.workspace = true diff --git a/cli/driver/src/driver.rs b/cli/driver/src/driver.rs index e576e7bc3..66911e338 100644 --- a/cli/driver/src/driver.rs +++ b/cli/driver/src/driver.rs @@ -36,7 +36,6 @@ mod features; use callbacks_wrapper::*; use features::*; -use const_format::formatcp; use hax_types::cli_options::{BackendOptions, Command, ENV_VAR_OPTIONS_FRONTEND}; use rustc_driver::{Callbacks, Compilation}; @@ -80,11 +79,11 @@ fn main() { setup_logging(); let options: hax_types::cli_options::Options = - serde_json::from_str(&std::env::var(ENV_VAR_OPTIONS_FRONTEND).expect(&formatcp!( + serde_json::from_str(&std::env::var(ENV_VAR_OPTIONS_FRONTEND).expect(&format!( "Cannot find environnement variable {}", ENV_VAR_OPTIONS_FRONTEND ))) - .expect(&formatcp!( + .expect(&format!( "Invalid value for the environnement variable {}", ENV_VAR_OPTIONS_FRONTEND )); diff --git a/cli/subcommands/Cargo.toml b/cli/subcommands/Cargo.toml index e0e026f9f..01cb5f729 100644 --- a/cli/subcommands/Cargo.toml +++ b/cli/subcommands/Cargo.toml @@ -37,7 +37,6 @@ colored.workspace = true is-terminal = "0.4.9" hax-phase-debug-webapp.workspace = true inquire = "0.6" -const_format = "0.2" annotate-snippets.workspace = true serde-jsonlines = "0.5.0" prettyplease = "0.2.20" diff --git a/cli/subcommands/src/cargo_hax.rs b/cli/subcommands/src/cargo_hax.rs index 940253e25..22025712b 100644 --- a/cli/subcommands/src/cargo_hax.rs +++ b/cli/subcommands/src/cargo_hax.rs @@ -74,10 +74,7 @@ fn rustflags() -> String { } const ENGINE_BINARY_NAME: &str = "hax-engine"; -const ENGINE_BINARY_NOT_FOUND: &str = const_format::formatcp!( - "The binary [{}] was not found in your [PATH].", - ENGINE_BINARY_NAME, -); +const ENGINE_BINARY_NOT_FOUND: &str = "The binary [hax-engine] was not found in your [PATH]."; /// Dynamically looks for binary [ENGINE_BINARY_NAME]. First, we /// check whether [HAX_ENGINE_BINARY] is set, and use that if it