Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use std hashmap with "std" feature #1193

Merged
merged 1 commit into from
Mar 13, 2024
Merged

Conversation

DaniPopes
Copy link
Collaborator

@DaniPopes DaniPopes commented Mar 13, 2024

Also caught by -Zcheck-cfg:

warning: unexpected `cfg` condition name: `std`
  --> crates/primitives/src/lib.rs:34:14
   |
34 |     if #[cfg(std)] {
   |              ^^^ help: found config with similar value: `feature = "std"`
   |
   = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows`
   = help: consider using a Cargo feature instead or adding `println!("cargo:rustc-check-cfg=cfg(std)");` to the top of a `build.rs`
   = note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
   = note: `#[warn(unexpected_cfgs)]` on by default

Also caught by `-Zcheck-cfg`:
```
warning: unexpected `cfg` condition name: `std`
  --> crates/primitives/src/lib.rs:34:14
   |
34 |     if #[cfg(std)] {
   |              ^^^ help: found config with similar value: `feature = "std"`
   |
   = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows`
   = help: consider using a Cargo feature instead or adding `println!("cargo:rustc-check-cfg=cfg(std)");` to the top of a `build.rs`
   = note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
   = note: `#[warn(unexpected_cfgs)]` on by default
```
@DaniPopes
Copy link
Collaborator Author

DaniPopes commented Mar 13, 2024

Failures are due to hashmap ordering not being guaranteed. I don't really know how best to fix this @rakita

/// Changes to revert.
///
/// Note: Inside vector is *not* sorted by address.
/// But it is unique by address.
pub reverts: Reverts,

This test fails on main (before this PR) on my machine too

@rakita
Copy link
Member

rakita commented Mar 13, 2024

Let merge this as it is, and will make additional PRs to address the problems. There is test failure and second is clippy

@rakita rakita merged commit 1d5faf0 into bluealloy:main Mar 13, 2024
21 of 25 checks passed
@github-actions github-actions bot mentioned this pull request Mar 13, 2024
@DaniPopes DaniPopes deleted the fix-nostd branch March 13, 2024 23:06
fubuloubu pushed a commit to ApeWorX/revm that referenced this pull request Apr 11, 2024
Also caught by `-Zcheck-cfg`:
```
warning: unexpected `cfg` condition name: `std`
  --> crates/primitives/src/lib.rs:34:14
   |
34 |     if #[cfg(std)] {
   |              ^^^ help: found config with similar value: `feature = "std"`
   |
   = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `unix`, `windows`
   = help: consider using a Cargo feature instead or adding `println!("cargo:rustc-check-cfg=cfg(std)");` to the top of a `build.rs`
   = note: see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration
   = note: `#[warn(unexpected_cfgs)]` on by default
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants