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).
This comment has been minimized.
This comment has been minimized.
f9e14ed to
ddf93f4
Compare
|
Sorry, more rebase churn... ready now |
|
@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 (60a91bc): 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 (secondary -0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.2%, secondary -1.2%)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: 490.365s -> 493.578s (0.66%) |
|
I've added one more tweak and that's all I can think to do. I think this is ready to merge. Maybe run |
|
@bors try |
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 (c24ec80): comparison URL. Overall result: ❌ regressions - 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. CyclesThis perf run didn't have relevant results for this metric. Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: missing data |
|
No change. |
|
@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. |
|
☔ The latest upstream changes (presumably #164256) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
View all comments
TypeFoldable::fold_withdelegates toTypeFoldable::try_fold_withwith an infallible error type.