Repository navigation
Add default to TypeFoldable::fold_with - #159584
camsteffen wants to merge 3 commits into
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
23af8de to
a915f8c
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| /// infallible folders. Do not override this method, to ensure coherence | ||
| /// with `try_super_fold_with`. | ||
| fn super_fold_with<F: TypeFolder<I>>(self, folder: &mut F) -> Self; | ||
| fn super_fold_with<F: TypeFolder<I>>(self, folder: &mut F) -> Self { |
There was a problem hiding this comment.
Did you test #[inline] on it locally?
There was a problem hiding this comment.
I didn't test locally. Added #[inline] here and also to the new struct methods. Wanna try another perf run?
| /// infallible folders. Do not override this method, to ensure coherence | ||
| /// with `try_super_fold_with`. | ||
| fn super_fold_with<F: TypeFolder<I>>(self, folder: &mut F) -> Self; | ||
| fn super_fold_with<F: TypeFolder<I>>(self, folder: &mut F) -> Self { |
a915f8c to
12bd193
Compare
This comment has been minimized.
This comment has been minimized.
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Add default to `TypeFoldable::fold_with`
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (72fafa6): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never rustc-perf Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)This perf run didn't have relevant results for this metric. CyclesResults (primary 7.2%, secondary 8.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 469.882s -> 474.787s (1.04%) |
80eb019 to
14eda03
Compare
| @@ -94,7 +94,19 @@ pub trait TypeFoldable<I: Interner>: TypeVisitable<I> + Clone { | |||
| /// | |||
| /// Same as [`TypeFoldable::try_fold_with`], but not fallible. Make sure to keep | |||
| /// the behavior in sync across functions. | |||
There was a problem hiding this comment.
I should probably delete this sentence.
| /// the behavior in sync across functions. | ||
| fn fold_with<F: TypeFolder<I>>(self, folder: &mut F) -> Self; | ||
| #[inline] | ||
| #[cfg(feature = "nightly")] // for `final` |
There was a problem hiding this comment.
That's not sufficient unfortunately. final like all recent unstable syntax is gated pre-expansion, meaning this will still lead to a feature gate error if feature = "nightly" is not set.
Since we're now building+testing (a subset of?) rust-analyzer in CI (which uses the stable version of this crate), this should also manifest itself as a CI failure soon IINM.
In https://github.com/rust-lang/rust/pull/159584/changes#r3838787968 I did indeed mean "identity macro" (cf. first part of #154045's description).
|
@fmease Do you think this is okay to merge? I think the last full perf run will be representative. The regression is basically isolated to wf-projection-stress-65510, a secondary test. |
This comment has been minimized.
This comment has been minimized.
9ddd09c to
179728d
Compare
This comment has been minimized.
This comment has been minimized.
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Add default to `TypeFoldable::fold_with`
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (11fc96c): comparison URL. Overall result: ❌✅ regressions and improvements - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never rustc-perf Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 0.2%, secondary 0.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -0.5%, secondary 0.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 488.459s -> 494.293s (1.19%) |
This comment has been minimized.
This comment has been minimized.
179728d to
ed13b62
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
Dropped that commit. Again re-perf'ing what we've already perf'ed twice some time ago for one final time but then I agree it's probably okay to merge. @bors try @rust-timer queue |
|
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
|
⌛ Trying commit ed13b62 with merge 2929d3f… To cancel the try build, run the command Workflow: https://github.com/rust-lang/rust/actions/runs/41354173213 |
Add default to `TypeFoldable::fold_with`
View all comments
TypeFoldable::fold_withdelegates toTypeFoldable::try_fold_withwith an infallible error type.