diff options
| author | bors <bors@rust-lang.org> | 2023-11-19 10:59:34 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-11-19 10:59:34 +0000 |
| commit | 9c3a365fd2e2486d2b8efce99b0159821e2eca4f (patch) | |
| tree | 631d7ed246df383f98e2fa961bafb93997a3c36e /tests/rustdoc-js-std/parser-errors.js | |
| parent | dbd19f9b48e7a04ab1cd7c9577ea0d985d4b33f3 (diff) | |
| parent | 3c1e0afa58dbe1287c1e9a9ea704f9b76b6845cc (diff) | |
| download | rust-9c3a365fd2e2486d2b8efce99b0159821e2eca4f.tar.gz rust-9c3a365fd2e2486d2b8efce99b0159821e2eca4f.zip | |
Auto merge of #11781 - partiallytyped:11710, r=xFrednet
Verify Borrow<T> semantics for types that implement Hash, Borrow<str> and Borrow<[u8]>. Fixes #11710 The essence of the issue is that types that implement Borrow<T> provide a facet or a representation of the underlying type. Under these semantics `hash(a) == hash(a.borrow())`. This is a problem when a type implements `Borrow<str>`, `Borrow<[u8]>` and Hash, it is expected that the hash of all three types is identical. The problem is that the hash of [u8] is not the same as that of a String, even when the byte reference ([u8]) is derived from `.as_bytes()` - [x] Followed [lint naming conventions][lint_naming] - [x] Added passing UI tests (including committed `.stderr` file) - [x] `cargo test` passes locally - [x] Executed `cargo dev update_lints` - [x] Added lint documentation - [x] Run `cargo dev fmt` --- - [x] Explanation of the issue in the code - [x] Tests reproducing the issue - [x] Lint rule and emission --- changelog: New lint: [`impl_hash_borrow_with_str_and_bytes`] [#11781](https://github.com/rust-lang/rust-clippy/pull/11781)
Diffstat (limited to 'tests/rustdoc-js-std/parser-errors.js')
0 files changed, 0 insertions, 0 deletions
