about summary refs log tree commit diff
path: root/src/tools/rustfmt
AgeCommit message (Collapse)AuthorLines
2021-09-20Migrate to 2021Mark Rousskov-1/+1
2021-09-15Rollup merge of #88775 - pnkfelix:revert-anon-union-parsing, r=davidtwcoManish Goregaokar-65/+12
Revert anon union parsing Revert PR #84571 and #85515, which implemented anonymous union parsing in a manner that broke the context-sensitivity for the `union` keyword and thus broke stable Rust code. Fix #88583.
2021-09-11Auto merge of #84373 - cjgillot:resolve-span, r=michaelwoerister,petrochenkovbors-3/+8
Encode spans relative to the enclosing item The aim of this PR is to avoid recomputing queries when code is moved without modification. MCP at https://github.com/rust-lang/compiler-team/issues/443 This is achieved by : 1. storing the HIR owner LocalDefId information inside the span; 2. encoding and decoding spans relative to the enclosing item in the incremental on-disk cache; 3. marking a dependency to the `source_span(LocalDefId)` query when we translate a span from the short (`Span`) representation to its explicit (`SpanData`) representation. Since all client code uses `Span`, step 3 ensures that all manipulations of span byte positions actually create the dependency edge between the caller and the `source_span(LocalDefId)`. This query return the actual absolute span of the parent item. As a consequence, any source code motion that changes the absolute byte position of a node will either: - modify the distance to the parent's beginning, so change the relative span's hash; - dirty `source_span`, and trigger the incremental recomputation of all code that depends on the span's absolute byte position. With this scheme, I believe the dependency tracking to be accurate. For the moment, the spans are marked during lowering. I'd rather do this during def-collection, but the AST MutVisitor is not practical enough just yet. The only difference is that we attach macro-expanded spans to their expansion point instead of the macro itself.
2021-09-10Keep a parent LocalDefId in SpanData.Camille GILLOT-3/+8
2021-09-09Ignore automatically derived impls of `Clone` and `Debug` in dead code analysisFabian Wolff-31/+6
2021-09-09Revert "Allow formatting `Anonymous{Struct, Union}` declarations"Felix S. Klock II-65/+12
This reverts commit 64acb7d92135ae722dfce89f0ca9d7cf6576de66.
2021-09-06Auto merge of #88493 - chenyukang:fix-duplicated-diagnostic, r=estebankbors-0/+1
Fix #88256 remove duplicated diagnostics Fix #88256
2021-09-04Fix #88256, remove duplicated diagnosticyukang-0/+1
2021-09-03Detect bare blocks with type ascription that were meant to be a `struct` literalEsteban Kuber-0/+1
Address part of #34255. Potential improvement: silence the other knock down errors in `issue-34255-1.rs`.
2021-08-30Temporary fix rustfmt for let-elseCameron Steffen-4/+11
2021-08-27Fix rustfmt testDeadbeef-21/+9
2021-08-27Introduce `~const`Deadbeef-14/+12
- [x] Removed `?const` and change uses of `?const` - [x] Added `~const` to the AST. It is gated behind const_trait_impl. - [x] Validate `~const` in ast_validation. - [ ] Add enum `BoundConstness` to the HIR. (With variants `NotConst` and `ConstIfConst` allowing future extensions) - [ ] Adjust trait selection and pre-existing code to use `BoundConstness`. - [ ] Optional steps (*for this PR, obviously*) - [ ] Fix #88155 - [ ] Do something with constness bounds in chalk
2021-08-22Fix typos “an”→“a” and a few different ones that appeared in the ↵Frank Steffahn-4/+4
same search
2021-08-22Fix more “a”/“an” typosFrank Steffahn-1/+1
2021-08-17Auto merge of #87119 - jyn514:rustfmt-doc-private, r=Mark-Simulacrumbors-4/+4
Document private items for rustfmt This is possible now that https://github.com/rust-lang/rust/pull/73936 has been merged.
2021-08-16Document private items for rustfmtJoshua Nelson-4/+4
This is possible now that rustdoc allows passing `--document-private-items` more than once.
2021-08-15Introduce hir::ExprKind::Let - Take 2Caio-1/+1
2021-08-02Auto merge of #87535 - lf-:authors, r=Mark-Simulacrumbors-2/+0
rfc3052 followup: Remove authors field from Cargo manifests Since RFC 3052 soft deprecated the authors field, hiding it from crates.io, docs.rs, and making Cargo not add it by default, and it is not generally up to date/useful information for contributors, we may as well remove it from crates in this repo.
2021-07-29rfc3052: Remove authors field from Cargo manifestsJade-2/+0
Since RFC 3052 soft deprecated the authors field anyway, hiding it from crates.io, docs.rs, and making Cargo not add it by default, and it is not generally up to date/useful information, we should remove it from crates in this repo.
2021-07-25Merge commit '4236289b75ee55c78538c749512cdbeea5e1c332' into update-rustfmtCaleb Cartwright-291/+276
2021-07-17Use LocalExpnId where possible.Camille GILLOT-2/+2
2021-07-08Rework SESSION_GLOBALS API to prevent overwriting itGuillaume Gomez-1/+1
2021-07-01Document rustfmt on nightly-rustcJoshua Nelson-0/+1
The recursion_limit attribute avoids the following error: ``` error[E0275]: overflow evaluating the requirement `std::ptr::Unique<rustc_ast::Pat>: std::marker::Send` | = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`rustfmt_nightly`) ```
2021-06-22Rollup merge of #86424 - calebcartwright:rustfmt-mod-resolution, ↵Yuki Okushi-1/+46
r=Mark-Simulacrum rustfmt: load nested out-of-line mods correctly This should address https://github.com/rust-lang/rustfmt/issues/4874 r? `@Mark-Simulacrum` Decided to make the change directly in tree here for expediency/to minimize any potential backporting issues, and because there's some subtree sync items I need to get resolved before pulling from r-l/rustfmt
2021-06-22Rollup merge of #86274 - alexander-melentyev:spaces, r=bjorn3Yuki Okushi-31/+31
Spaces
2021-06-21Delete spacesAlexander Melentyev-31/+31
2021-06-17fix(rustfmt): load nested out-of-line mods correctlyCaleb Cartwright-1/+46
2021-06-17Use `AttrVec` for `Arm`, `FieldDef`, and `Variant`Yuki Okushi-3/+3
2021-06-10Add support for using qualified paths with structs in expression and patternRyan Levick-4/+6
position.
2021-05-16Allow formatting `Anonymous{Struct, Union}` declarationsjedel1043-11/+64
2021-05-14Update log to 0.4.14Joshua Nelson-1/+1
This avoids the following warning: ``` warning: trailing semicolon in macro used in expression position --> /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.11/src/macros.rs:152:45 | 147 | / macro_rules! debug { 148 | | (target: $target:expr, $($arg:tt)+) => ( 149 | | log!(target: $target, $crate::Level::Debug, $($arg)+); 150 | | ); 151 | | ($($arg:tt)+) => ( 152 | | log!($crate::Level::Debug, $($arg)+); | | ^ 153 | | ) 154 | | } | |_- in this expansion of `debug!` | ::: src/tools/rustfmt/src/modules/visitor.rs:36:23 | 36 | Err(e) => debug!("{}", e), | --------------- in this macro invocation | = note: requested on the command line with `-W semicolon-in-expressions-from-macros` = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #79813 <https://github.com/rust-lang/rust/issues/79813> ```
2021-05-14Add 'src/tools/rustfmt/' from commit '7872306edf2e11a69aaffb9434088fd66b46a863'Caleb Cartwright-0/+78073
git-subtree-dir: src/tools/rustfmt git-subtree-mainline: e659b6de9170c055b6f2d16e2679b22d67297b13 git-subtree-split: 7872306edf2e11a69aaffb9434088fd66b46a863
2021-05-14Delete rustfmt submoduleJoshua Nelson-6/+0
2021-05-05Update RLS and RustfmtIgor Matuszewski-5/+5
2021-04-12update RLS and rustfmtCaleb Cartwright-5/+5
2021-02-09update RLS and rustfmtCaleb Cartwright-5/+5
2021-01-28update rustfmt to v1.4.34Caleb Cartwright-5/+5
2021-01-16bump rustfmt to v1.4.32Caleb Cartwright-5/+5
2021-01-15Update RLS and RustfmtIgor Matuszewski-5/+5
2020-12-20update rustfmt to v1.4.30Caleb Cartwright-5/+5
2020-12-06Bump Rustfmt to 1.4.29Igor Matuszewski-5/+5
2020-12-05Update RLS and RustfmtIgor Matuszewski-5/+5
2020-11-16update rustfmt to v1.4.27Caleb Cartwright-5/+5
2020-11-14Update rustfmt to v1.4.26Caleb Cartwright-5/+5
2020-11-11update rustfmtCaleb Cartwright-5/+5
2020-11-06Bump Rustfmt and RLSAlessandro Ghedini-5/+5
Should hopefully fix #78341 and #78340.
2020-10-05Update RLS and RustfmtIgor Matuszewski-5/+5
2020-09-05Update RLS and RustfmtCaleb Cartwright-5/+5
2020-08-12Update RLS and RustfmtIgor Matuszewski-18/+5
2020-07-25Update rustfmtTyler Mandry-18/+15
Changes: - preparation for potential rustfmt 1.4.19 (#4283) - chore: backport 8157a3f0afe978d3e953420577f8344db7e905bf - deps: bump rustc-ap to v669 - deps: bump rustc-ap-* to v668 - deps: bump rustc-ap* to v666 - Use correct span for match arms with the leading pipe and attributes (#3975)