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

Update to http 1.0 and hyper 1.1 on hard mode #7

Closed
wants to merge 5 commits into from

Conversation

jorendorff
Copy link
Contributor

@jorendorff jorendorff commented Jan 24, 2024

That is, without taking a dependency on axum.

The difficult part of this was actually getting any code using the crate to compile anymore, now that Server is gone. It looks easy if you just skim the diff, but when I gave up last night I was getting this error from rustc:

error: implementation of `From` is not general enough
  --> crates/twirp/src/test.rs:40:9
   |
40 |         tokio::spawn(test_server_handle_connection(io, router));
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `From` is not general enough
   |
   = note: `Box<(dyn StdError + std::marker::Send + Sync + 'static)>` must implement `From<Box<(dyn StdError + std::marker::Send + Sync + '0)>>`, for any lifetime `'0`...
   = note: ...but it actually implements `From<Box<(dyn StdError + std::marker::Send + Sync + 'static)>>`

This was with bf94528. The surprising thing about this error was if you replace the body of the function being called here, test_server_handle_connction, with todo!(), without changing the function signature, the type error goes away. 😬

rust has achieved the ultimate in safety, i can't get an http server to compile

That is, without taking a dependency on `axum`. This isn't finished; I have this compiler error:

```
error: implementation of `From` is not general enough
  --> crates/twirp/src/test.rs:40:9
   |
40 |         tokio::spawn(test_server_handle_connection(io, router));
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `From` is not general enough
   |
   = note: `Box<(dyn StdError + std::marker::Send + Sync + 'static)>` must implement `From<Box<(dyn StdError + std::marker::Send + Sync + '0)>>`, for any lifetime `'0`...
   = note: ...but it actually implements `From<Box<(dyn StdError + std::marker::Send + Sync + 'static)>>`
```

The surprising thing about this error is if you replace the body of the function being called here,
`test_server_handle_connction`, with `todo!()`, without changing the function signature, the type error
goes away.
@jorendorff jorendorff requested a review from a team as a code owner January 24, 2024 02:37
@jorendorff jorendorff marked this pull request as draft January 24, 2024 02:37
@jorendorff jorendorff marked this pull request as ready for review January 24, 2024 17:49
@jorendorff jorendorff closed this Jan 25, 2024
@jorendorff jorendorff deleted the jorendorff/hyper-update-alt branch February 10, 2024 04:24
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.

1 participant