diff --git a/.github/workflows/check_diff.yml b/.github/workflows/check_diff.yml index 99daa0addf5..6f139a4ace2 100644 --- a/.github/workflows/check_diff.yml +++ b/.github/workflows/check_diff.yml @@ -3,7 +3,7 @@ on: workflow_dispatch: inputs: clone_url: - description: 'Git url of a rustfmt fork to compare against the latest master rustfmt' + description: 'Git url of a rustfmt fork to compare against the latest rustfmt' required: true branch_name: description: 'Name of the feature branch on the forked repo' diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index bda374562bc..c1b04721cb1 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -2,7 +2,7 @@ name: integration on: push: branches: - - master + - main pull_request: jobs: diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 3a5e6ab5404..369b048f12f 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -2,7 +2,7 @@ name: linux on: push: branches: - - master + - main pull_request: jobs: diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 2c766d0573b..b2e8401131b 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -2,7 +2,7 @@ name: mac on: push: branches: - - master + - main pull_request: jobs: diff --git a/.github/workflows/rustdoc_check.yml b/.github/workflows/rustdoc_check.yml index 6e8a7ecd7ad..c92732366ed 100644 --- a/.github/workflows/rustdoc_check.yml +++ b/.github/workflows/rustdoc_check.yml @@ -2,7 +2,7 @@ name: rustdoc check on: push: branches: - - master + - main pull_request: jobs: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 728f1b90b13..ef8d54fb93f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -2,7 +2,7 @@ name: windows on: push: branches: - - master + - main pull_request: jobs: diff --git a/CHANGELOG.md b/CHANGELOG.md index 69fc38a416d..483a34826a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,7 +30,7 @@ - Add `style_edition=2027` to gate unstable formatting [#6324](https://github.com/rust-lang/rustfmt/pull/6324) - Support discovering and formatting files via external mods imported within `cfg_match`, similar to `cfg_if` behavior [#6522](https://github.com/rust-lang/rustfmt/pull/6522) - Add new nightly-only `match_arm_indent` option [#6525](https://github.com/rust-lang/rustfmt/pull/6525) - - more details in the [configuration section for this new option](https://github.com/rust-lang/rustfmt/blob/master/Configurations.md#match_arm_indent) + - more details in the [configuration section for this new option](https://github.com/rust-lang/rustfmt/blob/HEAD/Configurations.md#match_arm_indent) ## [1.8.0] 2024-09-20 @@ -331,7 +331,7 @@ ### Added -- New configuration option [`skip_macro_invocations`](https://rust-lang.github.io/rustfmt/?version=master&search=#skip_macro_invocations) [#5347](https://github.com/rust-lang/rustfmt/pull/5347) that can be used to globally define a single enumerated list of macro calls that rustfmt should skip formatting. rustfmt [currently also supports this via a custom tool attribute](https://github.com/rust-lang/rustfmt#tips), however, these cannot be used in all contexts because [custom inner attributes are unstable](https://github.com/rust-lang/rust/issues/54726) +- New configuration option [`skip_macro_invocations`](https://rust-lang.github.io/rustfmt/?version=main&search=#skip_macro_invocations) [#5347](https://github.com/rust-lang/rustfmt/pull/5347) that can be used to globally define a single enumerated list of macro calls that rustfmt should skip formatting. rustfmt [currently also supports this via a custom tool attribute](https://github.com/rust-lang/rustfmt#tips), however, these cannot be used in all contexts because [custom inner attributes are unstable](https://github.com/rust-lang/rust/issues/54726) ### Misc diff --git a/Configurations.md b/Configurations.md index fce37eecac3..d7fd0f862d7 100644 --- a/Configurations.md +++ b/Configurations.md @@ -2564,7 +2564,7 @@ See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuri ## `single_line_let_else_max_width` Maximum line length for single line let-else statements. -See the [let-else statement section of the Rust Style Guide](https://github.com/rust-lang/rust/blob/master/src/doc/style-guide/src/statements.md#else-blocks-let-else-statements) for more details on when a let-else statement may be written on a single line. +See the [let-else statement section of the Rust Style Guide](https://github.com/rust-lang/rust/blob/HEAD/src/doc/style-guide/src/statements.md#else-blocks-let-else-statements) for more details on when a let-else statement may be written on a single line. A value of `0` (zero) means the divergent `else` block will always be formatted over multiple lines. Note this occurs when `use_small_heuristics` is set to `Off`. diff --git a/Contributing.md b/Contributing.md index 313d5bf31b9..3591e23b435 100644 --- a/Contributing.md +++ b/Contributing.md @@ -157,7 +157,7 @@ format. There are different nodes for every kind of item and expression in Rust. For more details see the source code in the compiler - -[ast.rs](https://github.com/rust-lang/rust/blob/master/compiler/rustc_ast/src/ast.rs) - and/or the +[ast.rs](https://github.com/rust-lang/rust/blob/HEAD/compiler/rustc_ast/src/ast.rs) - and/or the [docs](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/ast/index.html). Many nodes in the AST (but not all, annoyingly) have a `Span`. A `Span` is a diff --git a/Processes.md b/Processes.md index 64ef20a9bd7..31445588852 100644 --- a/Processes.md +++ b/Processes.md @@ -36,7 +36,7 @@ For example, 1.0.0 -> 1.0.1: +version = "1.0.1" ``` -## 2. Push the commit to the master branch +## 2. Push the commit to the main branch E.g., https://github.com/rust-lang/rustfmt/commit/5274b49caa1a7db6ac10c76bf1a3d5710ccef569 diff --git a/check_diff/src/lib.rs b/check_diff/src/lib.rs index 90dbd5cc729..239cab77984 100644 --- a/check_diff/src/lib.rs +++ b/check_diff/src/lib.rs @@ -325,7 +325,7 @@ pub fn build_rustfmt_from_src( //Because we're building standalone binaries we need to set `LD_LIBRARY_PATH` so each // binary can find it's runtime dependencies. // See https://github.com/rust-lang/rustfmt/issues/5675 - // This will prepend the `LD_LIBRARY_PATH` for the master rustfmt binary + // This will prepend the `LD_LIBRARY_PATH` for the main rustfmt binary let ld_lib_path = get_ld_library_path(&dir)?; info!("Building rustfmt from source"); @@ -348,7 +348,7 @@ pub fn build_rustfmt_from_src( } // Compiles and produces two rustfmt binaries. -// One for the current master, and another for the feature branch +// One for the current main branch, and another for the feature branch // Parameters: // dest: Directory where rustfmt will be cloned pub fn compile_rustfmt( diff --git a/check_diff/src/main.rs b/check_diff/src/main.rs index f4ce3572faa..9c14c5f08cd 100644 --- a/check_diff/src/main.rs +++ b/check_diff/src/main.rs @@ -6,7 +6,7 @@ use tracing::info; /// Inputs for the check_diff script #[derive(Parser)] struct CliInputs { - /// Git url of a rustfmt fork to compare against the latest master rustfmt + /// Git url of a rustfmt fork to compare against the latest main rustfmt remote_repo_url: String, /// Name of the feature branch on the forked repo feature_branch: String, diff --git a/ci/check_diff.sh b/ci/check_diff.sh index 2a29cb138ef..befb6825901 100755 --- a/ci/check_diff.sh +++ b/ci/check_diff.sh @@ -59,17 +59,17 @@ function create_diff() { done } -# Run the master rustfmt binary and the feature branch binary in the current directory and compare the diffs +# Run the main rustfmt binary and the feature branch binary in the current directory and compare the diffs # # Parameters # $1: Name of the repository (used for logging) # # Globals: -# $RUSFMT_BIN: Path to the rustfmt master binary. Created when running `compile_rustfmt` +# $RUSFMT_BIN: Path to the rustfmt main binary. Created when running `compile_rustfmt` # $FEATURE_BIN: Path to the rustfmt feature binary. Created when running `compile_rustfmt` # $OPTIONAL_RUSTFMT_CONFIGS: Optional configs passed to the script from $4 function check_diff() { - echo "running rustfmt (master) on $1" + echo "running rustfmt (main) on $1" create_diff $RUSFMT_BIN rustfmt_diff.txt echo "running rustfmt (feature) on $1" @@ -96,7 +96,7 @@ function check_diff() { } # Compiles and produces two rustfmt binaries. -# One for the current master, and another for the feature branch +# One for the current main branch, and another for the feature branch # # Parameters: # $1: Directory where rustfmt will be cloned @@ -116,7 +116,7 @@ function compile_rustfmt() { # Because we're building standalone binaries we need to set `LD_LIBRARY_PATH` so each # binary can find it's runtime dependencies. See https://github.com/rust-lang/rustfmt/issues/5675 - # This will prepend the `LD_LIBRARY_PATH` for the master rustfmt binary + # This will prepend the `LD_LIBRARY_PATH` for the main rustfmt binary export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib:$LD_LIBRARY_PATH echo "Building rustfmt from src" @@ -171,7 +171,7 @@ function check_repo() { # rustfmt --check returns 1 if a diff was found - # Also check_diff returns 1 if there was a diff between master rustfmt and the feature branch + # Also check_diff returns 1 if there was a diff between main rustfmt and the feature branch # so we want to ignore the exit status check set +e check_diff $REPO_NAME diff --git a/docs/index.html b/docs/index.html index e6015bd071d..5145a92027b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -114,11 +114,11 @@ const searchTerm = null !== searchParam ? searchParam : ''; const versionParam = queryParams.get('version'); const parseVersionParam = (version) => { - if (version === 'master') return 'master'; + if (version === 'main') return 'main'; if (version.startsWith('v')) return version; return `v${version}`; }; - const versionNumber = null !== versionParam ? parseVersionParam(versionParam) : 'master'; + const versionNumber = null !== versionParam ? parseVersionParam(versionParam) : 'main'; new Vue({ el: '#app', data: { @@ -129,7 +129,7 @@ shouldStable: false, viewVersion: versionNumber, oldViewVersion: undefined, - versionOptions: ['master'], + versionOptions: ['main'], scrolledOnce: false, }, asyncComputed: { diff --git a/src/closures.rs b/src/closures.rs index ca733e7aaaf..1ab1a80f863 100644 --- a/src/closures.rs +++ b/src/closures.rs @@ -483,7 +483,7 @@ fn is_block_closure_forced_inner(expr: &ast::Expr, style_edition: StyleEdition) /// if true {...} else {...} /// |x| 5 /// isn't parsed as (if true {...} else {...} | x) | 5 -// From https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/classify.rs. +// From https://github.com/rust-lang/rust/blob/HEAD/src/libsyntax/parse/classify.rs. fn expr_requires_semi_to_be_stmt(e: &ast::Expr) -> bool { match e.kind { ast::ExprKind::If(..)