Skip to content

Commit

Permalink
Restore compatibility with rustc 1.56 through 1.59
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Mar 24, 2024
1 parent a5d02b1 commit 6e8a372
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 18 deletions.
33 changes: 17 additions & 16 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]
rust: [stable, beta, 1.60.0, 1.56.0]
include:
- rust: nightly
components: rustc-dev
Expand All @@ -52,6 +52,7 @@ 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 @@ -60,21 +61,21 @@ jobs:
toolchain: ${{matrix.rust}}
targets: ${{matrix.target}}
components: ${{matrix.components}}
- 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'
- 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'
- if: matrix.components == 'rustc-dev'
run: cargo check --benches --all-features --release

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

[features]
default = ["derive", "parsing", "printing", "clone-impls", "proc-macro"]
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.60 and up.*
*Version requirement: Syn supports rustc 1.56 and up.*

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

Expand Down
26 changes: 26 additions & 0 deletions tests/crate/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[workspace]
[package]
name = "syn-test-suite"
version = "0.0.0"
authors = ["David Tolnay <dtolnay@gmail.com>"]
edition = "2021"
publish = false

[lib]
path = "test.rs"

[dependencies]
syn = { path = "../..", default-features = false }

[features]
default = ["derive", "parsing", "printing", "clone-impls", "proc-macro"]
derive = ["syn/derive"]
full = ["syn/full"]
parsing = ["syn/parsing"]
printing = ["syn/printing"]
visit = ["syn/visit"]
visit-mut = ["syn/visit-mut"]
fold = ["syn/fold"]
clone-impls = ["syn/clone-impls"]
extra-traits = ["syn/extra-traits"]
proc-macro = ["syn/proc-macro"]
1 change: 1 addition & 0 deletions tests/crate/test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub use syn::*;

0 comments on commit 6e8a372

Please sign in to comment.