-
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
Sync rustfmt subtree #95458
Sync rustfmt subtree #95458
Commits on Dec 30, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 6db6baf - Browse repository at this point
Copy the full SHA 6db6bafView commit details
Commits on Jan 1, 2022
-
Improve out of line module resolution
Fixes 5119 When the directory structure was laid out as follows: ``` dir |---mod_a | |---sub_mod_1.rs | |---sub_mod_2.rs |---mod_a.rs ``` And ``mod_a.rs`` contains the following content: ```rust mod mod_a { mod sub_mod_1; mod sub_mod_2; } ``` rustfmt previously tried to find ``sub_mod_1.rs`` and ``sub_mod_2.rs`` in ``./mod_a/mod_a/``. This directory does not exist and this caused rustfmt to fail with the error message: Error writing files: failed to resolve mod Now, both ``sub_mod_1.rs`` and ``sub_mod_2.rs`` are resolved correctly and found at ``mod_a/sub_mod_1.rs`` and ``mod_a/sub_mod_2.rs``.
Configuration menu - View commit details
-
Copy full SHA for 737e6f7 - Browse repository at this point
Copy the full SHA 737e6f7View commit details
Commits on Jan 2, 2022
-
Make
--check
work when running from stdin. (rust-lang#3896)# Conflicts: # src/bin/main.rs
Configuration menu - View commit details
-
Copy full SHA for 93b7de5 - Browse repository at this point
Copy the full SHA 93b7de5View commit details -
Fix --check -l with stdin. (rust-lang#3910)
* Fix some possible panics when using `--check` with stdin. One case which doesn't work is when there are only line ending fixes; with stdin rustfmt is unable to detect the difference as it stores the input with Unix line endings. * Add test for `rustfmt --check -l` with stdin.
Configuration menu - View commit details
-
Copy full SHA for 34263cd - Browse repository at this point
Copy the full SHA 34263cdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 776baf9 - Browse repository at this point
Copy the full SHA 776baf9View commit details -
Fix newlines in JSON output (rust-lang#4262)
* Fix newlines in JSON output This changes the JSON output to be more consistent about where newlines are included. Previously it only included them between lines in a multiline diff. That meant single line changes were treated a bit weirdly. This changes it to append a newline to every line. When feeding the results into `arc lint` this behaves correctly. I have only done limited testing though, in particular there's a possibility it might not work with files with `\r\n` endings (though that would have been the case before too). Fixes rust-lang#4259 * Update tests # Conflicts: # tests/writemode/target/output.json
Configuration menu - View commit details
-
Copy full SHA for 894a3c0 - Browse repository at this point
Copy the full SHA 894a3c0View commit details -
Use <stdin> when emitting stdin as filename (rust-lang#4298)
# Conflicts: # src/config/file_lines.rs # src/rustfmt/main.rs # src/test/mod.rs
Configuration menu - View commit details
-
Copy full SHA for 34d374e - Browse repository at this point
Copy the full SHA 34d374eView commit details
Commits on Jan 5, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 5056f4c - Browse repository at this point
Copy the full SHA 5056f4cView commit details
Commits on Jan 9, 2022
-
Compute most of Public/Exported access level in rustc_resolve
Mak DefId to AccessLevel map in resolve for export hir_id to accesslevel in resolve and applied in privacy using local def id removing tracing probes making function not recursive and adding comments Move most of Exported/Public res to rustc_resolve moving public/export res to resolve fix missing stability attributes in core, std and alloc move code to access_levels.rs return for some kinds instead of going through them Export correctness, macro changes, comments add comment for import binding add comment for import binding renmae to access level visitor, remove comments, move fn as closure, remove new_key fmt fix rebase fix rebase fmt fmt fix: move macro def to rustc_resolve fix: reachable AccessLevel for enum variants fmt fix: missing stability attributes for other architectures allow unreachable pub in rustfmt fix: missing impl access level + renaming export to reexport Missing impl access level was found thanks to a test in clippy
Configuration menu - View commit details
-
Copy full SHA for 6e63002 - Browse repository at this point
Copy the full SHA 6e63002View commit details
Commits on Jan 12, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 04670a1 - Browse repository at this point
Copy the full SHA 04670a1View commit details
Commits on Jan 15, 2022
-
Configuration menu - View commit details
-
Copy full SHA for bfbf42c - Browse repository at this point
Copy the full SHA bfbf42cView commit details
Commits on Jan 17, 2022
-
Auto merge of rust-lang#92816 - tmiasko:rm-llvm-asm, r=Amanieu
Remove deprecated LLVM-style inline assembly The `llvm_asm!` was deprecated back in rust-lang#87590 1.56.0, with intention to remove it once `asm!` was stabilized, which already happened in rust-lang#91728 1.59.0. Now it is time to remove `llvm_asm!` to avoid continued maintenance cost. Closes rust-lang#70173. Closes rust-lang#92794. Closes rust-lang#87612. Closes rust-lang#82065. cc `@rust-lang/wg-inline-asm` r? `@Amanieu`
Configuration menu - View commit details
-
Copy full SHA for 8ae2312 - Browse repository at this point
Copy the full SHA 8ae2312View commit details -
Configuration menu - View commit details
-
Copy full SHA for f5ce84e - Browse repository at this point
Copy the full SHA f5ce84eView commit details -
Instead of having a separate enum variant for types and consts have one but have either a const or type.
Configuration menu - View commit details
-
Copy full SHA for cf86d53 - Browse repository at this point
Copy the full SHA cf86d53View commit details -
Add term to ExistentialProjection
Also prevent ICE when adding a const in associated const equality.
Configuration menu - View commit details
-
Copy full SHA for 7913f13 - Browse repository at this point
Copy the full SHA 7913f13View commit details
Commits on Jan 23, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 9b454a5 - Browse repository at this point
Copy the full SHA 9b454a5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e1973f - Browse repository at this point
Copy the full SHA 9e1973fView commit details -
Merge pull request rust-lang#5186 from calebcartwright/subtree-sync-2…
…022-01-23 sync subtree
Configuration menu - View commit details
-
Copy full SHA for 5c558e2 - Browse repository at this point
Copy the full SHA 5c558e2View commit details
Commits on Jan 24, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 3572c54 - Browse repository at this point
Copy the full SHA 3572c54View commit details
Commits on Jan 29, 2022
-
Fix formatting of comments in empty structs (rust-lang#5171)
* Fix formatting of comments in empty structs * Add tests * Add single line tests * Fix block comments * Revert changes of test source files
Configuration menu - View commit details
-
Copy full SHA for b4a4bf0 - Browse repository at this point
Copy the full SHA b4a4bf0View commit details -
Prevent adding trailing whitespace when rewriting ast::Param
Fixes 5125 Previously, a newline was always added, even if the parameter name was not preceded by any param attrs. Now a newline is only added if there were param attrs.
Configuration menu - View commit details
-
Copy full SHA for 8b0b213 - Browse repository at this point
Copy the full SHA 8b0b213View commit details
Commits on Feb 2, 2022
-
Handle non-ascii character at boundary (rust-lang#5089)
* Handle non-ascii character at boundary * Replace substraction underflow check with early termination
Configuration menu - View commit details
-
Copy full SHA for 368a9b7 - Browse repository at this point
Copy the full SHA 368a9b7View commit details
Commits on Feb 4, 2022
-
Retain trailing separator when extracting the last inline post comment
Fixes 5042 Previously, trailing commas were removed from the last inline comment. This lead to rustfmt refusing to format code snippets because the original comment did not match the rewritten comment. Now, when rustfmt extracts the last inline comment it leaves trailing separators alone. Rustfmt does not need to remove these separators because they are commented out.
Configuration menu - View commit details
-
Copy full SHA for 606894e - Browse repository at this point
Copy the full SHA 606894eView commit details -
Configuration menu - View commit details
-
Copy full SHA for b2c7a52 - Browse repository at this point
Copy the full SHA b2c7a52View commit details -
Configuration menu - View commit details
-
Copy full SHA for fd6e11c - Browse repository at this point
Copy the full SHA fd6e11cView commit details
Commits on Feb 7, 2022
-
Fix doc of generic items formmating error (rust-lang#5124)
* Fix doc of generic items formmating error * Remove tracked `attrs_end_with_doc_comment` flag in `RewriteContext` * Fix duplicated doc comments of const generic params * Fix `<ast::GenericParam as Spanned>::span()` * Remove duplicated source file of `doc-of-generic-item.rs`
Configuration menu - View commit details
-
Copy full SHA for 5df8c8f - Browse repository at this point
Copy the full SHA 5df8c8fView commit details
Commits on Feb 11, 2022
-
Configuration menu - View commit details
-
Copy full SHA for ace7241 - Browse repository at this point
Copy the full SHA ace7241View commit details -
Configuration menu - View commit details
-
Copy full SHA for 813d127 - Browse repository at this point
Copy the full SHA 813d127View commit details -
chore(rustfmt): remove executable path from usage string (rust-lang#5216
Configuration menu - View commit details
-
Copy full SHA for b05b313 - Browse repository at this point
Copy the full SHA b05b313View commit details -
Leverage itemized blocks to support formatting markdown block quotes
Fixes 5157 Doc comments support markdown, but rustfmt didn't previously assign any semantic value to leading '> ' in comments. This lead to poor formatting when using ``wrap_comments=true``. Now, rustfmt treats block quotes as itemized blocks, which greatly improves how block quotes are formatted when ``wrap_comments=true``.
Configuration menu - View commit details
-
Copy full SHA for 1e78a2b - Browse repository at this point
Copy the full SHA 1e78a2bView commit details
Commits on Feb 15, 2022
-
Add context to get_toml_path() error (rust-lang#5207)
* rustfmt: print full error chain * Add context to get_toml_path() error Instead of an error like: ``` Permission denied (os error 13) ``` Gives error like: ``` Failed to get metadata for config file "/root/.rustfmt.toml": Permission denied (os error 13) ```
Configuration menu - View commit details
-
Copy full SHA for 6c47612 - Browse repository at this point
Copy the full SHA 6c47612View commit details
Commits on Feb 16, 2022
-
Configuration menu - View commit details
-
Copy full SHA for d5aabcc - Browse repository at this point
Copy the full SHA d5aabccView commit details -
Configuration menu - View commit details
-
Copy full SHA for c63d42e - Browse repository at this point
Copy the full SHA c63d42eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 281bf03 - Browse repository at this point
Copy the full SHA 281bf03View commit details
Commits on Feb 23, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 7592663 - Browse repository at this point
Copy the full SHA 7592663View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5723946 - Browse repository at this point
Copy the full SHA 5723946View commit details
Commits on Feb 24, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 89ca3f3 - Browse repository at this point
Copy the full SHA 89ca3f3View commit details
Commits on Feb 25, 2022
-
Configuration menu - View commit details
-
Copy full SHA for de1ac37 - Browse repository at this point
Copy the full SHA de1ac37View commit details
Commits on Mar 1, 2022
-
fallback to dir_path when relative external mod resolution fails
We only want to fall back if two conditions are met: 1) Initial module resolution is performed relative to some nested directory. 2) Module resolution fails because of a ModError::FileNotFound error. When these conditions are met we can try to fallback to searching for the module's file relative to the dir_path instead of the nested relative directory. Fixes 5198 As demonstrated by 5198, it's possible that a directory name conflicts with a rust file name. For example, src/lib/ and src/lib.rs. If src/lib.rs references an external module like ``mod foo;``, then module resolution will try to resolve ``foo`` to src/lib/foo.rs or src/lib/foo/mod.rs. Module resolution would fail with a file not found error if the ``foo`` module were defined at src/foo.rs. When encountering these kinds of module resolution issues we now fall back to the current directory and attempt to resolve the module again. Given the current example, this means that if we can't find the module ``foo`` at src/lib/foo.rs or src/lib/foo/mod.rs, we'll attempt to resolve the module to src/foo.rs.
Configuration menu - View commit details
-
Copy full SHA for 12048e4 - Browse repository at this point
Copy the full SHA 12048e4View commit details -
Prevent wrapping markdown headers in doc comments
Fixes 5238 A markdown header is defined by a string that starts with `#`. Previously, rustfmt would wrap long markdown headers when `wrap_comments=true`. This lead to issues when rendering these headers in HTML using rustdoc. Now, rustfmt leaves markdown headers alone when wrapping comments.
Configuration menu - View commit details
-
Copy full SHA for 272fb42 - Browse repository at this point
Copy the full SHA 272fb42View commit details
Commits on Mar 3, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 4edb757 - Browse repository at this point
Copy the full SHA 4edb757View commit details -
Configuration menu - View commit details
-
Copy full SHA for 74876ef - Browse repository at this point
Copy the full SHA 74876efView commit details -
Adjusted diagnostic output so that if there is no
use
in a item seq……uence, then we just suggest the first legal position where you could inject a use. To do this, I added `inject_use_span` field to `ModSpans`, and populate it in parser (it is the span of the first token found after inner attributes, if any). Then I rewrote the use-suggestion code to utilize it, and threw out some stuff that is now unnecessary with this in place. (I think the result is easier to understand.) Then I added a test of issue 87613.
Configuration menu - View commit details
-
Copy full SHA for 651f463 - Browse repository at this point
Copy the full SHA 651f463View commit details
Commits on Mar 4, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 0be8931 - Browse repository at this point
Copy the full SHA 0be8931View commit details -
Configuration menu - View commit details
-
Copy full SHA for ce301d9 - Browse repository at this point
Copy the full SHA ce301d9View commit details
Commits on Mar 5, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 1212c94 - Browse repository at this point
Copy the full SHA 1212c94View commit details
Commits on Mar 6, 2022
-
Rollup merge of rust-lang#94617 - pierwill:update-itertools, r=Mark-S…
…imulacrum Update `itertools` Update to 0.10.1
Configuration menu - View commit details
-
Copy full SHA for 6a2dae6 - Browse repository at this point
Copy the full SHA 6a2dae6View commit details -
Fix missing struct field separators under certain conditions
When struct_field_align_threshold is non-zero and trailing_comma is set to "Never," struct field separators are omitted between field groups. This issue is resolved by forcing separators between groups. Fixes rust-lang#4791. A test is included with a minimal reproducible example.
Configuration menu - View commit details
-
Copy full SHA for ee13051 - Browse repository at this point
Copy the full SHA ee13051View commit details -
Configuration menu - View commit details
-
Copy full SHA for ab9f2a8 - Browse repository at this point
Copy the full SHA ab9f2a8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 58de414 - Browse repository at this point
Copy the full SHA 58de414View commit details
Commits on Mar 7, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 003eaf8 - Browse repository at this point
Copy the full SHA 003eaf8View commit details
Commits on Mar 9, 2022
-
Improve mod resolution error for mods with multiple candidate files
Fixes 5167 When ``a.rs`` and ``a/mod.rs`` are both present we would emit an error message telling the user that the module couldn't be found. However, this behavior is misleading because we're dealing with an ambiguous module path, not a "file not found" error. Is the file ``a.rs`` or is it ``a/mod.rs``? Rustfmt can't decide, and the user needs to resolve this ambiguity themselves. Now, the error message displayed to the user is in line with what they would see if they went to compile their code with these conflicting module names.
Configuration menu - View commit details
-
Copy full SHA for 18c0369 - Browse repository at this point
Copy the full SHA 18c0369View commit details
Commits on Mar 12, 2022
-
Configuration menu - View commit details
-
Copy full SHA for b4de150 - Browse repository at this point
Copy the full SHA b4de150View commit details
Commits on Mar 15, 2022
-
Auto merge of rust-lang#94584 - pnkfelix:inject-use-suggestion-sites,…
… r=ekuber More robust fallback for `use` suggestion Our old way to suggest where to add `use`s would first look for pre-existing `use`s in the relevant crate/module, and if there are *no* uses, it would fallback on trying to use another item as the basis for the suggestion. But this was fragile, as illustrated in issue rust-lang#87613 This PR instead identifies span of the first token after any inner attributes, and uses *that* as the fallback for the `use` suggestion. Fix rust-lang#87613
Configuration menu - View commit details
-
Copy full SHA for a918d8b - Browse repository at this point
Copy the full SHA a918d8bView commit details
Commits on Mar 16, 2022
-
Correct tracking issue link for
skip_children
Update the issue link to point to issue 3389
Configuration menu - View commit details
-
Copy full SHA for 9c65db6 - Browse repository at this point
Copy the full SHA 9c65db6View commit details -
Add test to verify tracking issue links
Now, tracking issue links are checked against the reference number listed in the link text to ensure they match.
Configuration menu - View commit details
-
Copy full SHA for 5696e38 - Browse repository at this point
Copy the full SHA 5696e38View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1bb85bd - Browse repository at this point
Copy the full SHA 1bb85bdView commit details -
resolve the conflict in compiler/rustc_session/src/parse.rs
Signed-off-by: codehorseman <cricis@yeah.net>
codehorseman committedMar 16, 2022 Configuration menu - View commit details
-
Copy full SHA for c0861d3 - Browse repository at this point
Copy the full SHA c0861d3View commit details -
rustc_error: make ErrorReported impossible to construct
There are a few places were we have to construct it, though, and a few places that are more invasive to change. To do this, we create a constructor with a long obvious name.
Configuration menu - View commit details
-
Copy full SHA for c1d351f - Browse repository at this point
Copy the full SHA c1d351fView commit details
Commits on Mar 17, 2022
-
Configuration menu - View commit details
-
Copy full SHA for c801367 - Browse repository at this point
Copy the full SHA c801367View commit details -
Rollup merge of rust-lang#94960 - codehorseman:master, r=oli-obk
Fix many spelling mistakes Signed-off-by: codehorseman <cricis@yeah.net>
Configuration menu - View commit details
-
Copy full SHA for cce0d50 - Browse repository at this point
Copy the full SHA cce0d50View commit details -
Configuration menu - View commit details
-
Copy full SHA for 432b8de - Browse repository at this point
Copy the full SHA 432b8deView commit details
Commits on Mar 18, 2022
-
Merge pull request rust-lang#5268 from calebcartwright/subtree-sync-2…
…022-03-16 subtree sync
Configuration menu - View commit details
-
Copy full SHA for a36dc36 - Browse repository at this point
Copy the full SHA a36dc36View commit details
Commits on Mar 20, 2022
-
Take &mut Diagnostic in emit_diagnostic.
Taking a Diagnostic by move would break the usual pattern `diag.label(..).emit()`.
Configuration menu - View commit details
-
Copy full SHA for 4f89c51 - Browse repository at this point
Copy the full SHA 4f89c51View commit details
Commits on Mar 21, 2022
-
Search for struct body span after any generic arguments
Fixes 5273 Previously, rustfmt searched for the start of a struct body after the opening `{`. In most cases this works just fine, but const values can also be defined between `{ }`, which lead to issues when rewriting the struct body. Now, rustfmt will search for the `{` after the generic argument list to guarantee that the `{` it finds is the start of the struct body.
Configuration menu - View commit details
-
Copy full SHA for e41329c - Browse repository at this point
Copy the full SHA e41329cView commit details -
Add
short_item_threshold
config optionAllow custom short item threshold values via config
Configuration menu - View commit details
-
Copy full SHA for 0dba01a - Browse repository at this point
Copy the full SHA 0dba01aView commit details -
Honor
#[rustfmt::skip::attributes(derive)]
attributeFixes 5270 Previously, rustfmt only checked the `merge_derives` configuration value to determine if it should merge_derives. This lead to derives being merged even when annotated with the `rustfmt::skip` attribute. Now, rustfmt also checks if derives are explicitly being skipped in the current context via the `rustfmt::skip` attribute.
Configuration menu - View commit details
-
Copy full SHA for 8984438 - Browse repository at this point
Copy the full SHA 8984438View commit details
Commits on Mar 28, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 5731f1d - Browse repository at this point
Copy the full SHA 5731f1dView commit details -
Configuration menu - View commit details
-
Copy full SHA for c2039d9 - Browse repository at this point
Copy the full SHA c2039d9View commit details -
Merge pull request rust-lang#5276 from calebcartwright/subtree-sync-2…
…022-03-27 sync subtree
Configuration menu - View commit details
-
Copy full SHA for 63acf90 - Browse repository at this point
Copy the full SHA 63acf90View commit details
Commits on Mar 29, 2022
-
Revert "Use cargo-fmt in self_tests"
This reverts commit c63d42e.
Configuration menu - View commit details
-
Copy full SHA for 4fecede - Browse repository at this point
Copy the full SHA 4fecedeView commit details -
Configuration menu - View commit details
-
Copy full SHA for e0c7b7d - Browse repository at this point
Copy the full SHA e0c7b7dView commit details
Commits on Mar 30, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 8e94761 - Browse repository at this point
Copy the full SHA 8e94761View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5ff7b63 - Browse repository at this point
Copy the full SHA 5ff7b63View commit details -
Configuration menu - View commit details
-
Copy full SHA for 419df99 - Browse repository at this point
Copy the full SHA 419df99View commit details