about summary refs log tree commit diff
path: root/src/tools/rustfmt
AgeCommit message (Collapse)AuthorLines
2022-02-25Enable rustc_pass_by_value for SpanMark Rousskov-2/+2
2022-02-23rustc_errors: take `self` by value in `DiagnosticBuilder::cancel`.Eduard-Mihai Burtescu-16/+5
2022-02-23rustc_errors: add `downgrade_to_delayed_bug` to `Diagnostic` itself.Eduard-Mihai Burtescu-11/+7
2022-01-24rustc_errors: only box the `diagnostic` field in `DiagnosticBuilder`.Eduard-Mihai Burtescu-1/+1
2022-01-17Add term to ExistentialProjectionkadmin-1/+1
Also prevent ICE when adding a const in associated const equality.
2022-01-17Add termkadmin-6/+8
Instead of having a separate enum variant for types and consts have one but have either a const or type.
2022-01-17add eq constraints on associated constantskadmin-8/+9
2022-01-17Auto merge of #92816 - tmiasko:rm-llvm-asm, r=Amanieubors-4/+1
Remove deprecated LLVM-style inline assembly The `llvm_asm!` was deprecated back in #87590 1.56.0, with intention to remove it once `asm!` was stabilized, which already happened in #91728 1.59.0. Now it is time to remove `llvm_asm!` to avoid continued maintenance cost. Closes #70173. Closes #92794. Closes #87612. Closes #82065. cc `@rust-lang/wg-inline-asm` r? `@Amanieu`
2022-01-14fix(rustfmt): resolve generated file formatting issueCaleb Cartwright-5/+25
2022-01-12Remove LLVM-style inline assembly from rustfmtTomasz Miąsko-4/+1
2022-01-09Compute most of Public/Exported access level in rustc_resolveLamb-0/+1
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
2021-12-29Merge commit '4a053f206fd6799a25823c307f7d7f9d897be118' into ↵Caleb Cartwright-410/+710
sync-rustfmt-subtree
2021-12-15Remove unnecessary sigils around `Ident::as_str()` calls.Nicholas Nethercote-7/+7
2021-12-15Remove unnecessary sigils around `Symbol::as_str()` calls.Nicholas Nethercote-4/+4
2021-12-15Remove `SymbolStr`.Nicholas Nethercote-6/+8
By changing `as_str()` to take `&self` instead of `self`, we can just return `&str`. We're still lying about lifetimes, but it's a smaller lie than before, where `SymbolStr` contained a (fake) `&'static str`!
2021-12-02Merge commit '8da837185714cefbb261e93e9846afb11c1dc60e' into ↵Caleb Cartwright-435/+1730
sync-rustfmt-subtree
2021-11-24Change how the fn params span is calculatedEsteban Kuber-10/+2
Use the available Generics span field to avoid issues with `T: Fn()` bounds. This is necessary to land #85346.
2021-11-07Merge commit 'ea199bacef07213dbe008841b89c450e3bf0c638' into rustfmt-syncCaleb Cartwright-372/+670
2021-11-07ast: Fix naming conventions in AST structuresVadim Petrochenkov-56/+86
TraitKind -> Trait TyAliasKind -> TyAlias ImplKind -> Impl FnKind -> Fn All `*Kind`s in AST are supposed to be enums. Tuple structs are converted to braced structs for the types above, and fields are reordered in syntactic order. Also, mutable AST visitor now correctly visit spans in defaultness, unsafety, impl polarity and constness.
2021-10-21fix doc issue in rustfmtCaleb Cartwright-1/+1
2021-10-20ensure cargo-fmt tests are excluded from root workspaceCaleb Cartwright-0/+2
2021-10-20Merge commit 'efa8f5521d3813cc897ba29ea0ef98c7aef66bb6' into rustfmt-subtreeCaleb Cartwright-918/+2902
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