Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable TLS completely when neither tls features is enabled #9

Closed
George-Miao opened this issue Nov 30, 2023 · 0 comments
Closed

Disable TLS completely when neither tls features is enabled #9

George-Miao opened this issue Nov 30, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@George-Miao
Copy link
Member

Currently cyper-core cannot be built with --no-default-features due the fact that it will import compio-tls no matter what, and that in turn causes compio to fail to build.

For cyper, compio-tls should not be a default feature. Instead, it should only be toggled on when either native-tls or rustls is enabled.

For compio, compio-tls should either become no-op when neither features is enabled or give a clearer error. Currently it shows:

error[E0392]: parameter `S` is never used
  --> [:REDACTED:]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compio-tls-0.1.0-beta.2/src/stream/mod.rs:11:21
   |
11 | enum TlsStreamInner<S> {
   |                     ^ unused parameter
   |
   = help: consider removing `S`, referring to it in a field, or using a marker such as `PhantomData`
   = help: if you intended `S` to be a const parameter, use `const S: usize` instead

error[E0392]: parameter `S` is never used
  --> [:REDACTED:]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compio-tls-0.1.0-beta.2/src/stream/mod.rs:78:22
   |
78 | pub struct TlsStream<S>(TlsStreamInner<S>);
   |                      ^ unused parameter
   |
   = help: consider removing `S`, referring to it in a field, or using a marker such as `PhantomData`
   = help: if you intended `S` to be a const parameter, use `const S: usize` instead

error[E0004]: non-exhaustive patterns: type `&TlsConnectorInner` is non-empty
  --> [:REDACTED:]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compio-tls-0.1.0-beta.2/src/adapter/mod.rs:55:15
   |
55 |         match &self.0 {
   |               ^^^^^^^
   |
note: `TlsConnectorInner` defined here
  --> [:REDACTED:]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compio-tls-0.1.0-beta.2/src/adapter/mod.rs:11:6
   |
11 | enum TlsConnectorInner {
   |      ^^^^^^^^^^^^^^^^^
   = note: the matched value is of type `&TlsConnectorInner`
   = note: references are always considered inhabited
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
   |
55 ~         match &self.0 {
56 +             _ => todo!(),
57 +         }
   |

error[E0004]: non-exhaustive patterns: type `&TlsAcceptorInner` is non-empty
   --> [:REDACTED:]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compio-tls-0.1.0-beta.2/src/adapter/mod.rs:105:15
    |
105 |         match &self.0 {
    |               ^^^^^^^
    |
note: `TlsAcceptorInner` defined here
   --> [:REDACTED:]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/compio-tls-0.1.0-beta.2/src/adapter/mod.rs:67:6
    |
67  | enum TlsAcceptorInner {
    |      ^^^^^^^^^^^^^^^^
    = note: the matched value is of type `&TlsAcceptorInner`
    = note: references are always considered inhabited
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
    |
105 ~         match &self.0 {
106 +             _ => todo!(),
107 +         }
    |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant