Allow safe impls of `unsafe trait` default traits to assert that the implementation exists
Nobody has claimed this yet.
- Dominant language
- Markdown
- Stars
- 6.6k
- Forks
- 1.7k
- Avg merge
- 16h 14m
- Merged PRs (30d)
- 1
Description
e.g.
struct Foo { x: String }
impl Send for Foo {}
would be essentially the same as
impl Foo { x: String }
fn _assert() {
fn _send<T: Send>() {}
_send::<Foo>()
}
The impl is a no-op, just a static assertion: if the contents isn't Send, the compiler emits an error message.
I'm not sure if adding this is worth the confusion it may cause. Thoughts?
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
The issue provides Rust examples for an unsafe trait implementation and a generic assertion, but names no implementation files or tests. Start by reviewing the proposed syntax and the existing Rust RFC process, then determine the intended semantics and user-facing behavior. Done would require an agreed design rather than only the example shown.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100