Skip to content

Commit 6e8a372

Browse files
committed
Restore compatibility with rustc 1.56 through 1.59
1 parent a5d02b1 commit 6e8a372

File tree

5 files changed

+46
-18
lines changed

5 files changed

+46
-18
lines changed

.github/workflows/ci.yml

+17-16
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
strategy:
3838
fail-fast: false
3939
matrix:
40-
rust: [stable, beta, 1.60.0]
40+
rust: [stable, beta, 1.60.0, 1.56.0]
4141
include:
4242
- rust: nightly
4343
components: rustc-dev
@@ -52,6 +52,7 @@ jobs:
5252
os: windows
5353
env:
5454
target: ${{matrix.target && format('--target={0}', matrix.target)}}
55+
manifestpath: ${{matrix.rust == '1.56.0' && '--manifest-path tests/crate/Cargo.toml' || ''}}
5556
timeout-minutes: 45
5657
steps:
5758
- uses: actions/checkout@v4
@@ -60,21 +61,21 @@ jobs:
6061
toolchain: ${{matrix.rust}}
6162
targets: ${{matrix.target}}
6263
components: ${{matrix.components}}
63-
- run: cargo check ${{env.target}} --no-default-features
64-
- run: cargo check ${{env.target}}
65-
- run: cargo check ${{env.target}} --features full
66-
- run: cargo check ${{env.target}} --features 'fold visit visit-mut'
67-
- run: cargo check ${{env.target}} --features 'full fold visit visit-mut'
68-
- run: cargo check ${{env.target}} --no-default-features --features derive
69-
- run: cargo check ${{env.target}} --no-default-features --features 'derive parsing'
70-
- run: cargo check ${{env.target}} --no-default-features --features 'derive printing'
71-
- run: cargo check ${{env.target}} --no-default-features --features 'proc-macro parsing printing'
72-
- run: cargo check ${{env.target}} --no-default-features --features full
73-
- run: cargo check ${{env.target}} --no-default-features --features 'full parsing'
74-
- run: cargo check ${{env.target}} --no-default-features --features 'full printing'
75-
- run: cargo check ${{env.target}} --no-default-features --features 'full parsing printing'
76-
- run: cargo check ${{env.target}} --no-default-features --features 'fold visit visit-mut parsing printing'
77-
- run: cargo check ${{env.target}} --no-default-features --features 'full fold visit visit-mut parsing printing'
64+
- run: cargo check ${{env.manifestpath}} ${{env.target}} --no-default-features
65+
- run: cargo check ${{env.manifestpath}} ${{env.target}}
66+
- run: cargo check ${{env.manifestpath}} ${{env.target}} --features full
67+
- run: cargo check ${{env.manifestpath}} ${{env.target}} --features 'fold visit visit-mut'
68+
- run: cargo check ${{env.manifestpath}} ${{env.target}} --features 'full fold visit visit-mut'
69+
- run: cargo check ${{env.manifestpath}} ${{env.target}} --no-default-features --features derive
70+
- run: cargo check ${{env.manifestpath}} ${{env.target}} --no-default-features --features 'derive parsing'
71+
- run: cargo check ${{env.manifestpath}} ${{env.target}} --no-default-features --features 'derive printing'
72+
- run: cargo check ${{env.manifestpath}} ${{env.target}} --no-default-features --features 'proc-macro parsing printing'
73+
- run: cargo check ${{env.manifestpath}} ${{env.target}} --no-default-features --features full
74+
- run: cargo check ${{env.manifestpath}} ${{env.target}} --no-default-features --features 'full parsing'
75+
- run: cargo check ${{env.manifestpath}} ${{env.target}} --no-default-features --features 'full printing'
76+
- run: cargo check ${{env.manifestpath}} ${{env.target}} --no-default-features --features 'full parsing printing'
77+
- run: cargo check ${{env.manifestpath}} ${{env.target}} --no-default-features --features 'fold visit visit-mut parsing printing'
78+
- run: cargo check ${{env.manifestpath}} ${{env.target}} --no-default-features --features 'full fold visit visit-mut parsing printing'
7879
- if: matrix.components == 'rustc-dev'
7980
run: cargo check --benches --all-features --release
8081

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ include = [
1818
keywords = ["macros", "syn"]
1919
license = "MIT OR Apache-2.0"
2020
repository = "https://github.com/dtolnay/syn"
21-
rust-version = "1.60"
21+
rust-version = "1.56"
2222

2323
[features]
2424
default = ["derive", "parsing", "printing", "clone-impls", "proc-macro"]

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ contains some APIs that may be useful more generally.
4646
[`syn::DeriveInput`]: https://docs.rs/syn/2.0/syn/struct.DeriveInput.html
4747
[parser functions]: https://docs.rs/syn/2.0/syn/parse/index.html
4848

49-
*Version requirement: Syn supports rustc 1.60 and up.*
49+
*Version requirement: Syn supports rustc 1.56 and up.*
5050

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

tests/crate/Cargo.toml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[workspace]
2+
[package]
3+
name = "syn-test-suite"
4+
version = "0.0.0"
5+
authors = ["David Tolnay <[email protected]>"]
6+
edition = "2021"
7+
publish = false
8+
9+
[lib]
10+
path = "test.rs"
11+
12+
[dependencies]
13+
syn = { path = "../..", default-features = false }
14+
15+
[features]
16+
default = ["derive", "parsing", "printing", "clone-impls", "proc-macro"]
17+
derive = ["syn/derive"]
18+
full = ["syn/full"]
19+
parsing = ["syn/parsing"]
20+
printing = ["syn/printing"]
21+
visit = ["syn/visit"]
22+
visit-mut = ["syn/visit-mut"]
23+
fold = ["syn/fold"]
24+
clone-impls = ["syn/clone-impls"]
25+
extra-traits = ["syn/extra-traits"]
26+
proc-macro = ["syn/proc-macro"]

tests/crate/test.rs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub use syn::*;

0 commit comments

Comments
 (0)