Skip to content

Subtree update of rust-analyzer #138305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 74 commits into from
Mar 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
66368aa
Allow unsetting default cfgs
Veykril Feb 27, 2025
f19b205
Warn when the used toolchain looks too old for rust-analyzer
Veykril Feb 27, 2025
43c5e95
Normalize some assist names
Veykril Mar 2, 2025
2f9e558
add diagnostic for dangling dyn
Shourya742 Mar 2, 2025
1840f57
add diagnostic for dangling impl
Shourya742 Mar 2, 2025
c2a630e
Add dangling impl
Shourya742 Mar 3, 2025
c315ad9
Support tuple struct patterns for expand_rest_pattern assist
Veykril Mar 2, 2025
6610e60
Merge pull request #19244 from Veykril/push-nmnrnlysvyvk
Veykril Mar 3, 2025
73e0fe1
Merge pull request #19243 from Veykril/push-qrrqsywkwyzp
Veykril Mar 3, 2025
16644ba
Merge pull request #19261 from Veykril/push-rnqlyrvqpols
Veykril Mar 3, 2025
de07b17
Bump minimum supported toolchain to 1.82
lnicola Mar 3, 2025
d137fee
Merge pull request #19275 from lnicola/min-1-82
Veykril Mar 3, 2025
0d6dfc8
Improve keyword completion for 'let' and 'let mut'
Natural-selection1 Mar 4, 2025
120d549
change 'let mut' keyword completion into 'ietm' snippet
Natural-selection1 Mar 4, 2025
b9d157c
Twiddle with the rustup invocation on CI
lnicola Mar 5, 2025
9a8968f
Merge pull request #19265 from Shourya742/2025-03-01-add-dangling-dyn…
lnicola Mar 5, 2025
e260467
Merge pull request #19286 from lnicola/twiddle-ci
lnicola Mar 5, 2025
0ffef9b
minicore: Add size_of to prelude and add rust_2024 prelude
thaliaarchi Mar 5, 2025
653801b
Use size_of from the prelude instead of imported
thaliaarchi Mar 5, 2025
5ad05fb
Merge pull request #19288 from thaliaarchi/use-prelude-size-of
Veykril Mar 5, 2025
5421fba
add test cases for 'letm' keyword completion
Natural-selection1 Mar 5, 2025
049f4db
Add warning and debug information when `cargo metadata` fails
aibaars Mar 5, 2025
52525bc
Improve tracing log format in cargo_workspace.rs
aibaars Mar 5, 2025
87815f7
Use HIR unsafety information for unsafe syntax highlightng
Veykril Mar 3, 2025
b9f5453
Merge pull request #19274 from Veykril/push-pouwrwwrlrlt
Veykril Mar 5, 2025
8641805
Fix syntax highlightingg punct filtering ignoring mods
Veykril Mar 5, 2025
363297d
Merge pull request #19279 from Natural-selection1/master
Veykril Mar 5, 2025
2cff701
Merge pull request #19292 from Veykril/push-zonnrrlosqmv
Veykril Mar 5, 2025
bee6cdd
fix: Make RustAnalyzer:Run available in manifest file
alibektas Mar 5, 2025
d95d278
Adjust relevance scoring threshold to consistent with existing implem…
Natural-selection1 Mar 6, 2025
86741ea
Merge pull request #19297 from Natural-selection1/master
Veykril Mar 6, 2025
2e6292c
Merge pull request #19295 from alibektas/rust_analyzer_run_on_cargo_toml
Veykril Mar 6, 2025
66a1164
Change `%e` to `?e` to include detailed error message
aibaars Mar 6, 2025
6a3ede1
Merge pull request #19290 from aibaars/patch-1
Veykril Mar 6, 2025
860637a
Normalize projections in evaluated const display and layout calculation
ChayimFriedman2 Feb 27, 2025
fcb34b1
Pass the target crate in `HirFormatter`
ChayimFriedman2 Feb 27, 2025
92de0ff
Use correct crate for trait env in `render_const_scalar()`
ChayimFriedman2 Feb 27, 2025
0bd3229
Warn the user when a rename will change the meaning of the program
ChayimFriedman2 Feb 1, 2025
b58fc9c
Mark `rust-analyzer.showSyntaxTree` config option as requiring server…
ChayimFriedman2 Mar 6, 2025
c4f727b
Merge pull request #19304 from ChayimFriedman2/restart-syntax-tree
ChayimFriedman2 Mar 6, 2025
f68fd66
Fix logical error in relevance scoring implementation
Natural-selection1 Mar 7, 2025
16878eb
Refactor relevance scoring to use a named constant BASE_SCORE
Natural-selection1 Mar 7, 2025
c8d9d5a
Move project MSRV back to 1.78
Veykril Mar 7, 2025
5c6a124
Pop up a notification for the MSRV project loading warning
Veykril Mar 7, 2025
02c9b7c
Merge pull request #19307 from Natural-selection1/master
Veykril Mar 7, 2025
d11c5b8
Merge pull request #19308 from Veykril/push-rnrxutwlvmly
Veykril Mar 7, 2025
bdf602a
Log build script error output in `load_cargo::load_workspace_at`
aibaars Mar 7, 2025
e98837f
fix(hir): `VariantDef` is `impl HasSource`
snprajwal Mar 7, 2025
b6f1ce8
fix: do not apply editorconfig to git commit msg
snprajwal Mar 7, 2025
e88f892
Fix syntax fixup producing invalid punctuation
Feb 28, 2025
fee83ba
Generated doc update
Feb 28, 2025
bb82831
Bump chalk for built-in supports of async closures
ShoyuVanilla Feb 26, 2025
0e4f189
internal: Migrate `inline_local_variable` to `SyntaxEditor`
ShoyuVanilla Mar 9, 2025
965a0c0
fix: Prevent wrong invocations of `needs_parens_in` with non-ancestra…
ShoyuVanilla Mar 9, 2025
60da021
Merge pull request #19324 from ShoyuVanilla/migrate-inline-var
Veykril Mar 9, 2025
e1912f8
Rank ADT constructors as constructors for completion scoring
Veykril Mar 9, 2025
129545f
Merge pull request #19325 from Veykril/push-sxyvwwsmtxrr
Veykril Mar 10, 2025
f36e2ea
Merge pull request #19232 from ShoyuVanilla/issue-19196
Veykril Mar 10, 2025
b2501ef
Merge pull request #19252 from flodiebold/fix-fixup-delimiters
Veykril Mar 10, 2025
b2a4f3d
Merge pull request #19316 from snprajwal/git-commit-ec
Veykril Mar 10, 2025
71b9103
Merge pull request #19314 from snprajwal/variantdef-impl
Veykril Mar 10, 2025
c961ee6
Merge pull request #19311 from aibaars/log-build-script-error
Veykril Mar 10, 2025
7ee9ce8
Fix `path` macro hygiene
Veykril Mar 10, 2025
fdee1c1
Preparing for merge from rust-lang/rust
lnicola Mar 10, 2025
e1da1b0
Merge from rust-lang/rust
lnicola Mar 10, 2025
f53d1eb
Merge pull request #19327 from Veykril/push-qyyvkulltzpz
Veykril Mar 10, 2025
44fad0b
Merge pull request #19079 from ChayimFriedman2/rename-conflict
Veykril Mar 10, 2025
1c8acd4
Merge pull request #19330 from ChayimFriedman2/normalize-projection
Veykril Mar 10, 2025
ee79f3e
Run proc-macro server tests are separate CI job
Veykril Mar 10, 2025
87d5bf2
Bump rustc crates
lnicola Mar 10, 2025
c372c55
Fix simd layout test
lnicola Mar 10, 2025
af32b22
Merge pull request #19328 from Veykril/push-umwykvoskvyp
Veykril Mar 10, 2025
1d983bf
Format code
lnicola Mar 10, 2025
52f39ff
Merge pull request #19331 from lnicola/sync-from-rust
lnicola Mar 10, 2025
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
3 changes: 3 additions & 0 deletions src/tools/rust-analyzer/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ indent_size = 2

[*.{yml,yaml}]
indent_size = 2

[COMMIT_EDITMSG]
max_line_length = unset
73 changes: 46 additions & 27 deletions src/tools/rust-analyzer/.github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,48 @@ jobs:
typescript:
- 'editors/code/**'
proc_macros:
- 'crates/tt/**'
- 'crates/proc-macro-api/**'
- 'crates/proc-macro-srv/**'
- 'crates/proc-macro-srv-cli/**'

rust:
proc-macro-srv:
needs: changes
if: github.repository == 'rust-lang/rust-analyzer' && needs.changes.outputs.proc_macros == 'true'
name: proc-macro-srv
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Install Rust toolchain
run: |
rustup update --no-self-update nightly
rustup default nightly
rustup component add --toolchain nightly rust-src rustfmt
# https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/rust.json
- name: Install Rust Problem Matcher
if: matrix.os == 'ubuntu-latest'
run: echo "::add-matcher::.github/rust.json"

- name: Cache Dependencies
uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609

- name: Bump opt-level
if: matrix.os == 'ubuntu-latest'
run: sed -i '/\[profile.dev]/a opt-level=1' Cargo.toml

- name: Test
run: cargo test --features sysroot-abi -p rust-analyzer -p proc-macro-srv -p proc-macro-srv-cli -p proc-macro-api -- --quiet

rust:
if: github.repository == 'rust-lang/rust-analyzer'
name: Rust
runs-on: ${{ matrix.os }}
env:
CC: deny_c
RUST_CHANNEL: "${{ needs.changes.outputs.proc_macros == 'true' && 'nightly' || 'stable' }}"
USE_SYSROOT_ABI: "${{ needs.changes.outputs.proc_macros == 'true' && '--features sysroot-abi' || '' }}"

strategy:
fail-fast: false
Expand All @@ -62,22 +91,19 @@ jobs:

- name: Install Rust toolchain
run: |
rustup update --no-self-update ${{ env.RUST_CHANNEL }}
rustup default ${{ env.RUST_CHANNEL }}
rustup component add --toolchain ${{ env.RUST_CHANNEL }} rust-src
rustup update --no-self-update stable
rustup default stable
rustup component add --toolchain stable rust-src
# We always use a nightly rustfmt, regardless of channel, because we need
# --file-lines.
rustup toolchain add nightly --profile minimal
rustup component add --toolchain nightly rustfmt
rustup toolchain install nightly --profile minimal --component rustfmt
# https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/rust.json
- name: Install Rust Problem Matcher
if: matrix.os == 'ubuntu-latest'
run: echo "::add-matcher::.github/rust.json"

- name: Cache Dependencies
uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
with:
key: ${{ env.RUST_CHANNEL }}

- name: Bump opt-level
if: matrix.os == 'ubuntu-latest'
Expand All @@ -87,16 +113,16 @@ jobs:
run: cargo codegen --check

- name: Compile (tests)
run: cargo test --no-run --locked ${{ env.USE_SYSROOT_ABI }}
run: cargo test --no-run --locked

# It's faster to `test` before `build` ¯\_(ツ)_/¯
- name: Compile (rust-analyzer)
if: matrix.os == 'ubuntu-latest'
run: cargo build --quiet ${{ env.USE_SYSROOT_ABI }}
run: cargo build --quiet

- name: Test
if: matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest' || github.event_name == 'push'
run: cargo test ${{ env.USE_SYSROOT_ABI }} -- --nocapture --quiet
run: cargo test -- --quiet

- name: Switch to stable toolchain
run: |
Expand Down Expand Up @@ -157,7 +183,7 @@ jobs:

typescript:
needs: changes
if: github.repository == 'rust-lang/rust-analyzer'
if: github.repository == 'rust-lang/rust-analyzer' && needs.changes.outputs.typescript == 'true'
name: TypeScript
strategy:
fail-fast: false
Expand All @@ -169,21 +195,18 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
if: needs.changes.outputs.typescript == 'true'

- name: Install Nodejs
uses: actions/setup-node@v4
with:
node-version: 22
if: needs.changes.outputs.typescript == 'true'

- name: Install xvfb
if: matrix.os == 'ubuntu-latest' && needs.changes.outputs.typescript == 'true'
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y xvfb

- run: npm ci
working-directory: ./editors/code
if: needs.changes.outputs.typescript == 'true'

# - run: npm audit || { sleep 10 && npm audit; } || { sleep 30 && npm audit; }
# if: runner.os == 'Linux'
Expand All @@ -192,35 +215,31 @@ jobs:
# If this steps fails, your code's type integrity might be wrong at some places at TypeScript level.
- run: npm run typecheck
working-directory: ./editors/code
if: needs.changes.outputs.typescript == 'true'

# You may fix the code automatically by running `npm run lint:fix` if this steps fails.
- run: npm run lint
working-directory: ./editors/code
if: needs.changes.outputs.typescript == 'true'

# To fix this steps, please run `npm run format`.
- run: npm run format:check
working-directory: ./editors/code
if: needs.changes.outputs.typescript == 'true'

- name: Run VS Code tests (Linux)
if: matrix.os == 'ubuntu-latest' && needs.changes.outputs.typescript == 'true'
if: matrix.os == 'ubuntu-latest'
env:
VSCODE_CLI: 1
run: xvfb-run npm test
working-directory: ./editors/code

- name: Run VS Code tests (Windows)
if: matrix.os == 'windows-latest' && needs.changes.outputs.typescript == 'true'
if: matrix.os == 'windows-latest'
env:
VSCODE_CLI: 1
run: npm test
working-directory: ./editors/code

- run: npm run package --scripts-prepend-node-path
working-directory: ./editors/code
if: needs.changes.outputs.typescript == 'true'

typo-check:
name: Typo Check
Expand All @@ -242,7 +261,7 @@ jobs:
run: typos

conclusion:
needs: [rust, rust-cross, typescript, typo-check]
needs: [rust, rust-cross, typescript, typo-check, proc-macro-srv]
# We need to ensure this job does *not* get skipped if its dependencies fail,
# because a skipped job is considered a success by GitHub. So we have to
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
Expand All @@ -257,5 +276,5 @@ jobs:
run: |
# Print the dependent jobs to see them in the CI log
jq -C <<< '${{ toJson(needs) }}'
# Check if all jobs that we depend on (in the needs array) were successful.
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
# Check if all jobs that we depend on (in the needs array) were successful (or have been skipped).
jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}'
45 changes: 22 additions & 23 deletions src/tools/rust-analyzer/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"

[[package]]
name = "chalk-derive"
version = "0.99.0"
version = "0.100.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "572583d9b97f9d277e5c7607f8239a30e2e04d3ed3b47c87d1cb2152ae724073"
checksum = "ab2d131019373f0d0d1f2af0abd4f719739f6583c1b33965112455f643a910af"
dependencies = [
"proc-macro2",
"quote",
Expand All @@ -203,19 +203,19 @@ dependencies = [

[[package]]
name = "chalk-ir"
version = "0.99.0"
version = "0.100.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e60e0ef9c81dce1336a9ed3c76f08775f5b623151d96d85ba45f7b10de76d1c7"
checksum = "4f114996bda14c0213f014a4ef31a7867dcf5f539a3900477fc6b20138e7a17b"
dependencies = [
"bitflags 2.7.0",
"chalk-derive",
]

[[package]]
name = "chalk-recursive"
version = "0.99.0"
version = "0.100.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a06350d614e22b03a69b8105e3541614450a7ea48bc58ecc6c6bd92731a3995"
checksum = "551e956e031c09057c7b21f17d48d91de99c9b6b6e34bceaf5e7202d71021268"
dependencies = [
"chalk-derive",
"chalk-ir",
Expand All @@ -226,9 +226,9 @@ dependencies = [

[[package]]
name = "chalk-solve"
version = "0.99.0"
version = "0.100.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e428761e9b55bee516bfe2457caed8b6d1b86353f92ae825bbe438a36ce91e8"
checksum = "cd7ca50181156ce649efe8e5dd00580f573651554e4dcd11afa4e2ac93f53324"
dependencies = [
"chalk-derive",
"chalk-ir",
Expand Down Expand Up @@ -626,7 +626,6 @@ dependencies = [
"oorandom",
"project-model",
"ra-ap-rustc_abi",
"ra-ap-rustc_hashes",
"ra-ap-rustc_index",
"ra-ap-rustc_pattern_analysis",
"rustc-hash 2.0.0",
Expand Down Expand Up @@ -1504,9 +1503,9 @@ dependencies = [

[[package]]
name = "ra-ap-rustc_abi"
version = "0.98.0"
version = "0.100.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b42cccfff8091a4c3397736518774dbad619e82f8def6f70d8e46dbbe396007"
checksum = "f1651b0f7e8c3eb7c27a88f39d277e69c32bfe58e3be174d286c1a24d6a7a4d8"
dependencies = [
"bitflags 2.7.0",
"ra-ap-rustc_hashes",
Expand All @@ -1516,28 +1515,28 @@ dependencies = [

[[package]]
name = "ra-ap-rustc_hashes"
version = "0.98.0"
version = "0.100.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46d8bd34ed6552c8cac1764106ef5adbeef3e5c7700e0ceb4c83a47a631894fe"
checksum = "2bcd85e93dc0ea850bcfe7957a115957df799ccbc9eea488bdee5ec6780d212b"
dependencies = [
"rustc-stable-hash",
]

[[package]]
name = "ra-ap-rustc_index"
version = "0.98.0"
version = "0.100.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93799e4dccbbd47f8b66bc0aa42effc1b7077aaee09d8a40b86b8d659b80c7b7"
checksum = "62b295fc0640cd9fe0ecab872ee4a17a96f90a3998ec9f0c4765e9b8415c12cc"
dependencies = [
"ra-ap-rustc_index_macros",
"smallvec",
]

[[package]]
name = "ra-ap-rustc_index_macros"
version = "0.98.0"
version = "0.100.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30baa5d00f94ba437a9dcaf7ae074ebe4f367bb05a4c2835e0aa2e7af3463aac"
checksum = "c675f4257023aa933882906f13802cae287e88cc39ab13cbb96809083db0c801"
dependencies = [
"proc-macro2",
"quote",
Expand All @@ -1546,9 +1545,9 @@ dependencies = [

[[package]]
name = "ra-ap-rustc_lexer"
version = "0.98.0"
version = "0.100.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3004d1d1b50afe3e1f9cdd428a282da7ffbf5f26dd8bf04af0d651d44e4873d8"
checksum = "c8358702c2a510ea84ba5801ddc047d9ad9520902cfb0e6173277610cdce2c9c"
dependencies = [
"memchr",
"unicode-properties",
Expand All @@ -1557,19 +1556,19 @@ dependencies = [

[[package]]
name = "ra-ap-rustc_parse_format"
version = "0.98.0"
version = "0.100.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb57e5124a64aaaf92c06130fbc1b8e1d547b5a2a96081f1f848e31c211df5d2"
checksum = "b98f402011d46732c35c47bfd111dec0495747fef2ec900ddee7fe15d78449a7"
dependencies = [
"ra-ap-rustc_index",
"ra-ap-rustc_lexer",
]

[[package]]
name = "ra-ap-rustc_pattern_analysis"
version = "0.98.0"
version = "0.100.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e427c3d30e4bdff28abd6b0ef3e6f4dfab44acd9468a4954eeff8717d8df8819"
checksum = "bef3ff73fa4653252ffe1d1e9177a446f49ef46d97140e4816b7ff2dad59ed53"
dependencies = [
"ra-ap-rustc_index",
"rustc-hash 2.0.0",
Expand Down
20 changes: 10 additions & 10 deletions src/tools/rust-analyzer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ vfs-notify = { path = "./crates/vfs-notify", version = "0.0.0" }
vfs = { path = "./crates/vfs", version = "0.0.0" }
edition = { path = "./crates/edition", version = "0.0.0" }

ra-ap-rustc_hashes = { version = "0.98", default-features = false }
ra-ap-rustc_lexer = { version = "0.98", default-features = false }
ra-ap-rustc_parse_format = { version = "0.98", default-features = false }
ra-ap-rustc_index = { version = "0.98", default-features = false }
ra-ap-rustc_abi = { version = "0.98", default-features = false }
ra-ap-rustc_pattern_analysis = { version = "0.98", default-features = false }
ra-ap-rustc_hashes = { version = "0.100", default-features = false }
ra-ap-rustc_lexer = { version = "0.100", default-features = false }
ra-ap-rustc_parse_format = { version = "0.100", default-features = false }
ra-ap-rustc_index = { version = "0.100", default-features = false }
ra-ap-rustc_abi = { version = "0.100", default-features = false }
ra-ap-rustc_pattern_analysis = { version = "0.100", default-features = false }

# local crates that aren't published to crates.io. These should not have versions.

Expand All @@ -105,10 +105,10 @@ arrayvec = "0.7.4"
bitflags = "2.4.1"
cargo_metadata = "0.18.1"
camino = "1.1.6"
chalk-solve = { version = "0.99.0", default-features = false }
chalk-ir = "0.99.0"
chalk-recursive = { version = "0.99.0", default-features = false }
chalk-derive = "0.99.0"
chalk-solve = { version = "0.100.0", default-features = false }
chalk-ir = "0.100.0"
chalk-recursive = { version = "0.100.0", default-features = false }
chalk-derive = "0.100.0"
crossbeam-channel = "0.5.8"
dissimilar = "1.0.7"
dot = "0.1.4"
Expand Down
19 changes: 19 additions & 0 deletions src/tools/rust-analyzer/crates/cfg/src/cfg_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@ pub enum CfgAtom {
KeyValue { key: Symbol, value: Symbol },
}

impl PartialOrd for CfgAtom {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.cmp(other))
}
}

impl Ord for CfgAtom {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
match (self, other) {
(CfgAtom::Flag(a), CfgAtom::Flag(b)) => a.as_str().cmp(b.as_str()),
(CfgAtom::Flag(_), CfgAtom::KeyValue { .. }) => std::cmp::Ordering::Less,
(CfgAtom::KeyValue { .. }, CfgAtom::Flag(_)) => std::cmp::Ordering::Greater,
(CfgAtom::KeyValue { key, value }, CfgAtom::KeyValue { key: key2, value: value2 }) => {
key.as_str().cmp(key2.as_str()).then(value.as_str().cmp(value2.as_str()))
}
}
}
}

impl fmt::Display for CfgAtom {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Expand Down
Loading
Loading