Skip to content

Commit

Permalink
Merge pull request #1608 from BD103/deps-features
Browse files Browse the repository at this point in the history
Use `dep:` and optional dependency feature `?` syntax
  • Loading branch information
dtolnay authored Mar 30, 2024
2 parents c7f734d + d7650b2 commit 585df47
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 48 deletions.
33 changes: 16 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
strategy:
fail-fast: false
matrix:
rust: [stable, beta, 1.60.0, 1.56.0]
rust: [stable, beta, 1.60.0]
include:
- rust: nightly
components: rustc-dev
Expand All @@ -52,7 +52,6 @@ jobs:
os: windows
env:
target: ${{matrix.target && format('--target={0}', matrix.target)}}
manifestpath: ${{matrix.rust == '1.56.0' && '--manifest-path tests/crate/Cargo.toml' || ''}}
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
Expand All @@ -61,21 +60,21 @@ jobs:
toolchain: ${{matrix.rust}}
targets: ${{matrix.target}}
components: ${{matrix.components}}
- run: cargo check ${{env.manifestpath}} ${{env.target}} --no-default-features
- run: cargo check ${{env.manifestpath}} ${{env.target}}
- run: cargo check ${{env.manifestpath}} ${{env.target}} --features full
- run: cargo check ${{env.manifestpath}} ${{env.target}} --features 'fold visit visit-mut'
- run: cargo check ${{env.manifestpath}} ${{env.target}} --features 'full fold visit visit-mut'
- run: cargo check ${{env.manifestpath}} ${{env.target}} --no-default-features --features derive
- run: cargo check ${{env.manifestpath}} ${{env.target}} --no-default-features --features 'derive parsing'
- run: cargo check ${{env.manifestpath}} ${{env.target}} --no-default-features --features 'derive printing'
- run: cargo check ${{env.manifestpath}} ${{env.target}} --no-default-features --features 'proc-macro parsing printing'
- run: cargo check ${{env.manifestpath}} ${{env.target}} --no-default-features --features full
- run: cargo check ${{env.manifestpath}} ${{env.target}} --no-default-features --features 'full parsing'
- run: cargo check ${{env.manifestpath}} ${{env.target}} --no-default-features --features 'full printing'
- run: cargo check ${{env.manifestpath}} ${{env.target}} --no-default-features --features 'full parsing printing'
- run: cargo check ${{env.manifestpath}} ${{env.target}} --no-default-features --features 'fold visit visit-mut parsing printing'
- run: cargo check ${{env.manifestpath}} ${{env.target}} --no-default-features --features 'full fold visit visit-mut parsing printing'
- run: cargo check ${{env.target}} --no-default-features
- run: cargo check ${{env.target}}
- run: cargo check ${{env.target}} --features full
- run: cargo check ${{env.target}} --features 'fold visit visit-mut'
- run: cargo check ${{env.target}} --features 'full fold visit visit-mut'
- run: cargo check ${{env.target}} --no-default-features --features derive
- run: cargo check ${{env.target}} --no-default-features --features 'derive parsing'
- run: cargo check ${{env.target}} --no-default-features --features 'derive printing'
- run: cargo check ${{env.target}} --no-default-features --features 'proc-macro parsing printing'
- run: cargo check ${{env.target}} --no-default-features --features full
- run: cargo check ${{env.target}} --no-default-features --features 'full parsing'
- run: cargo check ${{env.target}} --no-default-features --features 'full printing'
- run: cargo check ${{env.target}} --no-default-features --features 'full parsing printing'
- run: cargo check ${{env.target}} --no-default-features --features 'fold visit visit-mut parsing printing'
- run: cargo check ${{env.target}} --no-default-features --features 'full fold visit visit-mut parsing printing'
- if: matrix.components == 'rustc-dev'
run: cargo check --benches --all-features --release

Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ include = [
keywords = ["macros", "syn"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/dtolnay/syn"
rust-version = "1.56"
rust-version = "1.60"

[features]
default = ["derive", "parsing", "printing", "clone-impls", "proc-macro"]
derive = []
full = []
parsing = []
printing = ["quote"]
printing = ["dep:quote"]
visit = []
visit-mut = []
fold = []
clone-impls = []
extra-traits = []
proc-macro = ["proc-macro2/proc-macro", "quote/proc-macro"]
proc-macro = ["proc-macro2/proc-macro", "quote?/proc-macro"]
test = ["syn-test-suite/all-features"]

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ contains some APIs that may be useful more generally.
[`syn::DeriveInput`]: https://docs.rs/syn/2.0/syn/struct.DeriveInput.html
[parser functions]: https://docs.rs/syn/2.0/syn/parse/index.html

*Version requirement: Syn supports rustc 1.56 and up.*
*Version requirement: Syn supports rustc 1.60 and up.*

[*Release notes*](https://github.com/dtolnay/syn/releases)

Expand Down
26 changes: 0 additions & 26 deletions tests/crate/Cargo.toml

This file was deleted.

1 change: 0 additions & 1 deletion tests/crate/test.rs

This file was deleted.

0 comments on commit 585df47

Please sign in to comment.