google / google/zerocopy

Remove some `Reference` bounds

Open
#1,943 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2.6k
Forks
179
Avg merge
1d 19h
Merged PRs (30d)
29

Description

Currently, some `Ptr` APIs require `A: Reference` where likely `A: Aliasing` would be sufficient. In particular, these APIs merely need the ability to read from their referents, and are compatible with owned pointers. In particular:

- `Ptr::as_ref` (though this would require changing `self` to `&self` to avoid moving owned pointers)
- `Ptr::reborrow`
- `Ptr::try_into_valid`
- `Ptr::as_bytes`
- `Ptr::try_cast_into` / `try_cast_into_no_leftover`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.