cargo install cargo-tarpaulin fails: native-tls 0.2.17 compile error (Protocol::Tlsv13 non-exhaustive)
## Summary
`cargo install cargo-tarpaulin` (any recent version) fails to compile because it resolves `native-tls` to `v0.2.17`, which has a regression: the `Protocol::Tlsv13` variant is defined in the enum but not handled in the openssl backend.
## Error
```
error[E0004]: non-exhaustive patterns: `Some(Protocol::Tlsv13)` not covered
--> native-tls-0.2.17/src/imp/openssl.rs:61:22
error[E0004]: non-exhaustive patterns: `Some(Protocol::Tlsv13)` not covered
--> native-tls-0.2.17/src/imp/openssl.rs:75:22
error: failed to compile `cargo-tarpaulin v0.35.1`
```
## Reproduction
```
cargo install cargo-tarpaulin
```
Fails because cargo resolves `native-tls` to `0.2.17`. Affects all recent tarpaulin versions that depend on `native-tls ^0.2`.
## Environment
- `cargo-tarpaulin`: 0.35.1
- `native-tls`: 0.2.17 (resolved by cargo)
- `rustc`: 1.93.0-nightly (c23ed3ef2 2025-11-23)
- OS: Linux (x86_64)
## Workaround
Use `--locked` to pin transitive deps to tarpaulin's published Cargo.lock (which resolves to `native-tls v0.2.14`):
```
cargo install cargo-tarpaulin --locked
```
## Root cause
The bug is in `native-tls 0.2.17` itself. Filed upstream: https://github.com/rust-native-tls/rust-native-tls/issues/370
A fix on tarpaulin's side would be to either:
- Bump the minimum `native-tls` version once a fix is released, or
- Document `--locked` as the recommended install method
关闭于 2026-02-19 2 条评论