rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.15k stars 12.69k forks source link

Tracking issue for unsafe binder types #130516

Open traviscross opened 1 month ago

traviscross commented 1 month ago

This is a tracking issue for unsafe binder types. See https://hackmd.io/@compiler-errors/HkXwoBPaR for an initial design proposal.

The feature gate for the issue is #![feature(unsafe_binders)].

About tracking issues

Tracking issues are used to record the overall progress of implementation. They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions. A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature. Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.

Steps

Unresolved Questions

TODO.

Related

TODO.

cc @compiler-errors @rust-lang/lang

scottmcm commented 1 month ago

I'll second this. I think that having unsafe<'a> &'a T is a nice way to keep some of the properties we want from references without falling all the way down to pointers that lose various things.

I'll be curious to see what happens with things like what the validity invariants are and what LLVM attribute parameters it could still have, but that sounds like a great thing to experiment with.

traviscross commented 1 month ago

We accepted this experiment in the 2024-09-18 lang triage meeting.

Thanks to @compiler-errors for pushing this forward.