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

Compilation error for dynamic keys #17

Open
XX opened this issue Jul 19, 2019 · 1 comment
Open

Compilation error for dynamic keys #17

XX opened this issue Jul 19, 2019 · 1 comment

Comments

@XX
Copy link

XX commented Jul 19, 2019

When using keys as owned strings instead of &'static str:

slog = { version = "2.5.1", features = ["dynamic-keys"] }

this crate is not compiled:

Checking slog-kvfilter v0.7.0
error[E0277]: the trait bound `&str: std::borrow::Borrow<slog::Key>` is not satisfied
  --> /home/xx/.cargo/registry/src/github.com-1ecc6299db9ec823/slog-kvfilter-0.7.0/src/lib.rs:38:69
   |
38 |         let matched = if let Some(keyvalues) = self.pending_matches.get(&key) {
   |                                                                     ^^^ the trait `std::borrow::Borrow<slog::Key>` is not implemented for `&str`

error[E0277]: the trait bound `slog::Key: std::cmp::Eq` is not satisfied
  --> /home/xx/.cargo/registry/src/github.com-1ecc6299db9ec823/slog-kvfilter-0.7.0/src/lib.rs:38:69
   |
38 |         let matched = if let Some(keyvalues) = self.pending_matches.get(&key) {
   |                                                                     ^^^ the trait `std::cmp::Eq` is not implemented for `slog::Key`

error[E0277]: the trait bound `&'a str: std::borrow::Borrow<slog::Key>` is not satisfied
  --> /home/xx/.cargo/registry/src/github.com-1ecc6299db9ec823/slog-kvfilter-0.7.0/src/lib.rs:48:34
   |
48 |             self.pending_matches.remove(&key);
   |                                  ^^^^^^ the trait `std::borrow::Borrow<slog::Key>` is not implemented for `&'a str`

error[E0277]: the trait bound `slog::Key: std::cmp::Eq` is not satisfied
  --> /home/xx/.cargo/registry/src/github.com-1ecc6299db9ec823/slog-kvfilter-0.7.0/src/lib.rs:48:34
   |
48 |             self.pending_matches.remove(&key);
   |                                  ^^^^^^ the trait `std::cmp::Eq` is not implemented for `slog::Key`

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0277`.
error: Could not compile `slog-kvfilter`.
@przygienda
Copy link
Collaborator

ok, help would be appreciated ;-)

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