-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
rustfmt subtree update #126842
rustfmt subtree update #126842
Conversation
It's the same as `Delimiter`, minus the `Invisible` variant. I'm generally in favour of using types to make impossible states unrepresentable, but this one feels very low-value, and the conversions between the two types are annoying and confusing. Look at the change in `src/tools/rustfmt/src/expr.rs` for an example: the old code converted from `MacDelimiter` to `Delimiter` and back again, for no good reason. This suggests the author was confused about the types.
…bank Suggests turbofish in patterns Fixes rust-lang#114112 r? ```@estebank```
Indexing is similar to method calls in having an arbitrary left-hand-side and then something on the right, which is the main part of the expression. Method calls already have a span for that right part, but indexing does not. This means that long method chains that use indexing have really bad spans, especially when the indexing panics and that span in coverted into a panic location. This does the same thing as method calls for the AST and HIR, storing an extra span which is then put into the `fn_span` field in THIR.
Lots of tiny incremental simplifications of `EmitterWriter` internals ignore the first commit, it's rust-lang#114088 squashed and rebased, but it's needed to use to use `derive_setters`, as they need a newer `syn` version. Then this PR starts out with removing many arguments that are almost always defaulted to `None` or `false` and replace them with builder methods that can set these fields in the few cases that want to set them. After that it's one commit after the other that removes or merges things until everything becomes some very simple trait objects
Improve spans for indexing expressions fixes rust-lang#114388 Indexing is similar to method calls in having an arbitrary left-hand-side and then something on the right, which is the main part of the expression. Method calls already have a span for that right part, but indexing does not. This means that long method chains that use indexing have really bad spans, especially when the indexing panics and that span in coverted into a panic location. This does the same thing as method calls for the AST and HIR, storing an extra span which is then put into the `fn_span` field in THIR. r? compiler-errors
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#113945 (Fix wrong span for trait selection failure error reporting) - rust-lang#114351 ([rustc_span][perf] Remove unnecessary string joins and allocs.) - rust-lang#114418 (bump parking_lot to 0.12) - rust-lang#114434 (Improve spans for indexing expressions) - rust-lang#114450 (Fix ICE failed to get layout for ReferencesError) - rust-lang#114461 (Fix unwrap on None) - rust-lang#114462 (interpret: add mplace_to_ref helper method) - rust-lang#114472 (Reword `confusable_idents` lint) - rust-lang#114477 (Account for `Rc` and `Arc` when suggesting to clone) r? `@ghost` `@rustbot` modify labels: rollup
Anonymous structs or unions are only allowed in struct field definitions. Co-authored-by: carbotaniuman <[email protected]>
report `unused_import` for empty reexports even it is pub Fixes rust-lang#116032 An easy fix. r? `@petrochenkov` (Discovered this issue while reviewing rust-lang#115993.)
…ce_style Fixes 5912 When `control_brace_style = "AlwaysNextLine"`, the code seems to always assume that `body_prefix` is `{`. This is however not the case when `match_arm_blocks = false`. This causes `block_sep` to introduce extra white space that causes the error. The fix was to check if `body_prefix` is empty before matching on `ControlBraceStyle::AlwaysNextLine`.
These changes mostly improve logging out the cargo version and version of the two rustfmt binaries that are compiled. Some other minor logging changes were made as well to add some whitespace to improve visual clarity when looking at the logs in the GitHub Actions console.
rustfmt currently has a runtime dependency on the sysroot. So when we build a standalone rustfmt binary we need to set `LD_LIBRARY_PATH` so each rustfmt binary knows where to find it's dependencies. When running our Diff-Check job to test PRs for breaking changes it's often the case that both the master rustfmt binary and the feature branch binary have the same runtime dependencies so we only need to set `LD_LIBRARY_PATH` once. However, when running the diff-check job against a subtree sync PR that assumption doesn't hold. The subtree sync PR bumps the required toolchain used to build rustfmt and therefore the binary that gets built for the subtree sync PR has a different runtime dependency than the master rustfmt binary. Now we set `LD_LIBRARY_PATH` twice to account for this potential difference.
Because the API for `with_position` improved in 0.11 and I want to use it.
- Rename them both `as_str`, which is the typical name for a function that returns a `&str`. (`to_string` is appropriate for functions returning `String` or maybe `Cow<'a, str>`.) - Change `UnOp::as_str` from an associated function (weird!) to a method. - Avoid needless `self` dereferences.
…r=compiler-errors Add `never_patterns` feature gate This PR adds the feature gate and most basic parsing for the experimental `never_patterns` feature. See the tracking issue (rust-lang#118155) for details on the experiment. `@scottmcm` has agreed to be my lang-team liaison for this experiment.
Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
@bors delegate=ytmimi |
✌️ @ytmimi, you can now approve this pull request! If @calebcartwright told you to " |
@ytmimi - gave you access to approve this in case you see the CI checks all passing before me. if you do, i'd suggest something like the below command to give bors the go ahead: " |
@bors r- |
I was today years old when I learned bors will even respond to commands within quoted code blocks 😆 |
@bors r+ p=1 rollup=never |
☀️ Test successful - checks-actions |
Finished benchmarking commit (acb6273): 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)Results (primary -2.2%)This 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 sizeResults (secondary -0.3%)This 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: 691.006s -> 691.822s (0.12%) |
r? ghost