about summary refs log tree commit diff
path: root/src/tools/rustfmt/tests
AgeCommit message (Collapse)AuthorLines
2025-08-11Extract ast TraitImplHeaderCameron Steffen-12/+0
2025-08-06Print thread ID in panic message if thread name is unknownTrevor Gross-1/+2
`panic!` does not print any identifying information for threads that are unnamed. However, in many cases, the thread ID can be determined. This changes the panic message from something like this: thread '<unnamed>' panicked at src/main.rs:3:5: explicit panic To something like this: thread '<unnamed>' (0xff9bf) panicked at src/main.rs:3:5: explicit panic Stack overflow messages are updated as well. This change applies to both named and unnamed threads. The ID printed is the OS integer thread ID rather than the Rust thread ID, which should also be what debuggers print.
2025-07-02Auto merge of #143214 - camsteffen:remove-let-chains-feature, r=est31bors-0/+4
Remove let_chains unstable feature Per https://github.com/rust-lang/rust/issues/53667#issuecomment-3016742982 (but then I also noticed rust-lang/rust#140722) This replaces the feature gate with a parser error that says let chains require 2024. A lot of tests were using the unstable feature. I either added edition:2024 to the test or split out the parts that require 2024.
2025-07-01Remove support for dyn*Michael Goulet-10/+0
2025-06-30Remove let_chains featureCameron Steffen-0/+4
2025-06-27Rollup merge of #139858 - oli-obk:new-const-traits-syntax, r=fee1-deadMatthias Krüger-12/+12
New const traits syntax This PR only affects the AST and doesn't actually change anything semantically. All occurrences of `~const` outside of libcore have been replaced by `[const]`. Within libcore we have to wait for rustfmt to be bumped in the bootstrap compiler. This will happen "automatically" (when rustfmt is run) during the bootstrap bump, as rustfmt converts `~const` into `[const]`. After this we can remove the `~const` support from the parser Caveat discovered during impl: there is no legacy bare trait object recovery for `[const] Trait` as that snippet in type position goes down the slice /array parsing code and will error r? ``@fee1-dead`` cc ``@nikomatsakis`` ``@traviscross`` ``@compiler-errors``
2025-06-26Change const trait bound syntax from ~const to [const]Oli Scherer-12/+12
2025-06-15Implement pinned borrows, part of `pin_ergonomics`Frank King-0/+17
2025-04-29Also allow bool literals as first item of let chainCaleb Cartwright-10/+8
Co-authored-by: est31 <est31@users.noreply.github.com>
2025-03-21update rustfmt testlcnr-2/+2
2025-03-17Teach rustfmt to handle postfix yieldEric Holk-17/+7
This involved fixing the span when parsing .yield
2025-03-14Teach rustfmt to handle postfix yieldEric Holk-0/+27
2025-03-05Implement `&pin const self` and `&pin mut self` sugarsFrank King-0/+19
2025-03-03Rollup merge of #132388 - frank-king:feature/where-cfg, r=petrochenkovMatthias Krüger-0/+116
Implement `#[cfg]` in `where` clauses This PR implements #115590, which supports `#[cfg]` attributes in `where` clauses. The biggest change is, that it adds `AttrsVec` and `NodeId` to the `ast::WherePredicate` and `HirId` to the `hir::WherePredicate`.
2025-03-01Implment `#[cfg]` and `#[cfg_attr]` in `where` clausesFrank King-0/+116
2025-02-28Do not yeet unsafe<> from typeMichael Goulet-0/+5
2025-01-30Disable overflow_delimited_expr in edition 2024Michael Goulet-29/+44
2025-01-09Only treat plain literal patterns as shortOli Scherer-0/+18
2024-12-22Make sure we don't lose default struct value when formatting structMichael Goulet-0/+36
2024-12-12Fix toolsMichael Goulet-0/+20
2024-11-24Fix rustfmt according to reviewNadrieril-0/+12
2024-11-21Implement the unsafe-fields RFC.Luca Versari-0/+27
Co-Authored-By: Jacob Pratt <jacob@jhpratt.dev>
2024-11-02Do not format generic constsMichael Goulet-0/+25
2024-10-15Rewrite for<..> async correctlyMichael Goulet-0/+2
2024-10-15Rollup merge of #130635 - eholk:pin-reborrow-sugar, r=compiler-errorsMatthias Krüger-0/+19
Add `&pin (mut|const) T` type position sugar This adds parser support for `&pin mut T` and `&pin const T` references. These are desugared to `Pin<&mut T>` and `Pin<&T>` in the AST lowering phases. This PR currently includes #130526 since that one is in the commit queue. Only the most recent commits (bd450027eb4a94b814a7dd9c0fa29102e6361149 and following) are new. Tracking: - #130494 r? `@compiler-errors`
2024-10-07Add basic pin sugar support to rustfmtEric Holk-0/+19
2024-10-01Remove anon struct and union typesMichael Goulet-31/+0
2024-09-19Merge commit 'b23b69900eab1260be510b2bd8922f4b6de6cf1e' into sync-from-rustfmtYacin Tmimi-100/+877
2024-09-06Fix toolsMichael Goulet-0/+15
2024-08-07Stabilize `unsafe_attributes`carbotaniuman-1/+0
2024-08-02rustfmt: Remove `has_cpuid` from testJubilee Young-18/+0
2024-07-11Remove rustdoc tests which no longer parseMichael Goulet-10/+0
2024-06-28Implement RTN support in rustfmtMichael Goulet-0/+10
2024-06-23Implement use<> formatting in rustfmtMichael Goulet-0/+64
2024-06-22Merge commit 'e4944185ae09c99f59b460e358909f329010ea9c' into ↵Caleb Cartwright-10/+657
sync-from-rustfmt-24-06
2024-06-06Revert "Rollup merge of #124099 - voidc:disallow-ambiguous-expr-attrs, ↵Rémy Rakic-4/+4
r=davidtwco" This reverts commit 57dad1d75e562ff73051c1c43b07eaf65c7dbd74, reversing changes made to 36316df9fe6c3e246153fe6e78967643cf08c148.
2024-04-24Error on using `yield` without also using `#[coroutine]` on the closureOli Scherer-2/+4
And suggest adding the `#[coroutine]` to the closure
2024-04-18Disallow ambiguous attributes on expressionsDominik Stolz-4/+4
2024-03-27Add rustfmt test for mut ref mutJules Bertholet-0/+20
2024-03-06Add basic rustfmt implementation & testRoss Smyth-0/+40
2024-03-05errors: share `SilentEmitter` between rustc and rustfmtDavid Wood-1/+6
Signed-off-by: David Wood <david@davidtw.co>
2024-02-26Move `emit_stashed_diagnostic` call in rustfmt.Nicholas Nethercote-0/+3
This call was added to `parse_crate_mod` in #121487, to fix a case where a stashed diagnostic wasn't emitted. But there is another path where a stashed diagnostic might fail to be emitted if there's a parse error, if the `build` call in `parse_crate_inner` fails before `parse_crate_mod` is reached. So this commit moves the `emit_stashed_diagnostic` call outwards, from `parse_crate_mod` to `format_project`, just after the `Parser::parse_crate` call. This should be far out enough to catch any parsing errors. Fixes #121517.
2024-02-23Explicitly call `emit_stashed_diagnostics`.Nicholas Nethercote-0/+3
Commit 72b172b in #121206 changed things so that `emit_stashed_diagnostics` is only called from `run_compiler`. But rustfmt doesn't use `run_compiler`, so it needs to call `emit_stashed_diagnostics` itself to avoid an abort in `DiagCtxtInner::drop` when stashed diagnostics occur. Fixes #121450.
2024-02-14Rollup merge of #121035 - compiler-errors:rustfmt-asyncness, r=calebcartwrightGuillaume Gomez-0/+3
Format `async` trait bounds in rustfmt r? `@ytmimi` or `@calebcartwright` This PR opts to do formatting in the rust-lang/rust tree because otherwise we'd have to wait until a full sync, and rustfmt is currently totally removing the `async` keyword. cc https://github.com/rust-lang/rustfmt/issues/6070
2024-02-13Format async bounds in rustfmtMichael Goulet-0/+3
2024-02-12Add rustfmt test from #117942Frank King-0/+12
2024-01-22Check that a token can begin a nonterminal kind before parsing it as a macro ↵Michael Goulet-0/+4
arg in rustfmt
2023-12-10Remove edition umbrella features.Eric Huss-4/+4
2023-10-22Merge commit '81fe905ca83cffe84322f27ca43950b617861ff7' into rustfmt-syncCaleb Cartwright-5/+1766
2023-10-20Rename lots of files that had `generator` in their nameOli Scherer-0/+0