Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
2b3bceb
Add `{ast,hir,thir}::PatKind::Missing` variants.
nnethercote Mar 26, 2025
ce70a79
Impl `Copy` for `Token` and `TokenKind`.
nnethercote May 15, 2024
409c7b8
Tighten up assignment operator representations.
nnethercote Dec 19, 2024
2ab6be8
Rollup merge of #139035 - nnethercote:PatKind-Missing, r=oli-obk
Zalathar Apr 7, 2025
e80a221
Auto merge of #124141 - nnethercote:rm-Nonterminal-and-TokenKind-Inte…
bors Apr 14, 2025
1abbb92
Remove `token::{Open,Close}Delim`.
nnethercote Apr 16, 2025
31d40e5
Add or-patterns to pattern types
oli-obk Feb 27, 2025
ce64001
Also allow bool literals as first item of let chain
calebcartwright Apr 29, 2025
266da42
Do not remove super keyword from super-let
compiler-errors May 12, 2025
6210ac1
attempt to have rustfmt use the new logic
folkertdev Apr 29, 2025
2f3a0a5
rename to get rid of the 'raw' concept
folkertdev May 17, 2025
79a9897
Reduce `P<T>` to a typedef of `Box<T>`.
nnethercote May 26, 2025
4718757
move asm parsing code into `rustc_parse`
folkertdev May 5, 2025
2d7453d
Reorder `ast::ItemKind::{Struct,Enum,Union}` fields.
nnethercote May 27, 2025
99adefc
Rollup merge of #141675 - nnethercote:ItemKind-field-order, r=fee1-dead
jhpratt May 29, 2025
5098c6c
Rollup merge of #141603 - nnethercote:reduce-P, r=fee1-dead
GuillaumeGomez Jun 6, 2025
d37c63f
Implement pinned borrows, part of `pin_ergonomics`
frank-king Jan 19, 2025
928d1dc
Extract Translator struct
camsteffen Jun 19, 2025
e9d0738
Rename SilentEmitter -> FatalOnlyEmitter
camsteffen Jun 17, 2025
ced2bb0
Extract SilentEmitter
camsteffen Jun 19, 2025
f81941c
Remove an unnecessary check in rustfmt.
nnethercote May 27, 2025
8cf8b25
Auto merge of #142794 - tgross35:rollup-iae7okj, r=tgross35
bors Jun 20, 2025
fd6ceeb
Rollup merge of #135731 - frank-king:feature/pin-borrow, r=eholk,trav…
workingjubilee Jun 25, 2025
9debb8f
Change const trait bound syntax from ~const to [const]
oli-obk Mar 11, 2025
a69cccb
Rollup merge of #139858 - oli-obk:new-const-traits-syntax, r=fee1-dead
matthiaskrgr Jun 27, 2025
a22fa5b
Remove let_chains feature
camsteffen Jun 29, 2025
a5c21f9
Remove support for dyn*
compiler-errors Jun 26, 2025
55252ea
Merge from rustc
Jul 2, 2025
48e17a2
Auto merge of #143214 - camsteffen:remove-let-chains-feature, r=est31
bors Jul 2, 2025
97b6e88
Replace kw_span by full span.
cjgillot Jul 2, 2024
9e99aae
Merge from rustc
RalfJung Jul 3, 2025
c5916cf
rustfmt: migrate BareFn -> FnPtr
workingjubilee Jul 6, 2025
a1cfe86
parse `const trait Trait`
fee1-dead Jul 13, 2025
340e590
Print thread ID in panic message if thread name is unknown
tgross35 Sep 11, 2023
4501819
remove `P`
fee1-dead Aug 9, 2025
c9ee26f
Extract ast TraitImplHeader
camsteffen Jul 22, 2025
b63507d
Prevent impossible combinations in `ast::ModKind`.
nnethercote Aug 19, 2025
366a08f
test(rustfmt): Verify frontmatter is preserved
epage Aug 8, 2025
671c0c9
Remove `dirs-sys-0.4.1` dependency.
nnethercote Aug 21, 2025
91124ee
Rollup merge of #145729 - nnethercote:dup-packages, r=calebcartwright
samueltardieu Aug 23, 2025
2890913
add span to struct pattern rest (..)
Erk- Aug 23, 2025
2281382
Rollup merge of #145766 - epage:rustfmt, r=calebcartwright
Zalathar Aug 26, 2025
546dbe9
Add custom macro formatters
mohe2015 Aug 31, 2025
3e1d398
Clean up
mohe2015 Aug 31, 2025
ebbfa7e
Rename
mohe2015 Aug 31, 2025
6e7cb66
Clean up
mohe2015 Aug 31, 2025
4d69019
Fix discover again
mohe2015 Aug 31, 2025
3dcb6c7
Add backtrace
mohe2015 Aug 31, 2025
99d7bd2
wip
mohe2015 Aug 31, 2025
842404e
wip
mohe2015 Aug 31, 2025
a97c34f
wip
mohe2015 Aug 31, 2025
a6da9cb
wip
mohe2015 Aug 31, 2025
9e2cff7
Fix
mohe2015 Aug 31, 2025
8306e8c
wip
mohe2015 Aug 31, 2025
13a56c7
wip
mohe2015 Aug 31, 2025
54f3444
Fix compile
mohe2015 Aug 31, 2025
98dea9b
wip
mohe2015 Aug 31, 2025
e7e60ba
wip
mohe2015 Aug 31, 2025
a0ec765
clean up
mohe2015 Aug 31, 2025
1e33151
Fix
mohe2015 Aug 31, 2025
1cd23a7
wip
mohe2015 Aug 31, 2025
b5a1acf
wip
mohe2015 Sep 1, 2025
b73854e
broken
mohe2015 Sep 1, 2025
590a963
wip
mohe2015 Sep 1, 2025
46a215c
wip
mohe2015 Sep 1, 2025
a277007
wip
mohe2015 Sep 1, 2025
086aa84
fix a constness ordering bug in rustfmt
npmccallum Sep 1, 2025
fae328c
Fix
mohe2015 Sep 1, 2025
c90953c
Fix
mohe2015 Sep 1, 2025
bc155da
fixes
mohe2015 Sep 1, 2025
e229adb
cleanup
mohe2015 Sep 1, 2025
7e076e7
Fix
mohe2015 Sep 1, 2025
41989e2
Fix
mohe2015 Sep 1, 2025
a98f693
start working on another macro
mohe2015 Sep 1, 2025
c25aae1
wip
mohe2015 Sep 1, 2025
cfae896
wip
mohe2015 Sep 1, 2025
6f9ed5f
wip
mohe2015 Sep 1, 2025
8562e96
wip
mohe2015 Sep 1, 2025
279487e
parsing
mohe2015 Sep 1, 2025
b19ebd3
don't support for loops yet
mohe2015 Sep 1, 2025
8faea3a
private method
mohe2015 Sep 1, 2025
16c3d91
wip
mohe2015 Sep 1, 2025
186ca9a
wip
mohe2015 Sep 1, 2025
493f988
wip
mohe2015 Sep 1, 2025
ae6af51
fixes
mohe2015 Sep 1, 2025
dd71920
Fix
mohe2015 Sep 1, 2025
552f507
Fix indent
mohe2015 Sep 1, 2025
30887c4
Fix
mohe2015 Sep 1, 2025
e24b4f2
Improve formatter
mohe2015 Sep 1, 2025
bae0539
Fix bug
mohe2015 Sep 1, 2025
ed58841
Fix formatter
mohe2015 Sep 1, 2025
69d75fb
Fix
mohe2015 Sep 1, 2025
7ef4409
Rollup merge of #145783 - Erk-:et-cetera-span, r=compiler-errors
GuillaumeGomez Sep 2, 2025
0911650
Rollup merge of #146089 - npmccallum:rustfmt, r=fmease
GuillaumeGomez Sep 2, 2025
b779c6d
Bump toolchain
mohe2015 Sep 6, 2025
37ed52f
Merge branch 'rust-update' into html-extractor-formatting
mohe2015 Sep 6, 2025
095bd07
Some fixes
mohe2015 Sep 6, 2025
1b2c2a5
wip
mohe2015 Sep 6, 2025
ad5662b
wip
mohe2015 Sep 8, 2025
7b768ee
format
mohe2015 Sep 8, 2025
fa03a53
Fix
mohe2015 Sep 8, 2025
f654060
Fix
mohe2015 Sep 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@ tests/cargo-fmt/**/target

# Editors' specific files
.idea/
.vscode/
*~
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"rust-analyzer.rustc.source": "discover"
}
100 changes: 81 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ cargo_metadata = "0.18"
clap = { version = "4.4.2", features = ["derive"] }
clap-cargo = "0.12.0"
diff = "0.1"
dirs = "5.0"
dirs = "6.0"
getopts = "0.2"
ignore = "0.4"
itertools = "0.12"
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2025-04-02"
channel = "nightly-2025-09-08"
components = ["llvm-tools", "rustc-dev"]
16 changes: 0 additions & 16 deletions src/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,6 @@ fn rewrite_initial_doc_comments(
}

impl Rewrite for ast::MetaItemInner {
fn rewrite(&self, context: &RewriteContext<'_>, shape: Shape) -> Option<String> {
self.rewrite_result(context, shape).ok()
}

fn rewrite_result(&self, context: &RewriteContext<'_>, shape: Shape) -> RewriteResult {
match self {
ast::MetaItemInner::MetaItem(ref meta_item) => meta_item.rewrite_result(context, shape),
Expand Down Expand Up @@ -277,10 +273,6 @@ fn has_newlines_before_after_comment(comment: &str) -> (&str, &str) {
}

impl Rewrite for ast::MetaItem {
fn rewrite(&self, context: &RewriteContext<'_>, shape: Shape) -> Option<String> {
self.rewrite_result(context, shape).ok()
}

fn rewrite_result(&self, context: &RewriteContext<'_>, shape: Shape) -> RewriteResult {
Ok(match self.kind {
ast::MetaItemKind::Word => {
Expand Down Expand Up @@ -323,10 +315,6 @@ impl Rewrite for ast::MetaItem {
}

impl Rewrite for ast::Attribute {
fn rewrite(&self, context: &RewriteContext<'_>, shape: Shape) -> Option<String> {
self.rewrite_result(context, shape).ok()
}

fn rewrite_result(&self, context: &RewriteContext<'_>, shape: Shape) -> RewriteResult {
let snippet = context.snippet(self.span);
if self.is_doc_comment() {
Expand Down Expand Up @@ -385,10 +373,6 @@ impl Rewrite for ast::Attribute {
}

impl Rewrite for [ast::Attribute] {
fn rewrite(&self, context: &RewriteContext<'_>, shape: Shape) -> Option<String> {
self.rewrite_result(context, shape).ok()
}

fn rewrite_result(&self, context: &RewriteContext<'_>, shape: Shape) -> RewriteResult {
if self.is_empty() {
return Ok(String::new());
Expand Down
19 changes: 7 additions & 12 deletions src/chains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
use std::borrow::Cow;
use std::cmp::min;

use rustc_ast::{ast, ptr};
use rustc_ast::ast;
use rustc_span::{BytePos, Span, symbol};
use tracing::debug;

Expand Down Expand Up @@ -190,7 +190,7 @@ enum ChainItemKind {
MethodCall(
ast::PathSegment,
Vec<ast::GenericArg>,
ThinVec<ptr::P<ast::Expr>>,
ThinVec<Box<ast::Expr>>,
),
StructField(symbol::Ident),
TupleField(symbol::Ident, bool),
Expand Down Expand Up @@ -290,10 +290,6 @@ impl ChainItemKind {
}

impl Rewrite for ChainItem {
fn rewrite(&self, context: &RewriteContext<'_>, shape: Shape) -> Option<String> {
self.rewrite_result(context, shape).ok()
}

fn rewrite_result(&self, context: &RewriteContext<'_>, shape: Shape) -> RewriteResult {
let shape = shape.sub_width(self.tries, self.span)?;
let rewrite = match self.kind {
Expand Down Expand Up @@ -351,7 +347,7 @@ impl ChainItem {
fn rewrite_method_call(
method_name: symbol::Ident,
types: &[ast::GenericArg],
args: &[ptr::P<ast::Expr>],
args: &[Box<ast::Expr>],
span: Span,
context: &RewriteContext<'_>,
shape: Shape,
Expand Down Expand Up @@ -548,10 +544,6 @@ impl Chain {
}

impl Rewrite for Chain {
fn rewrite(&self, context: &RewriteContext<'_>, shape: Shape) -> Option<String> {
self.rewrite_result(context, shape).ok()
}

fn rewrite_result(&self, context: &RewriteContext<'_>, shape: Shape) -> RewriteResult {
debug!("rewrite chain {:?} {:?}", self, shape);

Expand All @@ -567,6 +559,7 @@ impl Rewrite for Chain {
formatter.format_root(&self.parent, context, shape)?;
if let Some(result) = formatter.pure_root() {
return wrap_str(result, context.config.max_width(), shape)
.ok()
.max_width_error(shape.width, self.parent.span);
}

Expand All @@ -582,7 +575,9 @@ impl Rewrite for Chain {
formatter.format_last_child(context, shape, child_shape)?;

let result = formatter.join_rewrites(context, child_shape)?;
wrap_str(result, context.config.max_width(), shape).max_width_error(shape.width, full_span)
wrap_str(result, context.config.max_width(), shape)
.ok()
.max_width_error(shape.width, full_span)
}
}

Expand Down
Loading