Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6985d35
Ignore EditorConfig violations in external repos
BaumiCoder Jun 27, 2026
671da61
Ignore EditorConfig violations in binary files
BaumiCoder Jun 27, 2026
57b945a
Handle indentation in Markdown files
BaumiCoder Jun 27, 2026
9a092e0
Handle charset and end_of_line in test files
BaumiCoder Jun 27, 2026
1447b07
Align EditorConfig lock formats
BaumiCoder Jun 27, 2026
d2e89b5
Unset EditorConfig for license texts
BaumiCoder Jun 27, 2026
f286e46
Fix EditorConfig Violations in rust-installer
BaumiCoder Jun 27, 2026
d0029c8
Ignore EditorConfig violations in auxv
BaumiCoder Jun 27, 2026
0ec17ff
Address EditorConfig violations in natvis files
BaumiCoder Jun 27, 2026
9d66e58
Harmonize EditorConfig for YAML files
BaumiCoder Jun 27, 2026
8774270
Fix EditorConfig for JSON and JSON5
BaumiCoder Jun 27, 2026
f01fc32
Fix EditorConfig violations in XML files
BaumiCoder Jun 27, 2026
2945de5
Add license information for .ecformat_ignore
BaumiCoder Jun 28, 2026
667b0e3
Address trailing whitespace characters
BaumiCoder Jun 28, 2026
d4b618e
Fix EditorConfig violations in Dockerfile
BaumiCoder Jun 28, 2026
2d0d28b
Ignore EditorConfig violations with mixed format
BaumiCoder Jun 28, 2026
f337fab
Harmonize indentations in Cargo.toml files
BaumiCoder Jun 28, 2026
ffcf0ba
Ignore EditorConfig violations in C and C++ code
BaumiCoder Jun 28, 2026
928494f
Fix EditorConfig for nix files
BaumiCoder Jun 28, 2026
e0a7065
Harmonize indentations in shell scripts
BaumiCoder Jun 28, 2026
2807830
Fix EditorConfig für .gitmodules
BaumiCoder Jun 28, 2026
8530d84
Fix ./x test
BaumiCoder Jun 28, 2026
3f0a7e8
Fix EditorConfig fish shell completions
BaumiCoder Jun 28, 2026
010438a
Insert final newline in check files
BaumiCoder Jun 28, 2026
468c817
Address missing final newlines
BaumiCoder Jun 28, 2026
ae4e459
Address remaining indentation errors
BaumiCoder Jun 28, 2026
1fbae84
Fix handling of final newlines in .args files
BaumiCoder Jun 29, 2026
23f0469
Undo changes on .args files completely
BaumiCoder Jun 29, 2026
4a53e21
Adjust the handling for fish completion scripts
BaumiCoder Jun 30, 2026
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
107 changes: 107 additions & 0 deletions .ecformat_ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Ignore external repositories as checking for EditorConfig violations there
# is their responsibility and out of scope for here. See also:
# https://github.com/rust-lang/rustc-dev-guide/blob/main/src/external-repos.md
# Subtrees
src/tools/clippy
src/tools/miri
library/portable-simd
src/tools/rustfmt
src/tools/rust-analyzer
compiler/rustc_codegen_cranelift
compiler/rustc_codegen_gcc
src/doc/rustc-dev-guide
library/compiler-builtins
library/stdarch
# Submodules
src/doc/nomicon
src/tools/cargo
src/doc/reference
src/doc/book
src/doc/rust-by-example
src/doc/edition-guide
src/llvm-project
src/doc/embedded-book
library/backtrace
src/tools/rustc-perf
src/tools/enzyme
src/gcc

# Ignore binary files
src/etc/installer/gfx/*
*.auxv
*.png
*.ico
*.woff
*.woff2
tests/run-make/checksum-freshness/binary_file
tests/ui/macros/not-utf8.bin

# Some special cases cannot be handled:
# Markdown file (space indentation) with 'make' code (tab indentation)
src/doc/rustc/src/jobserver.md
# Test file with different line endings and indentations
tests/pretty/block-comment-wchar.rs
# Test file for normalize some CRFL line endings to LF
tests/ui/asm/normalize-offsets-for-crlf.s
# Test file with CR in frontmatter
tests/ui/frontmatter/content-cr.rs
# Test file which uses CRLF line endings but only inside strings
tests/ui/lexer/crlf-in-byte-string-literal.rs
# Test files with CR line ending but only in some doc comments
tests/ui/lexer/lex-bare-cr-*
tests/ui/parser/several-carriage-returns-in-doc-comment.rs
# Test file with tab indentation and one CR line ending
tests/ui/parser/bad-char-literals.rs
# Test file with CR line ending inside string
tests/ui/parser/raw/raw-byte-string-literals.rs
tests/ui/parser/trailing-carriage-return-in-string.rs

# File types with a mixed formatting which is perhaps intentional.
# Disabling only check for some properties (like indent_size) is currently not supported.

# There are different languages in these files (for example css and xml in svg files)
*.diff
*.svg
src/ci/docker/host-x86_64/disabled/dist-x86_64-dragonfly/patch-toolchain
# Often mixed indentation for example due to alignment with previous line
*.c
*.coverage
*.cpp
*.css
*.err
*.fixed
*.goml
*.h
*.js
*.ld
*.py
*.rs
*.stderr
*.stdout
*.ts
*.wxs
tests/run-make/linker-warning/*.txt
tests/run-make/macos-deployment-target-warning/*.txt
library/std/src/sys/pal/sgx/abi/entry.S
tests/pretty/block-comment-wchar.pp
tests/run-make-cargo/thumb-none-qemu/example/memory.x
src/bootstrap/mk/Makefile.in

@BaumiCoder BaumiCoder Jun 29, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Makefile uses two styles of indentation. First, for targets of a Makefile you need to use tab characters for indentation. Otherwise, it is syntactically wrong. Second, there is some further code at the beginning of this file and there 2 spaces are in use for indentation. I do not know if using only tab character for indentation would be fine for this file or not.

View changes since the review

src/etc/rust_analyzer_eglot.el
src/librustdoc/html/static/fonts/README.txt

@BaumiCoder BaumiCoder Jun 29, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The content of this README looks almost like Markdown. Only some formatting bugs may need to be fixed. Should that be changed to a Markdown file? If the content and file ending would be changed, it would not be necessary to ignore it here.

View changes since the review

# The first { in these files is always indented with one space
*.mir
# Alignment and some test files without final newline
*.html
*.html.template
# Shell scripts with the content of patches inlines
src/ci/docker/scripts/musl.sh
src/ci/docker/scripts/solaris-toolchain.sh
# Shell scripts with alignments with previous line
src/ci/docker/host-x86_64/disabled/dist-x86_64-haiku/llvm-config.sh
src/etc/pre-push.sh

# The clap_complete output uses tabs but there is a fix for the next version:
# https://github.com/clap-rs/clap/pull/6422
# When src/bootstrap/Cargo.toml is using a clap_complete version with that fix,
# this ignore can be removed.
src/etc/completions/*.fish
51 changes: 48 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,26 @@ trim_trailing_whitespace = false
[tests/**.{rs,js}]
trim_trailing_whitespace = true
# these specific source files need to have trailing whitespace.
[tests/ui/{frontmatter/frontmatter-whitespace-3.rs,parser/shebang/shebang-space.rs}]
[tests/ui/{frontmatter/{fence-whitespace-trailing-1.rs,frontmatter-whitespace-3.rs},parser/shebang/shebang-space.rs}]
trim_trailing_whitespace = false
# these specific files have an UTF-8 BOM to test with that charset
[tests/ui/codemap_tests/utf8-bom.rs]
charset = utf-8-bom
# these specific files have CRLF line endings to test on them
[tests/{rustdoc-ui/intra-doc/warning-crlf.rs,ui/{frontmatter/frontmatter-crlf.rs,lexer/lexer-crlf-*.rs}}]
end_of_line = crlf
# these specific files have an UTF-8 BOM and CRLF line endings to test on these
[tests/ui/{include-macros/data.bin,json/json-bom-plus-crlf*.rs}]
charset = utf-8-bom
end_of_line = crlf
Comment on lines +27 to +36

@bjorn3 bjorn3 Jun 29, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now a third location (next to .gitattributes and // ignore-tidy-cr in the test itself) where CRLF containing tests are placed. This is bound to go out of sync: #157184

View changes since the review

# these specific files have no trailing newline to test on these
[tests/ui/{lint/unused_parens_multibyte_recovery.rs,parser/{macro/macro-missing-right-paren.rs,missing_right_paren.rs}}]
insert_final_newline = false
[tests/{pretty/issue-74745.rs,ui/{parser/issues/issue-{62524,68730,58094-missing-right-square-bracket}.rs,type/issue-91268.rs}}]

@BaumiCoder BaumiCoder Jun 29, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These files all have the name pattern issue-*.rs. Using the pattern would reduce the maintenance effort, if new such files without final newlines gets added to the project. However, not all files with that pattern are without a final newline.

View changes since the review

insert_final_newline = false
# Most args files have to be without final newline, otherwise tests in aarch64-gnu-llvm-21-1 fail
[tests/**.args]
insert_final_newline = false

[src/llvm-project]
indent_style = unset
Expand All @@ -36,9 +54,36 @@ max_line_length = 100
# double whitespace at end of line
# denotes a line break in Markdown
trim_trailing_whitespace = false
# Markdown has heavily context specific indentations.
# For example, the indentation in lists depend on the length of the list marker
# (such as '- ' or '100. '), at least in the GitHub Markdown flavor:
# https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#nested-lists
# Therefore, pressing tab should insert a single space to encourage situative accurate indentations.

@BaumiCoder BaumiCoder Jun 29, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is maybe a matter of taste if inserting only one space with a tab is a nice solution for this or not. Another one would be to keep the default indent_size = 4 for Markdown files and ignore them when checking for EditorConfig violations.

View changes since the review

indent_size = 1

[*.yml]
[*.{json,json5,yml,yaml,askama,ll,natvis,nix}]
indent_size = 2

[Makefile]
[{src/doc/full-toc.inc,src/etc/xhelp,src/tools/nix-dev-shell/envrc-flake}]
indent_size = 2

# You should NOT modify these files with your editor,
# but if you do it anyway use the correct formatting.
[Cargo.lock]
indent_size = 1
[yarn.lock]
indent_size = 2

[{Makefile,Makefile.in,.gitmodules}]
indent_style = tab

# The license texts should NEVER be modified.
# Therefore disable everything to avoid accidental changes on save.
[**{LICENSE,COPY{ING,RIGHT}}**]
charset = unset
indent_style = unset
indent_size = unset
tab_width = unset
trim_trailing_whitespace = unset
insert_final_newline = unset
spelling_language = unset
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/diagnostics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ body:
label: Anything else?
description: If you have more details you want to give us to reproduce this issue, please add it here
validations:
required: false
required: false
102 changes: 51 additions & 51 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +2,61 @@
resolver = "2"
members = [
# tidy-alphabetical-start
"compiler/rustc",
"src/build_helper",
"src/rustc-std-workspace/rustc-std-workspace-alloc",
"src/rustc-std-workspace/rustc-std-workspace-core",
"src/rustc-std-workspace/rustc-std-workspace-std",
"src/rustdoc-json-types",
"src/tools/build-manifest",
"src/tools/bump-stage0",
"src/tools/cargotest",
"src/tools/clippy",
"src/tools/clippy/clippy_dev",
"src/tools/collect-license-metadata",
"src/tools/compiletest",
"src/tools/coverage-dump",
"src/tools/features-status-dump",
"src/tools/generate-copyright",
"src/tools/generate-windows-sys",
"src/tools/html-checker",
"src/tools/jsondocck",
"src/tools/jsondoclint",
"src/tools/linkchecker",
"src/tools/lint-docs",
"src/tools/lld-wrapper",
"src/tools/llvm-bitcode-linker",
"src/tools/miri",
"src/tools/miri/cargo-miri",
"src/tools/miropt-test-tools",
"src/tools/opt-dist",
"src/tools/remote-test-client",
"src/tools/remote-test-server",
"src/tools/replace-version-placeholder",
"src/tools/run-make-support",
"src/tools/rust-installer",
"src/tools/rustdoc",
"src/tools/rustdoc-gui-test",
"src/tools/rustdoc-themes",
"src/tools/rustfmt",
"src/tools/test-float-parse",
"src/tools/tidy",
"src/tools/tier-check",
"src/tools/unicode-table-generator",
"src/tools/unstable-book-gen",
"src/tools/wasm-component-ld",
"src/tools/x",
"compiler/rustc",
"src/build_helper",
"src/rustc-std-workspace/rustc-std-workspace-alloc",
"src/rustc-std-workspace/rustc-std-workspace-core",
"src/rustc-std-workspace/rustc-std-workspace-std",
"src/rustdoc-json-types",
"src/tools/build-manifest",
"src/tools/bump-stage0",
"src/tools/cargotest",
"src/tools/clippy",
"src/tools/clippy/clippy_dev",
"src/tools/collect-license-metadata",
"src/tools/compiletest",
"src/tools/coverage-dump",
"src/tools/features-status-dump",
"src/tools/generate-copyright",
"src/tools/generate-windows-sys",
"src/tools/html-checker",
"src/tools/jsondocck",
"src/tools/jsondoclint",
"src/tools/linkchecker",
"src/tools/lint-docs",
"src/tools/lld-wrapper",
"src/tools/llvm-bitcode-linker",
"src/tools/miri",
"src/tools/miri/cargo-miri",
"src/tools/miropt-test-tools",
"src/tools/opt-dist",
"src/tools/remote-test-client",
"src/tools/remote-test-server",
"src/tools/replace-version-placeholder",
"src/tools/run-make-support",
"src/tools/rust-installer",
"src/tools/rustdoc",
"src/tools/rustdoc-gui-test",
"src/tools/rustdoc-themes",
"src/tools/rustfmt",
"src/tools/test-float-parse",
"src/tools/tidy",
"src/tools/tier-check",
"src/tools/unicode-table-generator",
"src/tools/unstable-book-gen",
"src/tools/wasm-component-ld",
"src/tools/x",
# tidy-alphabetical-end
]

exclude = [
"build",
"compiler/rustc_codegen_cranelift",
"compiler/rustc_codegen_gcc",
"src/bootstrap",
"tests/rustdoc-gui",
# HACK(eddyb) This hardcodes the fact that our CI uses `/checkout/obj`.
"obj",
"build",
"compiler/rustc_codegen_cranelift",
"compiler/rustc_codegen_gcc",
"src/bootstrap",
"tests/rustdoc-gui",
# HACK(eddyb) This hardcodes the fact that our CI uses `/checkout/obj`.
"obj",
]

[profile.release.package.rustc_thread_pool]
Expand Down
1 change: 1 addition & 0 deletions REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ path = [
"x.ps1",
"x.py",
".clang-format",
".ecformat_ignore",
".editorconfig",
".git-blame-ignore-revs",
".gitattributes",
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc/Windows Manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ See: https://docs.microsoft.com/en-us/windows/win32/sbscs/application-manifests
-->
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<!-- Versions rustc supports as compiler hosts -->
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 7 --><supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows 8 --><supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 8.1 --><supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 10 and 11 --><supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</application>
</compatibility>
<!-- Use UTF-8 code page -->
<asmv3:application>
Expand Down
14 changes: 7 additions & 7 deletions library/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ cargo-features = ["profile-rustflags"]
[workspace]
resolver = "1"
members = [
"std",
"sysroot",
"coretests",
"alloctests",
"std",
"sysroot",
"coretests",
"alloctests",
]

exclude = [
# stdarch has its own Cargo workspace
"stdarch",
"windows_link"
# stdarch has its own Cargo workspace
"stdarch",
"windows_link"
]

[profile.release.package.compiler_builtins]
Expand Down
2 changes: 1 addition & 1 deletion library/rustc-std-workspace-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ doc = false
[dependencies]
core = { path = "../core", public = true }
compiler_builtins = { path = "../compiler-builtins/compiler-builtins", features = [
"compiler-builtins",
"compiler-builtins",
] }
2 changes: 1 addition & 1 deletion library/std/src/sys/pal/sgx/abi/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ elf_entry:
sub %rax,%rdx /* all chars written? */
jnz .Lelf_entry_call

.Lelf_exit:
.Lelf_exit:
movq $60,%rax /* exit() syscall */
movq $1,%rdi /* exit code 1 */
syscall
Expand Down
2 changes: 1 addition & 1 deletion library/unwind/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/rust.git"
edition = "2024"
include = [
'/libunwind/*',
'/libunwind/*',
]

[lib]
Expand Down
Loading
Loading