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

add Send/Sync tests #403

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

add Send/Sync tests #403

wants to merge 1 commit into from

Conversation

notoriaga
Copy link
Contributor

Figured out a way to show/test an issue I've talked about before

error: future cannot be sent between threads safely
   --> crates/esthri/tests/integration/send_sync.rs:77:22
    |
77  |           require_send(&$value);
    |                        ^^^^^^^ future is not `Send`
...
115 | / async_assert_fn!(
116 | |     esthri::upload(_, &str, &str, &Path, opts::EsthriPutOptParams): Send & !Sync & !Unpin
117 | | );
    | |_- in this macro invocation
    |
    = help: the trait `Sync` is not implemented for `(dyn Stream<Item = Result<esthri_internals::hyper::body::Bytes, std::io::Error>> + std::marker::Send + 'static)`
note: required by a bound in `require_send`
   --> crates/esthri/tests/integration/send_sync.rs:41:20
    |
41  | fn require_send<T: Send>(_t: &T) {}
    |                    ^^^^ required by this bound in `require_send`
    = note: this error originates in the macro `async_assert_fn_send` which comes from the expansion of the macro `async_assert_fn` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: `esthri` (test "integration") generated 2 warnings

namely that the futures returned by some of the functions aren't Send which can make them more challenging to work with

@silverjam silverjam force-pushed the master branch 2 times, most recently from 0be51c8 to 66d2506 Compare February 4, 2023 06:18
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