Update rustc-hash to version 2
This brings in the new optimized algorithm that was shown to have small performance benefits for rustc. I haven't run the rust-analyzer benchmarks.
See https://github.com/rust-lang/rustc-hash/pull/37.
oh lord, it looks like something relies on the iteration order or something like that :3.
Yup, the iteration here calls a mutating callback and the state there seems to be iteration dependent (sorting the iterator by key causes the same issue on master) https://github.com/rust-lang/rust-analyzer/blob/1271dff610719930bb2cf20206057e57201d2528/crates/hir-ty/src/lib.rs#L249
The funny thing is, that test apparently should succeed given rustc is fine with it?
pub enum TagTree {
Leaf,
Choice(&'static [TagTree]),
}
const GOAL: TagTree = {
const TAG_TREE: TagTree = TagTree::Choice(&[
{
const VARIANT_TAG_TREE: TagTree = TagTree::Choice(
&[
TagTree::Leaf,
],
);
VARIANT_TAG_TREE
},
]);
TAG_TREE
};
```
compiles just fine, yet the test errors on master
Naively I'd say, lets replace the FxHashMap at https://github.com/rust-lang/rust-analyzer/blob/191949eabe87ce71cc120e56af7b791da011a9c8/crates/hir-ty/src/lib.rs#L199 with an FxIndexMap and change the expected test output to success (if that change makes it succeed)
The test looks strange. I guess it meant to do recursive constants, something like this:
pub enum TagTree {
Leaf,
Choice(&'static [TagTree]),
}
const GOAL: TagTree = {
const TAG_TREE: TagTree = TagTree::Choice(&[
{
const VARIANT_TAG_TREE: TagTree = TagTree::Choice(
&[
TAG_TREE,
],
);
VARIANT_TAG_TREE
},
]);
TAG_TREE
};
The failure of the original test clearly is a bug. It should work with any order of execution, and sorting or using an stable iteration order does not fix the underlying problem. I would suggest changing the test to use an actual recursive constant like the code above, and opening an issue for that bug for further investigation.
@bors r+
:pushpin: Commit 6a78851cb825581c5adb18017a1b46aeaa7d50cb has been approved by Veykril
It is now in the queue for this repository.
:hourglass: Testing commit 6a78851cb825581c5adb18017a1b46aeaa7d50cb with merge aee8b45e4d2fb67b0b2458dfea32fcc329164fa0...
:broken_heart: Test failed - checks-actions
:umbrella: The latest upstream changes (presumably #18151) made this pull request unmergeable. Please resolve the merge conflicts.
Okay let's see what breaks @bors r+
:pushpin: Commit 8be3b80ee1258307a90d4086ef904f6388090c0b has been approved by Veykril
It is now in the queue for this repository.
:hourglass: Testing commit 8be3b80ee1258307a90d4086ef904f6388090c0b with merge 102a3b1ce4008bd23a8a54d55f948128e78c237f...
:broken_heart: Test failed - checks-actions
@bors r+
:pushpin: Commit 02e189dcb54b17f607a8f66f79e0932e82a0a859 has been approved by Veykril
It is now in the queue for this repository.
:hourglass: Testing commit 02e189dcb54b17f607a8f66f79e0932e82a0a859 with merge fb832ff2ba338105dda1c8172f89d580cb0a570f...
:sunny: Test successful - checks-actions Approved by: Veykril Pushing fb832ff2ba338105dda1c8172f89d580cb0a570f to master...
nice!