Make sure to be sound in the face of coinductive `unsafe trait` impls
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start with the two Rust Playground examples in the issue and compare the behavior of recursive auto-trait and non-auto-trait impls. The issue does not name repository files or tests; done requires a maintainer decision on whether to accept the unsoundness or define and implement a restriction.
Written by the indexing model from the issue text.
Description
Rust currently has a soundness hole where coinductive unsafe trait impls are unsound, e.g.:
struct NotSend(Rc<()>);
unsafe impl Send for NotSend
where
NotSend: Send
{}
Note that this only holds for auto traits. In particular, recursive impls for non-auto traits are considered unsatisfied:
error[E0275]: overflow evaluating the requirement `NotSend: Foo`
--> src/lib.rs:11:5
|
11 | NotSend: Foo
| ^^^^^^^^^^^^
|
= help: see issue #48214
We need to figure out whether we're okay saying "we're unsound because Rust itself is unsound" or whether we want to try to forbid these somehow.
cc @lcnr
- Dominant language
- Rust
- Stars
- 2.6k
- Forks
- 194
- Avg merge
- 18h 15m
- Merged PRs (30d)
- 14
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from google/zerocopy
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Features to support optional defmt for the byteorder typesPossibly taken A pull request linked to this issue is open or already merged. Opencustomer-request
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
google/zerocopy#3914 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
google/zerocopy#3766 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
swc-project/swc-next-issues#533 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
eandualem/agent-interface#290 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day