Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oeb25/rkyv-partial-eq-error-reproduction
https://github.com/oeb25/rkyv-partial-eq-error-reproduction
Last synced: about 9 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/oeb25/rkyv-partial-eq-error-reproduction
- Owner: oeb25
- Created: 2023-10-17T09:04:36.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-17T10:40:08.000Z (about 1 year ago)
- Last Synced: 2023-10-17T13:11:16.026Z (about 1 year ago)
- Language: Rust
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Reproduction for [scylladb/scylla-rust-driver#838](https://github.com/scylladb/scylla-rust-driver/pull/838)
Rust automatically dereferences `&&str` when comparing against `&str` as exemplified by the following example.
```rs
fn compiles() {
Some("") == Some(&"");
}
```However, adding any use of `rkyv` as in the following code:
```rs
use rkyv::AlignedVec;
fn does_not_compile() {
Some("") == Some(&"");
}
```Results in this error:
```rs
error[E0277]: can't compare `Option<&str>` with `Option<&&str>`
--> src/lib.rs:3:14
|
3 | Some("") == Some(&"");
| ^^ no implementation for `Option<&str> == Option<&&str>`
|
= help: the trait `PartialEq>` is not implemented for `Option<&str>`
= help: the following other types implement trait `PartialEq`:
> as PartialEq>>
as PartialEq>
as PartialEq>>
```---
This repository contains two crates, `okay` and `errors`, which reproduce the above successful and failing compile respectively.