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

Fix build errors so quinn-proto can be used under wasm32-unknown-unknown #1387

Merged
merged 4 commits into from Jul 23, 2022

Conversation

thombles
Copy link
Contributor

This fixes a handful of basic things so that quinn-proto (with no default features) cleanly builds under the wasm32-unknown-unknown target, and can be used with a browser-based wasm-bindgen-test runner.

  • One of the transitive dependencies getrandom needs an additional feature to work in the browser
  • There is a warning about an unused import when the ring feature is not in use
  • There were some odd type inference failures:
   Compiling quinn-proto v0.8.0 (/home/tk/repos/quinn/quinn-proto)
error[E0283]: type annotations needed
   --> /home/tk/repos/quinn/quinn-proto/src/connection/streams/recv.rs:150:23
    |
150 |             if offset != final_offset.into() {
    |                       ^^ ------------------- this method call resolves to `T`
    |                       |
    |                       cannot infer type
    |
    = note: multiple `impl`s satisfying `u64: PartialEq<_>` found in the following crates: `core`, `serde_json`:
            - impl PartialEq for u64;
            - impl PartialEq<serde_json::value::Value> for u64;

error[E0283]: type annotations needed
   --> /home/tk/repos/quinn/quinn-proto/src/connection/streams/state.rs:285:26
    |
285 |         Ok(if bytes_read != final_offset.into() {
    |                          ^^ ------------------- this method call resolves to `T`
    |                          |
    |                          cannot infer type
    |
    = note: multiple `impl`s satisfying `u64: PartialEq<_>` found in the following crates: `core`, `serde_json`:
            - impl PartialEq for u64;
            - impl PartialEq<serde_json::value::Value> for u64;

error[E0282]: type annotations needed
   --> /home/tk/repos/quinn/quinn-proto/src/connection/mod.rs:746:62
    |
746 |                         == self.path.max_udp_payload_size as _),
    |                                                              ^ cannot infer type
    |
    = note: type must be known at this point

djc
djc previously approved these changes Jul 21, 2022
Copy link
Collaborator

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

quinn-proto/Cargo.toml Outdated Show resolved Hide resolved
Ralith
Ralith previously approved these changes Jul 22, 2022
@thombles thombles dismissed stale reviews from Ralith and djc via 29589ea July 22, 2022 23:09
@djc djc merged commit 065d7c3 into quinn-rs:main Jul 23, 2022
@thombles thombles deleted the tk/wasm branch July 25, 2022 08:12
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.

None yet

4 participants