Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Various `ObligationForest` improvements #64500
This commit removes the custom index implementation of `NodeIndex`, which probably predates `newtype_index!`. As well as eliminating code, it improves the debugging experience, because the custom implementation had the property of being incremented by 1 (so it could use `NonZeroU32`), which was incredibly confusing if you didn't expect it. For some reason, I also had to remove an `unsafe` block marker from `from_u32_unchecked()` that the compiler said was now unnecessary.
This makes the code a little faster, presumably because bounds checks aren't needed on `nodes` accesses. It requires making `scratch` a `RefCell`, which is not unreasonable.
Rollup of 6 pull requests Successful merges: - #64085 (Tweak unsatisfied HRTB errors) - #64380 (Update bundled OpenSSL to 1.1.1d) - #64416 (Various refactorings to clean up nll diagnostics) - #64500 (Various `ObligationForest` improvements) - #64530 (Elide lifetimes in `Pin<&(mut) Self>`) - #64531 (Use shorthand syntax in the self parameter of methods of Pin) Failed merges: r? @ghost
Thank you for the fast review.
BTW, this code can be very hot and parts of it are very perf-sensitive to change. Here is a list of other ways I tried to speed up or clean up