Skip to content

Commit 2feb784

Browse files
authored
Merge pull request #5045 from jbencin/fix/1.80-warnings
fix: Rust 1.80 warnings
2 parents 4867505 + d64e443 commit 2feb784

File tree

8 files changed

+24
-22
lines changed

8 files changed

+24
-22
lines changed

clarity/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,5 @@ developer-mode = ["stacks_common/developer-mode"]
5555
slog_json = ["stacks_common/slog_json"]
5656
testing = ["canonical"]
5757
devtools = []
58+
rollback_value_check = []
59+
disable-costs = []

clarity/src/vm/database/key_value_wrapper.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,23 @@ use crate::vm::types::{
3131
};
3232
use crate::vm::{StacksEpoch, Value};
3333

34-
#[cfg(rollback_value_check)]
34+
#[cfg(feature = "rollback_value_check")]
3535
type RollbackValueCheck = String;
36-
#[cfg(not(rollback_value_check))]
36+
#[cfg(not(feature = "rollback_value_check"))]
3737
type RollbackValueCheck = ();
3838

39-
#[cfg(not(rollback_value_check))]
39+
#[cfg(not(feature = "rollback_value_check"))]
4040
fn rollback_value_check(_value: &str, _check: &RollbackValueCheck) {}
4141

42-
#[cfg(not(rollback_value_check))]
42+
#[cfg(not(feature = "rollback_value_check"))]
4343
fn rollback_edits_push<T>(edits: &mut Vec<(T, RollbackValueCheck)>, key: T, _value: &str) {
4444
edits.push((key, ()));
4545
}
4646
// this function is used to check the lookup map when committing at the "bottom" of the
4747
// wrapper -- i.e., when committing to the underlying store. for the _unchecked_ implementation
4848
// this is used to get the edit _value_ out of the lookupmap, for used in the subsequent `put_all`
4949
// command.
50-
#[cfg(not(rollback_value_check))]
50+
#[cfg(not(feature = "rollback_value_check"))]
5151
fn rollback_check_pre_bottom_commit<T>(
5252
edits: Vec<(T, RollbackValueCheck)>,
5353
lookup_map: &mut HashMap<T, Vec<String>>,
@@ -71,11 +71,11 @@ where
7171
output
7272
}
7373

74-
#[cfg(rollback_value_check)]
74+
#[cfg(feature = "rollback_value_check")]
7575
fn rollback_value_check(value: &String, check: &RollbackValueCheck) {
7676
assert_eq!(value, check)
7777
}
78-
#[cfg(rollback_value_check)]
78+
#[cfg(feature = "rollback_value_check")]
7979
fn rollback_edits_push<T>(edits: &mut Vec<(T, RollbackValueCheck)>, key: T, value: &String)
8080
where
8181
T: Eq + Hash + Clone,
@@ -84,7 +84,7 @@ where
8484
}
8585
// this function is used to check the lookup map when committing at the "bottom" of the
8686
// wrapper -- i.e., when committing to the underlying store.
87-
#[cfg(rollback_value_check)]
87+
#[cfg(feature = "rollback_value_check")]
8888
fn rollback_check_pre_bottom_commit<T>(
8989
edits: Vec<(T, RollbackValueCheck)>,
9090
lookup_map: &mut HashMap<T, Vec<String>>,

stacks-common/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ canonical = ["rusqlite"]
7575
developer-mode = []
7676
slog_json = ["slog-json"]
7777
testing = ["canonical"]
78+
serde = []
79+
bech32_std = []
80+
bech32_strict = []
7881

7982
[target.'cfg(all(any(target_arch = "x86_64", target_arch = "x86", target_arch = "aarch64"), not(any(target_os="windows"))))'.dependencies]
8083
sha2 = { version = "0.10", features = ["asm"] }

stacks-common/src/deps_common/bech32/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
//! has more details.
3131
//!
3232
#![cfg_attr(
33-
feature = "std",
33+
feature = "bech32_std",
3434
doc = "
3535
# Examples
3636
```
@@ -54,20 +54,20 @@ assert_eq!(variant, Variant::Bech32);
5454
#![deny(non_camel_case_types)]
5555
#![deny(non_snake_case)]
5656
#![deny(unused_mut)]
57-
#![cfg_attr(feature = "strict", deny(warnings))]
57+
#![cfg_attr(feature = "bech32_strict", deny(warnings))]
5858

59-
#[cfg(all(not(feature = "std"), not(test)))]
59+
#[cfg(all(not(feature = "bech32_std"), not(test)))]
6060
extern crate alloc;
6161

62-
#[cfg(any(test, feature = "std"))]
62+
#[cfg(any(test, feature = "bech32_std"))]
6363
extern crate core;
6464

65-
#[cfg(all(not(feature = "std"), not(test)))]
65+
#[cfg(all(not(feature = "bech32_std"), not(test)))]
6666
use alloc::borrow::Cow;
67-
#[cfg(all(not(feature = "std"), not(test)))]
67+
#[cfg(all(not(feature = "bech32_std"), not(test)))]
6868
use alloc::{string::String, vec::Vec};
6969
use core::{fmt, mem};
70-
#[cfg(any(feature = "std", test))]
70+
#[cfg(any(feature = "bech32_std", test))]
7171
use std::borrow::Cow;
7272

7373
/// Integer in the range `0..32`
@@ -690,7 +690,7 @@ impl fmt::Display for Error {
690690
}
691691
}
692692

693-
#[cfg(any(feature = "std", test))]
693+
#[cfg(any(feature = "bech32_std", test))]
694694
impl std::error::Error for Error {
695695
fn description(&self) -> &str {
696696
match *self {

stacks-common/src/deps_common/bitcoin/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
//!
2727
2828
// Clippy flags
29-
#![cfg_attr(feature = "clippy", allow(needless_range_loop))] // suggests making a big mess of array newtypes
30-
#![cfg_attr(feature = "clippy", allow(extend_from_slice))] // `extend_from_slice` only available since 1.6
29+
#![allow(clippy::needless_range_loop)] // suggests making a big mess of array newtypes
30+
#![allow(clippy::extend_from_slice)] // `extend_from_slice` only available since 1.6
3131

3232
// Coding conventions
3333
#![deny(non_upper_case_globals)]

stacks-common/src/deps_common/httparse/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#![cfg_attr(test, deny(warnings))]
2323
// we can't upgrade while supporting Rust 1.3
2424
#![allow(deprecated)]
25-
#![cfg_attr(httparse_min_2018, allow(rust_2018_idioms))]
2625

2726
//! # httparse
2827
//!

stackslib/src/clarity_cli.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ macro_rules! panic_test {
106106
};
107107
}
108108

109-
#[cfg_attr(tarpaulin, skip)]
110109
fn print_usage(invoked_by: &str) {
111110
eprintln!(
112111
"Usage: {} [command]
@@ -129,15 +128,13 @@ where command is one of:
129128
panic_test!()
130129
}
131130

132-
#[cfg_attr(tarpaulin, skip)]
133131
fn friendly_expect<A, B: std::fmt::Display>(input: Result<A, B>, msg: &str) -> A {
134132
input.unwrap_or_else(|e| {
135133
eprintln!("{}\nCaused by: {}", msg, e);
136134
panic_test!();
137135
})
138136
}
139137

140-
#[cfg_attr(tarpaulin, skip)]
141138
fn friendly_expect_opt<A>(input: Option<A>, msg: &str) -> A {
142139
input.unwrap_or_else(|| {
143140
eprintln!("{}", msg);

testnet/stacks-node/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,4 @@ monitoring_prom = ["stacks/monitoring_prom", "libsigner/monitoring_prom", "stack
6363
slog_json = ["stacks/slog_json", "stacks-common/slog_json", "clarity/slog_json"]
6464
prod-genesis-chainstate = []
6565
default = []
66+
testing = []

0 commit comments

Comments
 (0)