about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-09-02 17:08:56 +0200
committerGitHub <noreply@github.com>2025-09-02 17:08:56 +0200
commitf77a31fbfff6f3fe983ebeedd3165fbf57d655b1 (patch)
treeba2dc3f7196178c3d8dc34d4d65c024f900b20bb
parent90ed7913e50477b638bdba0ef06d1418f7538dc8 (diff)
parent8dfd6b8ec208f4f31dd0e41c32e9239bf262068c (diff)
downloadrust-f77a31fbfff6f3fe983ebeedd3165fbf57d655b1.tar.gz
rust-f77a31fbfff6f3fe983ebeedd3165fbf57d655b1.zip
Rollup merge of #146089 - npmccallum:rustfmt, r=fmease
fix a constness ordering bug in rustfmt

Normally, changes to rustfmt go into the separate repo. But, in this case, the bug is introduced in a local change and therefore isn't present in the rustfmt repo.

Related to: https://github.com/rust-lang/rust/pull/146071
Fixes https://github.com/rust-lang/rustfmt/issues/6619.
-rw-r--r--src/tools/rustfmt/src/items.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/rustfmt/src/items.rs b/src/tools/rustfmt/src/items.rs
index 6555679c394..75e468b3525 100644
--- a/src/tools/rustfmt/src/items.rs
+++ b/src/tools/rustfmt/src/items.rs
@@ -1175,8 +1175,8 @@ pub(crate) fn format_trait(
     let mut result = String::with_capacity(128);
     let header = format!(
         "{}{}{}{}trait ",
-        format_constness(constness),
         format_visibility(context, &item.vis),
+        format_constness(constness),
         format_safety(safety),
         format_auto(is_auto),
     );