svenstaro/miniserve

Fails to build on latest nightly

Closed this issue · 7 comments

error[E0308]: mismatched types
   --> /Users/berkus/.cargo/registry/src/github.com-1ecc6299db9ec823/miniserve-0.18.0/src/main.rs:215:61
    |
215 |             Some(tls_config) => srv.listen_rustls(listener, tls_config.clone()),
    |                                                             ^^^^^^^^^^^^^^^^^^ expected struct `rustls::server::server_conn::ServerConfig`, found struct `ServerConfig`
    |
note: return type inferred to be `rustls::server::server_conn::ServerConfig` here
   --> /Users/berkus/.cargo/registry/src/github.com-1ecc6299db9ec823/miniserve-0.18.0/src/main.rs:209:24
    |
209 |           let listener = create_tcp_listener(*addr).map_err(|e| {
    |  ________________________^
210 | |             ContextualError::IoError(format!("Failed to bind server to {}", addr), e)
211 | |         })?;
    | |___________^

❯ rustc --version
rustc 1.58.0-nightly (072799443 2021-11-06)

Can't reproduce on rustc 1.58.0-nightly (46b8e7488 2021-11-07).

I'm getting this same issue on cargo 1.56.0 (4ed5d137b 2021-10-04) so it may not be down to the nightly but rather something in the system configuration.

Without further evidence that this is something in miniserve's code, I'm going to close this for the time being. Feel free to add more stuff here though.

I am able to reproduce this as well with cargo install miniserve.
If cargo install miniserve --locked is used, it successfully installs.

Oh yeah, that's right, I forgot that currently we'll have to use --locked due to being unable to upgrade actix. Anyhow, this is already documented in the README so we should be good here.

Sorry, I missed that bit in the README, with --locked it installs.

Hi! I bumped into the same issue because the readme of the repo is up to date, but not the one in crates.io
(just letting you know, you might want to update the readme in crates.io with a minor release?)