Simplify the G in Diag<'a, G> - #162630
Conversation
|
HIR ty lowering was modified cc @fmease The parser was modified, potentially altering the grammar of (stable) Rust cc @fmease Some changes occurred in compiler/rustc_attr_parsing cc @jdonszelmann, @JonathanBrouwer The rustc-dev-guide subtree was changed. If your future PRs only touch the subtree, consider submitting them directly to rust-lang/rustc-dev-guide, which is where the document is primarily maintained (and has faster CI). Some changes occurred in match checking cc @Nadrieril Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt
cc @rust-lang/clippy
cc @rust-lang/miri Some changes occurred to constck cc @fee1-dead Some changes occurred to the CTFE machinery Some changes occurred in cc @BoxyUwU |
|
The first two commits here are definite wins. I'm more ambivalent about the third commit: it makes some things better and some things worse and I'm not sure if it's a good idea overall. |
There was a problem hiding this comment.
I was initially a bit sceptical about the third commit, but overall I think it's an improvement. The idea of carrying the emission guarantee as a generic param is nice, but ended up not that useful in practice
@bors r+
|
@bors r- I raced my review with other reviews by not checking that something changed oops |
|
This pull request was unapproved. |
|
@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.
Simplify the `G` in `Diag<'a, G>`
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (ecf783e): 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)Results (primary -0.7%, secondary 2.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 0.6%, secondary -4.7%)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: 494.036s -> 485.329s (-1.76%) |
|
Nice bootstrap wins! |
These can be replaced with `foo(..)`. Also make the return type of `report_unterminated_block_comment` more precise.
It's a trait that is used to give `Diag::emit` different return types depending on the `G` in `Diag<'_, G>`. It works, but it's overkill. There are only four different `G` types in practice (`BugAbort`, `FatalAbort`, `ErrorGuaranteed`, and `()`) and having inherent `emit` methods for each of those four concrete `Diag<'_, G>` types is good enough. This commit makes that change. This removes `EmissionGuarantee` trait bounds from many places, which is nice.
4377560 to
09bf6de
Compare
|
I have repushed without the third commit. I have an idea for also getting rid of the lifetime in Let's recheck perf, just for completeness: @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.
Simplify the `G` in `Diag<'a, G>`
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (da9b623): comparison URL. Overall result: no relevant changes - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (primary -0.7%, secondary 0.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.0%, secondary 0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 492.706s -> 492.567s (-0.03%) |
|
@oli-obk: are you ok with the first two commits? I'll do another PR later with the third commit in it and probably some other stuff. |
View all comments
The
EmissionGuaranteetrait isn't necessary, and just complicates things. Details in individual commits.r? @oli-obk