-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
refactor rustc-hash integration #150353
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
base: main
Are you sure you want to change the base?
refactor rustc-hash integration #150353
Conversation
|
Some changes occurred in exhaustiveness checking cc @Nadrieril These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
| rustc-hash = "2.0.0" | ||
| rustc_ast_ir = { path = "../rustc_ast_ir", default-features = false } | ||
| rustc_data_structures = { path = "../rustc_data_structures", optional = true } | ||
| rustc_data_structures = { path = "../rustc_data_structures" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rustc_data_structures doesn't compile on stable, but rustc_type_ir needs to support stable for rust-analyzer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why doesn't it compile on stable, though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Among other things it uses #[may_dangle] for arenas, enables the nightly feature of hashbrown, uses rustc_macros (which needs feature(proc_macro_diagnostics, proc_macro_tracked_env)), rustc_serialize (which needs specialization) and it uses a whole bunch more unstable features:
rust/compiler/rustc_data_structures/src/lib.rs
Lines 15 to 36 in 24ac030
| #![feature(allocator_api)] | |
| #![feature(ascii_char)] | |
| #![feature(ascii_char_variants)] | |
| #![feature(assert_matches)] | |
| #![feature(auto_traits)] | |
| #![feature(cfg_select)] | |
| #![feature(core_intrinsics)] | |
| #![feature(dropck_eyepatch)] | |
| #![feature(extend_one)] | |
| #![feature(file_buffered)] | |
| #![feature(map_try_insert)] | |
| #![feature(min_specialization)] | |
| #![feature(negative_impls)] | |
| #![feature(never_type)] | |
| #![feature(ptr_alignment_type)] | |
| #![feature(rustc_attrs)] | |
| #![feature(sized_hierarchy)] | |
| #![feature(test)] | |
| #![feature(thread_id_value)] | |
| #![feature(trusted_len)] | |
| #![feature(type_alias_impl_trait)] | |
| #![feature(unwrap_infallible)] |
| use rustc_data_structures::fx::{FxHashMap, FxHashSet}; | ||
| use rustc_data_structures::stack::ensure_sufficient_stack; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This too breaks the way compilation on stable is handled.
|
The job Click to see the possible cause of the failure (guessed by this bot)For more information how to resolve CI failures of this job, visit this link. |
I found that rustc-hash is used in multiple compiler crates. Also some types use
FxBuildHasherwhereas others useBuildHasherDefault<FxHasher>(both do the same thing).In order to simplify future hashing experiments, I changed every location to use
rustc_data_structures::fx::*types instead, and also removed theBuildHasherDefaultvariant. This will simplify future experiments with hashing (for example trying out a hasher that doesn't implementDefaultfor whatever reason).