Skip to content

Commit d0762f0

Browse files
committed
always emit consider AutoImplCandidates for them if they don't also have a ProjectionCandidate
0 parents  commit d0762f0

File tree

1,613 files changed

+89154
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,613 files changed

+89154
-0
lines changed

.editorconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 2
7+
indent_style = space
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.rs]
15+
indent_size = 4
16+
17+
[tests/**/*.rs]
18+
charset = utf-8
19+
end_of_line = unset
20+
indent_size = unset
21+
indent_style = unset
22+
trim_trailing_whitespace = unset
23+
insert_final_newline = unset

.gitattributes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
* text=auto eol=lf
2+
tests/source/issue-3494/crlf.rs -text
3+
tests/source/comment_crlf_newline.rs -text
4+
tests/source/configs/enum_discrim_align_threshold/40.rs -text
5+
tests/target/issue-3494/crlf.rs -text
6+
tests/target/comment_crlf_newline.rs -text
7+
tests/target/configs/enum_discrim_align_threshold/40.rs -text

.github/workflows/check_diff.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Diff Check
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
clone_url:
6+
description: 'Git url of a rustfmt fork to compare against the latest master rustfmt'
7+
required: true
8+
branch_name:
9+
description: 'Name of the feature branch on the forked repo'
10+
required: true
11+
commit_hash:
12+
description: 'Optional commit hash from the feature branch'
13+
required: false
14+
rustfmt_configs:
15+
description: 'Optional comma separated list of rustfmt config options to pass when running the feature branch'
16+
required: false
17+
18+
jobs:
19+
diff_check:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: checkout
24+
uses: actions/checkout@v3
25+
26+
- name: install rustup
27+
run: |
28+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
29+
sh rustup-init.sh -y --default-toolchain none
30+
rustup target add x86_64-unknown-linux-gnu
31+
32+
- name: check diff
33+
run: bash ${GITHUB_WORKSPACE}/ci/check_diff.sh ${{ github.event.inputs.clone_url }} ${{ github.event.inputs.branch_name }} ${{ github.event.inputs.commit_hash }} ${{ github.event.inputs.rustfmt_configs }}

.github/workflows/integration.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: integration
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
8+
jobs:
9+
integration-tests:
10+
runs-on: ubuntu-latest
11+
name: ${{ matrix.integration }}
12+
strategy:
13+
# https://help.github.com/en/actions/getting-started-with-github-actions/about-github-actions#usage-limits
14+
# There's a limit of 60 concurrent jobs across all repos in the rust-lang organization.
15+
# In order to prevent overusing too much of that 60 limit, we throttle the
16+
# number of rustfmt jobs that will run concurrently.
17+
max-parallel: 4
18+
fail-fast: false
19+
matrix:
20+
integration: [
21+
bitflags,
22+
error-chain,
23+
log,
24+
mdbook,
25+
packed_simd,
26+
rust-semverver,
27+
tempdir,
28+
futures-rs,
29+
rust-clippy,
30+
]
31+
include:
32+
# Allowed Failures
33+
# Actions doesn't yet support explicitly marking matrix legs as allowed failures
34+
# https://github.community/t5/GitHub-Actions/continue-on-error-allow-failure-UI-indication/td-p/37033
35+
# https://github.community/t5/GitHub-Actions/Why-a-matrix-step-will-be-canceled-if-another-one-failed/td-p/30920
36+
# Instead, leverage `continue-on-error`
37+
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error
38+
#
39+
# Failing due to breaking changes in rustfmt 2.0 where empty
40+
# match blocks have trailing commas removed
41+
# https://github.com/rust-lang/rustfmt/pull/4226
42+
- integration: chalk
43+
allow-failure: true
44+
- integration: crater
45+
allow-failure: true
46+
- integration: glob
47+
allow-failure: true
48+
- integration: stdsimd
49+
allow-failure: true
50+
# Using old rustfmt configuration option
51+
- integration: rand
52+
allow-failure: true
53+
# Keep this as an allowed failure as it's fragile to breaking changes of rustc.
54+
- integration: rust-clippy
55+
allow-failure: true
56+
# Using old rustfmt configuration option
57+
- integration: packed_simd
58+
allow-failure: true
59+
# calebcartwright (2019-12-24)
60+
# Keeping this as an allowed failure since it was flagged as such in the TravisCI config, even though
61+
# it appears to have been passing for quite some time.
62+
# Original comment was: temporal build failure due to breaking changes in the nightly compiler
63+
- integration: rust-semverver
64+
allow-failure: true
65+
66+
steps:
67+
- name: checkout
68+
uses: actions/checkout@v3
69+
70+
# Run build
71+
- name: install rustup
72+
run: |
73+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
74+
sh rustup-init.sh -y --default-toolchain none
75+
76+
- name: run integration tests
77+
env:
78+
INTEGRATION: ${{ matrix.integration }}
79+
TARGET: x86_64-unknown-linux-gnu
80+
run: ./ci/integration.sh
81+
continue-on-error: ${{ matrix.allow-failure == true }}

.github/workflows/linux.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: linux
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
name: (${{ matrix.target }}, ${{ matrix.cfg_release_channel }})
12+
env:
13+
CFG_RELEASE_CHANNEL: ${{ matrix.cfg_release_channel }}
14+
strategy:
15+
# https://help.github.com/en/actions/getting-started-with-github-actions/about-github-actions#usage-limits
16+
# There's a limit of 60 concurrent jobs across all repos in the rust-lang organization.
17+
# In order to prevent overusing too much of that 60 limit, we throttle the
18+
# number of rustfmt jobs that will run concurrently.
19+
max-parallel: 1
20+
fail-fast: false
21+
matrix:
22+
target: [
23+
x86_64-unknown-linux-gnu,
24+
]
25+
cfg_release_channel: [nightly, stable]
26+
27+
steps:
28+
- name: checkout
29+
uses: actions/checkout@v3
30+
31+
# Run build
32+
- name: install rustup
33+
run: |
34+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
35+
sh rustup-init.sh -y --default-toolchain none
36+
rustup target add ${{ matrix.target }}
37+
38+
- name: Build and Test
39+
run: ./ci/build_and_test.sh

.github/workflows/mac.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: mac
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources
11+
# macOS Catalina 10.15
12+
runs-on: macos-latest
13+
name: (${{ matrix.target }}, ${{ matrix.cfg_release_channel }})
14+
env:
15+
CFG_RELEASE_CHANNEL: ${{ matrix.cfg_release_channel }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
target: [
20+
x86_64-apple-darwin,
21+
]
22+
cfg_release_channel: [nightly, stable]
23+
24+
steps:
25+
- name: checkout
26+
uses: actions/checkout@v3
27+
28+
# Run build
29+
- name: install rustup
30+
run: |
31+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
32+
sh rustup-init.sh -y --default-toolchain none
33+
rustup target add ${{ matrix.target }}
34+
35+
- name: Build and Test
36+
run: ./ci/build_and_test.sh

.github/workflows/rustdoc_check.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: rustdoc check
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
8+
jobs:
9+
rustdoc_check:
10+
runs-on: ubuntu-latest
11+
name: rustdoc check
12+
steps:
13+
- name: checkout
14+
uses: actions/checkout@v3
15+
16+
- name: install rustup
17+
run: |
18+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
19+
sh rustup-init.sh -y --default-toolchain none
20+
rustup target add x86_64-unknown-linux-gnu
21+
22+
- name: document rustfmt
23+
env:
24+
RUSTDOCFLAGS: --document-private-items --enable-index-page --show-type-layout --generate-link-to-definition -Zunstable-options -Dwarnings
25+
run: cargo doc -Zskip-rustdoc-fingerprint --no-deps -p rustfmt-nightly -p rustfmt-config_proc_macro

.github/workflows/upload-assets.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: upload
2+
3+
on:
4+
push:
5+
release:
6+
types: [created]
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-release:
11+
name: build-release
12+
strategy:
13+
matrix:
14+
build: [linux-x86_64, macos-x86_64, windows-x86_64-gnu, windows-x86_64-msvc]
15+
include:
16+
- build: linux-x86_64
17+
os: ubuntu-latest
18+
rust: nightly
19+
target: x86_64-unknown-linux-gnu
20+
- build: macos-x86_64
21+
os: macos-latest
22+
rust: nightly
23+
target: x86_64-apple-darwin
24+
- build: windows-x86_64-gnu
25+
os: windows-latest
26+
rust: nightly-x86_64-gnu
27+
target: x86_64-pc-windows-gnu
28+
- build: windows-x86_64-msvc
29+
os: windows-latest
30+
rust: nightly-x86_64-msvc
31+
target: x86_64-pc-windows-msvc
32+
runs-on: ${{ matrix.os }}
33+
steps:
34+
- uses: actions/checkout@v3
35+
36+
# Run build
37+
- name: install rustup
38+
run: |
39+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup-init.sh
40+
sh rustup-init.sh -y --default-toolchain none
41+
rustup target add ${{ matrix.target }}
42+
43+
- name: Add mingw64 to path for x86_64-gnu
44+
run: echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
45+
if: matrix.rust == 'nightly-x86_64-gnu'
46+
shell: bash
47+
48+
- name: Build release binaries
49+
run: cargo build --release
50+
51+
- name: Build archive
52+
shell: bash
53+
run: |
54+
staging="rustfmt_${{ matrix.build }}_${{ github.event.release.tag_name }}"
55+
mkdir -p "$staging"
56+
57+
cp {README.md,Configurations.md,CHANGELOG.md,LICENSE-MIT,LICENSE-APACHE} "$staging/"
58+
59+
if [ "${{ matrix.os }}" = "windows-latest" ]; then
60+
cp target/release/{rustfmt.exe,cargo-fmt.exe,rustfmt-format-diff.exe,git-rustfmt.exe} "$staging/"
61+
7z a "$staging.zip" "$staging"
62+
echo "ASSET=$staging.zip" >> $GITHUB_ENV
63+
else
64+
cp target/release/{rustfmt,cargo-fmt,rustfmt-format-diff,git-rustfmt} "$staging/"
65+
tar czf "$staging.tar.gz" "$staging"
66+
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
67+
fi
68+
69+
- name: Upload Release Asset
70+
if: github.event_name == 'release'
71+
uses: actions/upload-release-asset@v1
72+
env:
73+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
with:
75+
upload_url: ${{ github.event.release.upload_url }}
76+
asset_path: ${{ env.ASSET }}
77+
asset_name: ${{ env.ASSET }}
78+
asset_content_type: application/octet-stream

.github/workflows/windows.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: windows
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: windows-latest
11+
name: (${{ matrix.target }}, ${{ matrix.cfg_release_channel }})
12+
env:
13+
CFG_RELEASE_CHANNEL: ${{ matrix.cfg_release_channel }}
14+
strategy:
15+
# https://help.github.com/en/actions/getting-started-with-github-actions/about-github-actions#usage-limits
16+
# There's a limit of 60 concurrent jobs across all repos in the rust-lang organization.
17+
# In order to prevent overusing too much of that 60 limit, we throttle the
18+
# number of rustfmt jobs that will run concurrently.
19+
max-parallel: 2
20+
fail-fast: false
21+
matrix:
22+
target: [
23+
i686-pc-windows-gnu,
24+
i686-pc-windows-msvc,
25+
x86_64-pc-windows-gnu,
26+
x86_64-pc-windows-msvc,
27+
]
28+
cfg_release_channel: [nightly, stable]
29+
30+
steps:
31+
# The Windows runners have autocrlf enabled by default
32+
# which causes failures for some of rustfmt's line-ending sensitive tests
33+
- name: disable git eol translation
34+
run: git config --global core.autocrlf false
35+
- name: checkout
36+
uses: actions/checkout@v3
37+
38+
# Run build
39+
- name: Install Rustup using win.rustup.rs
40+
run: |
41+
# Disable the download progress bar which can cause perf issues
42+
$ProgressPreference = "SilentlyContinue"
43+
Invoke-WebRequest https://win.rustup.rs/ -OutFile rustup-init.exe
44+
.\rustup-init.exe -y --default-host=x86_64-pc-windows-msvc --default-toolchain=none
45+
del rustup-init.exe
46+
rustup target add ${{ matrix.target }}
47+
shell: powershell
48+
49+
- name: Add mingw32 to path for i686-gnu
50+
run: |
51+
echo "C:\msys64\mingw32\bin" >> $GITHUB_PATH
52+
if: matrix.target == 'i686-pc-windows-gnu' && matrix.channel == 'nightly'
53+
shell: bash
54+
55+
- name: Add mingw64 to path for x86_64-gnu
56+
run: echo "C:\msys64\mingw64\bin" >> $GITHUB_PATH
57+
if: matrix.target == 'x86_64-pc-windows-gnu' && matrix.channel == 'nightly'
58+
shell: bash
59+
60+
- name: Build and Test
61+
shell: cmd
62+
run: ci\build_and_test.bat

0 commit comments

Comments
 (0)