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

Use exactly 1.0.0-rc.3 hyper and update UI test #2086

Merged
merged 8 commits into from
Jul 13, 2023

Conversation

Rustin170506
Copy link
Contributor

@Rustin170506 Rustin170506 commented Jul 12, 2023

Motivation

close #2085

Because we don't have the Cargo.lock file so you try to build with Cargo, it will help you pick the 1.0.0-rc.4 to build the code.

Then you will get an error:

   Compiling axum v0.6.16 (/Volumes/t7/code/axum/axum)
error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Read` is not satisfied
   --> axum/src/serve.rs:136:35
    |
136 |                 .serve_connection(tcp_stream, service)
    |                  ---------------- ^^^^^^^^^^ the trait `hyper::rt::Read` is not implemented for `tokio::net::TcpStream`
    |                  |
    |                  required by a bound introduced by this call
    |
    = help: the following other types implement trait `hyper::rt::Read`:
              &mut T
              Box<T>
              Upgraded
note: required by a bound in `hyper::server::conn::http1::Builder::serve_connection`
   --> /Users/hi-rustin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/server/conn/http1.rs:359:12
    |
359 |         I: Read + Write + Unpin,
    |            ^^^^ required by this bound in `Builder::serve_connection`

error[E0277]: the trait bound `tokio::net::TcpStream: hyper::rt::Write` is not satisfied
   --> axum/src/serve.rs:136:35
    |
136 |                 .serve_connection(tcp_stream, service)
    |                  ---------------- ^^^^^^^^^^ the trait `hyper::rt::Write` is not implemented for `tokio::net::TcpStream`
    |                  |
    |                  required by a bound introduced by this call
    |
    = help: the following other types implement trait `hyper::rt::Write`:
              &mut T
              Box<T>
              Upgraded
note: required by a bound in `hyper::server::conn::http1::Builder::serve_connection`
   --> /Users/hi-rustin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.0.0-rc.4/src/server/conn/http1.rs:359:19
    |
359 |         I: Read + Write + Unpin,
    |                   ^^^^^ required by this bound in `Builder::serve_connection`

error[E0599]: the method `with_upgrades` exists for struct `Connection<TcpStream, ServiceFn<[[email protected]:98:51], Incoming>>`, but its trait bounds were not satisfied
   --> axum/src/serve.rs:138:18
    |
135 |               match http1::Builder::new()
    |  ___________________-
136 | |                 .serve_connection(tcp_stream, service)
137 | |                 // for websockets
138 | |                 .with_upgrades()
    | |                 -^^^^^^^^^^^^^ method cannot be called due to unsatisfied trait bounds
    | |_________________|
    | 
    |
   ::: /Users/hi-rustin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.1/src/net/tcp/stream.rs:69:5
    |
69  |       pub struct TcpStream {
    |       --------------------
    |       |
    |       doesn't satisfy `tokio::net::TcpStream: hyper::rt::Read`
    |       doesn't satisfy `tokio::net::TcpStream: hyper::rt::Write`
    |
    = note: the full type name has been written to '/Volumes/t7/code/axum/target/debug/deps/axum-aaccf8d8ae7886df.long-type-16884531195687648243.txt'
    = note: the following trait bounds were not satisfied:
            `tokio::net::TcpStream: hyper::rt::Read`
            `tokio::net::TcpStream: hyper::rt::Write`

Some errors have detailed explanations: E0277, E0599.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `axum` (lib) due to 3 previous errors

Solution

Use a fixed version hyper. But if bump it is OK. I can also bump it to 1.0.0-rc.4.

axum/Cargo.toml Outdated Show resolved Hide resolved
Signed-off-by: hi-rustin <[email protected]>
@jplatte jplatte enabled auto-merge (squash) July 12, 2023 14:58
Signed-off-by: hi-rustin <[email protected]>
auto-merge was automatically disabled July 12, 2023 15:14

Head branch was pushed to by a user without write access

Signed-off-by: hi-rustin <[email protected]>
@jplatte
Copy link
Member

jplatte commented Jul 13, 2023

@hi-rustin looks like some UI tests are failing now :/

Can you run TRYBUILD=overwrite cargo +nightly test -p axum-macros with an up-to-date nightly toolchain to fix the latest CI error?

@Rustin170506
Copy link
Contributor Author

@hi-rustin looks like some UI tests are failing now :/

Can you run TRYBUILD=overwrite cargo +nightly test -p axum-macros with an up-to-date nightly toolchain to fix the latest CI error?

hahah, Deadlock: #2085

Let me merge them.

@Rustin170506
Copy link
Contributor Author

Rustin170506 commented Jul 13, 2023

@jplatte Fixed.
Thanks for your review! 💚 💙 💜 💛 ❤️

@Rustin170506 Rustin170506 changed the title Use exactly 1.0.0-rc.3 hyper Use exactly 1.0.0-rc.3 hyper and update UI test Jul 13, 2023
@jplatte
Copy link
Member

jplatte commented Jul 13, 2023

Unfortunately it seems like there are more trybuild errors.

Signed-off-by: hi-rustin <[email protected]>
@Rustin170506
Copy link
Contributor Author

Unfortunately it seems like there are more trybuild errors.

Yes, it causes by the different nightly versions.

Signed-off-by: hi-rustin <[email protected]>
Signed-off-by: hi-rustin <[email protected]>
@jplatte jplatte merged commit 5503b32 into tokio-rs:main Jul 13, 2023
17 checks passed
@jplatte
Copy link
Member

jplatte commented Jul 13, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants