Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/check_diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: integration
on:
push:
branches:
- master
- main
pull_request:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: linux
on:
push:
branches:
- master
- main
pull_request:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: mac
on:
push:
branches:
- master
- main
pull_request:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rustdoc_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: rustdoc check
on:
push:
branches:
- master
- main
pull_request:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: windows
on:
push:
branches:
- master
- main
pull_request:

jobs:
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
2 changes: 1 addition & 1 deletion Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Processes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions check_diff/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion check_diff/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 6 additions & 6 deletions ci/check_diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -129,7 +129,7 @@
shouldStable: false,
viewVersion: versionNumber,
oldViewVersion: undefined,
versionOptions: ['master'],
versionOptions: ['main'],
scrolledOnce: false,
},
asyncComputed: {
Expand Down
2 changes: 1 addition & 1 deletion src/closures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(..)
Expand Down
Loading