Make exhaustiveness usable outside of rustc#118842
Conversation
|
The list of allowed third-party dependencies may have been modified! You must ensure that any new dependencies have compatible licenses before merging. These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
|
|
|
Bracing myself for perf sadness @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Make exhaustiveness usable outside of rustc With this PR, `rustc_pattern_analysis` compiles on stable (with the `stable` feature)! `rust-analyzer` will be able to use it to provide match-related diagnostics and refactors. Two questions: - Should I name the feature `nightly` instead of `rustc` for consistency with other crates? `rustc` makes more sense imo. - `typed-arena` is an optional dependency but tidy made me add it to the allow-list anyway. Can I avoid that somehow? r? `@compiler-errors`
|
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (6c25005): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 672.051s -> 672.417s (0.05%) |
ce45b48 to
a6a944d
Compare
a6a944d to
3016c29
Compare
|
I will review this on Monday probably |
compiler-errors
left a comment
There was a problem hiding this comment.
Please address these in a follow-up commit
| /// Context that provides type information about constructors. | ||
| /// | ||
| /// Most of the crate is parameterized on a type that implements this trait. | ||
| pub trait TypeCx: Sized + Clone + fmt::Debug { |
There was a problem hiding this comment.
You shouldn't need a Clone supertrait here.
| } | ||
|
|
||
| /// Context that provides information global to a match. | ||
| #[derive(Clone)] |
There was a problem hiding this comment.
you can use derivative like rustc_type_ir to avoid needing to 1. manual Copy impl and 2. Clone that requires Cx: Clone.
There was a problem hiding this comment.
Oh nice I didn't know we used derivative
|
@bors r+ |
|
@bors rollup=never |
| #[cfg(feature = "nightly")] | ||
| let mut words = { | ||
| // We take some effort to avoid copying the words. | ||
| let words = Rc::<[Word; CHUNK_WORDS]>::new_zeroed(); |
There was a problem hiding this comment.
does this deserve a TODO that points to a tracking issue?
There was a problem hiding this comment.
@Nadrieril should add this to a follow-up PR if it matters.
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (3a539c0): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 671.842s -> 673.86s (0.30%) |
…r=compiler-errors Exhaustiveness: clean up after librarification This cleans up some things that weren't done nicely by rust-lang#118842. r? `@compiler-errors`
Rollup merge of rust-lang#119230 - Nadrieril:librarify-even-further, r=compiler-errors Exhaustiveness: clean up after librarification This cleans up some things that weren't done nicely by rust-lang#118842. r? `@compiler-errors`
…r-errors Exhaustiveness: clean up after librarification This cleans up some things that weren't done nicely by rust-lang/rust#118842. r? `@compiler-errors`
|
Small regression to a single stress test benchmark. Worth the librarification effort, I don't think that we need to dive further into this. @rustbot label: +perf-regression-triaged |
With this PR,
rustc_pattern_analysiscompiles on stable (with thestablefeature)!rust-analyzerwill be able to use it to provide match-related diagnostics and refactors.Two questions:
nightlyinstead ofrustcfor consistency with other crates?rustcmakes more sense imo.typed-arenais an optional dependency but tidy made me add it to the allow-list anyway. Can I avoid that somehow?r? @compiler-errors