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

refactor: no_std rustc_hash::{FxHashMap, FxHashSet} aliases #9975

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

JonasKruckenberg
Copy link
Contributor

As part of no_std support in cranelift this PR fixes the usage of rustc_hash::{FxHashMap, FxHashSet} which are not exported on no_std targets. It adds type aliases to lib.rs similar to the already existing std::collections::HashMap alias.

@JonasKruckenberg JonasKruckenberg requested a review from a team as a code owner January 10, 2025 12:40
@JonasKruckenberg JonasKruckenberg requested review from cfallin and removed request for a team January 10, 2025 12:40
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:machinst Issues related to instruction selection and the new MachInst backend. labels Jan 10, 2025
Copy link
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM modulo some potential dead code below.

use smallvec::{smallvec, SmallVec};

#[cfg(not(feature = "std"))]
use crate::fx::FxHasher;
use rustc_hash::FxHasher;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like FxHasher or Hasher are used anywhere in this module, and they aren't exported -- can we remove them instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift:area:machinst Issues related to instruction selection and the new MachInst backend. cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants