Skip to content

Mismatched types: expected RawDocumentBuf, found Document #1363

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

Open
clarkmcc opened this issue Apr 25, 2025 · 5 comments
Open

Mismatched types: expected RawDocumentBuf, found Document #1363

clarkmcc opened this issue Apr 25, 2025 · 5 comments
Assignees
Labels

Comments

@clarkmcc
Copy link

Versions/Environment

  1. What version of Rust are you using? 1.78
  2. What operating system are you using? Ubuntu
  3. What versions of the driver and its dependencies are you using? (Run cargo pkgid mongodb & cargo pkgid bson) git+https://github.com/mongodb/mongo-rust-driver?branch=main#[email protected], git+https://github.com/mongodb/bson-rust?branch=main#[email protected]

Describe the bug

Compile error when I try to build the library

error[E0308]: mismatched types
   --> /home/runner/.cargo/git/checkouts/mongo-rust-driver-b939e0128fabb835/f258c21/src/operation/bulk_write.rs:129:67
    |
129 | ...                   RunCommand::new(namespace.db.clone(), kill_cursors, None, None)?;
    |                       ---------------                       ^^^^^^^^^^^^ expected `RawDocumentBuf`, found `Document`
    |                       |
    |                       arguments to this function are incorrect
    |
note: associated function defined here
   --> /home/runner/.cargo/git/checkouts/mongo-rust-driver-b939e0128fabb835/f258c21/src/operation/run_command.rs:22:19
    |
22  |     pub(crate) fn new(
    |                   ^^^
23  |         db: String,
24  |         command: RawDocumentBuf,
    |         -----------------------

error[E0277]: the `?` operator can only be applied to values that implement `Try`
   --> /home/runner/.cargo/git/checkouts/mongo-rust-driver-b939e0128fabb835/f258c21/src/operation/bulk_write.rs:129:29
    |
129 | ...                   RunCommand::new(namespace.db.clone(), kill_cursors, None, None)?;
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `operation::run_command::RunCommand<'_>`
    |
    = help: the trait `Try` is not implemented for `operation::run_command::RunCommand<'_>`

BE SPECIFIC:

  • Did this issue arise out of nowhere, or after an update (of the driver,
    server, and/or Rust)? Started today, probably after main branch was modified.
@clarkmcc
Copy link
Author

clarkmcc commented Apr 25, 2025

Could this be caused by #1356?

@isabelatkinson
Copy link
Contributor

@clarkmcc which feature flags do you have enabled?

@clarkmcc
Copy link
Author

clarkmcc commented Apr 25, 2025

@isabelatkinson None.

bson = { git = "https://github.com/mongodb/bson-rust", branch = "main", features = [
    "chrono-0_4",
    "serde_with",
] }
mongodb = { git = "https://github.com/mongodb/mongo-rust-driver", branch = "main" }

@isabelatkinson
Copy link
Contributor

Oh I see what happened. #1356 didn't pull in #1358 before it got merged, and those changes were incompatible. I'll get a PR up to fix this ASAP, but it might not get merged til next Monday when the rest of the team is back in. Thanks for reporting this!

@isabelatkinson
Copy link
Contributor

#1364

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

No branches or pull requests

2 participants