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

Mismatched types #15

Closed
freedxmgxd opened this issue Oct 5, 2022 · 3 comments
Closed

Mismatched types #15

freedxmgxd opened this issue Oct 5, 2022 · 3 comments

Comments

@freedxmgxd
Copy link

Trying to use firebase in a project and get following error:

error[E0308]: mismatched types
    --> /home/shinmen/.cargo/registry/src/github.com-1ecc6299db9ec823/firestore-0.11.0/src/db/transaction.rs:113:62
     |
113  |         transaction_span.record("/firestore/transaction_id", hex_trans_id);
     |                          ------                              ^^^^^^^^^^^^
     |                          |                                   |
     |                          |                                   expected reference, found struct `std::string::String`
     |                          |                                   help: consider borrowing here: `&hex_trans_id`
     |                          arguments to this function are incorrect
     |
     = note: expected reference `&_`
                   found struct `std::string::String`
note: associated function defined here
    --> /home/shinmen/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-0.1.35/src/span.rs:1194:12
     |
1194 |     pub fn record<Q: ?Sized, V>(&self, field: &Q, value: &V) -> &Self
     |            ^^^^^^

error[E0277]: the size for values of type `str` cannot be known at compilation time
    --> /home/shinmen/.cargo/registry/src/github.com-1ecc6299db9ec823/firestore-0.11.0/src/db/transaction.rs:153:35
     |
153  |             self.transaction_span.record(
     |                                   ^^^^^^ doesn't have a size known at compile-time
     |
     = help: the trait `Sized` is not implemented for `str`
note: required by a bound in `tracing::Span::record`
    --> /home/shinmen/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-0.1.35/src/span.rs:1194:30
     |
1194 |     pub fn record<Q: ?Sized, V>(&self, field: &Q, value: &V) -> &Self
     |                              ^ required by this bound in `tracing::Span::record`

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `firestore` due to 2 previous errors
@freedxmgxd
Copy link
Author

Delete the cargo.lock works for me.

@abdolence
Copy link
Owner

Hey, interesting. Probably some inconsistency was coming from different versions of tracing related packages.

@abdolence
Copy link
Owner

This crate is always checked by github actions anyway for any PR/commit, so if it doesn't compile I would know immediately.

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

No branches or pull requests

2 participants