-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split some functions with many arguments into builder pattern functions #114054
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @estebank (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt |
This comment has been minimized.
This comment has been minimized.
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 8d7b358a11ca0ccdd1fb8c184f3f3a8dec75ea8f with merge 9440ad6c48d595f71c9f4ac67f3ed9f3bba31321... |
This comment has been minimized.
This comment has been minimized.
compiler/rustc_expand/src/tests.rs
Outdated
let handler = Handler::with_emitter(true, None, Box::new(emitter), None); | ||
let emitter = | ||
EmitterWriter::new(Box::new(Shared { data: output.clone() }), fallback_bundle, false) | ||
.sm(Some(source_map.clone())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surprised that .sm(Some(source_map))
is needed here, instead of .sm(source_map)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The macro supports this, but most of the callers actually provide an Option
, so this is a tradeoff unless we wanna go generic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, r=me after you're done with timer
compiler/rustc_errors/src/emitter.rs
Outdated
pub struct EmitterWriter { | ||
#[setters(skip)] | ||
dst: Destination, | ||
sm: Option<Lrc<SourceMap>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re: my other comment, we can use #[setters(strip_option)]
here.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
ugh. in-tree rustfmt requires formatting, but doesn't get formatted with |
yep, it's a consequence that's part of the tradeoffs of moving tools (including rustfmt) to subtrees, and this repo continuing the model of being pinned to an older version of rustfmt vs. using in-tree rustfmt. more discussion in #90672 |
Finished benchmarking commit (9440ad6c48d595f71c9f4ac67f3ed9f3bba31321): comparison URL. Overall result: ✅ improvements - no 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. @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.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 651.438s -> 651.998s (0.09%) |
…ly built in-tree version
@bors r=estebank |
☀️ Test successful - checks-actions |
Finished benchmarking commit (52bdc37): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. 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: 652.439s -> 650.097s (-0.36%) |
@@ -430,6 +430,10 @@ impl Step for Rustfmt { | |||
&[], | |||
); | |||
|
|||
if builder.config.cmd.bless() { | |||
cargo.env("BLESS", "1"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oli-obk - This seems reasonable to me, though I'd like to change the var name to be a little more explicit (perhaps something like RUSTC_BLESS
?) so that it's somewhat more explicit especially when working with rustfmt out of tree.
Wanted to make sure you didn't have any objections or alternative naming suggestions before I opened a PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is currently being worked on in #113298
Split some functions with many arguments into builder pattern functions r? `@estebank` This doesn't resolve all of the ones in rustc, mostly because I need to do other cleanups in order to be able to use some builder derives from crates.io Works around rust-lang#90672 by making `x test rustfmt --bless` format itself instead of testing that it is formatted
r? @estebank
This doesn't resolve all of the ones in rustc, mostly because I need to do other cleanups in order to be able to use some builder derives from crates.io
Works around #90672 by making
x test rustfmt --bless
format itself instead of testing that it is formatted