Skip to content

Commit

Permalink
Work around Cargo Issue 10788
Browse files Browse the repository at this point in the history
See rust-lang/cargo#10788 for the full issue.

When enabling a feature of a dependency, the syntax `tokio/rt` implicitly required a feature `tokio` to exist in 1.70 of cargo. By 1.77 this has been fixed. To work around this, we can use "weak feature dependencies" like `tokio?/rt` which enables the `rt` feature of tokio only if tokio is itself an enabled dependency. Also adding `dep:tokio` to the list of dependencies ensures that this is always true.

When the MSRV is upgraded again, we can probably remove the weak `?` and the `dep:tokio` in these cases.
  • Loading branch information
alexrudy committed Apr 13, 2024
1 parent fea3663 commit f386954
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tonic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ tls = [
"transport",
"dep:tokio-rustls",
"dep:rustls",
"tokio/rt",
"tokio/macros",
"dep:tokio",
"tokio?/rt",
"tokio?/macros",
]
tls-roots = ["tls-roots-common", "dep:rustls-native-certs"]
tls-roots-common = ["tls"]
Expand Down

0 comments on commit f386954

Please sign in to comment.