Skip to content

Commit 824cd40

Browse files
authored
Update juniper_codegen for syn 1.0.60 (#861)
* Update juniper_codegen for syn 1.0.60 syn 1.0.60 has updated it's `Type::__Nonexhaustive` to `Type::TestExhaustive`, breaking juniper. This updates juniper to use the recommended idiom for doing exhaustive matching on `Type`, which fixes this. Not entirely clear if we need exhaustive matching here or if we could just use a fallback, but this fixes the build at least. Also updated the minimum syn so users have to pull it in * Update example to use relative deps As otherwise CI fails on this branch
1 parent 2c9c172 commit 824cd40

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

examples/basic_subscriptions/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ serde = { version = "1.0", features = ["derive"] }
1313
serde_json = "1.0"
1414
tokio = { version = "0.2", features = ["rt-core", "macros", "stream"] }
1515

16-
juniper = { git = "https://github.com/graphql-rust/juniper" }
17-
juniper_subscriptions = { git = "https://github.com/graphql-rust/juniper" }
16+
juniper = { path = "../../juniper" }
17+
juniper_subscriptions = { path = "../../juniper_subscriptions" }

examples/warp_async/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ publish = false
66
authors = ["Christoph Herzog <[email protected]>"]
77

88
[dependencies]
9-
juniper = { git = "https://github.com/graphql-rust/juniper" }
10-
juniper_warp = { git = "https://github.com/graphql-rust/juniper" }
9+
juniper = { path = "../../juniper" }
10+
juniper_warp = { path = "../../juniper_warp" }
1111

1212
env_logger = "0.8.1"
1313
futures = "0.3.1"

juniper_codegen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ proc-macro = true
2121
proc-macro-error = "1.0.2"
2222
proc-macro2 = "1.0.1"
2323
quote = "1.0.3"
24-
syn = { version = "1.0.3", features = ["extra-traits", "full", "parsing"], default-features = false }
24+
syn = { version = "1.0.60", features = ["extra-traits", "full", "parsing"], default-features = false }
2525

2626
[dev-dependencies]
2727
derive_more = "0.99.7"

juniper_codegen/src/common/parse/mod.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,15 @@ impl TypeExt for syn::Type {
191191
}
192192

193193
// These types unlikely will be used as GraphQL types.
194-
T::BareFn(_)
195-
| T::Infer(_)
196-
| T::Macro(_)
197-
| T::Never(_)
198-
| T::Verbatim(_)
199-
| T::__Nonexhaustive => {}
194+
T::BareFn(_) | T::Infer(_) | T::Macro(_) | T::Never(_) | T::Verbatim(_) => {}
195+
196+
// Following the syn idiom for exhaustive matching on Type
197+
// https://github.com/dtolnay/syn/blob/master/src/ty.rs#L66-L88
198+
#[cfg(test)]
199+
T::__TestExhaustive(_) => unimplemented!(),
200+
201+
#[cfg(not(test))]
202+
_ => {}
200203
}
201204
}
202205
}

0 commit comments

Comments
 (0)