-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Tracking Issue for Field Projections #145383
Copy link
Copy link
Open
Labels
B-experimentalBlocker: In-tree experiment; RFC pending, not yet approved or unneeded (requires FCP to stabilize).Blocker: In-tree experiment; RFC pending, not yet approved or unneeded (requires FCP to stabilize).C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-field_projections`#![feature(field_projections)]``#![feature(field_projections)]`T-langRelevant to the language teamRelevant to the language team
Metadata
Metadata
Assignees
Labels
B-experimentalBlocker: In-tree experiment; RFC pending, not yet approved or unneeded (requires FCP to stabilize).Blocker: In-tree experiment; RFC pending, not yet approved or unneeded (requires FCP to stabilize).C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-field_projections`#![feature(field_projections)]``#![feature(field_projections)]`T-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Exploration
This is a tracking issue for work on Field Projections.
The feature gate for the issue is
#![feature(field_projections)].This is a lang experiment at the moment and the feature is subject to change substantially over time.
We have an active project goal for this effort: rust-lang/rust-project-goals#390
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.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.
Steps
Approve as lang experiment
a-mir-formality: create a formal model of the borrow checker changesHasPlacewith place expressions and projectionsPlaceReadinto the borrow checker (forCopytargets only)PlaceWrite,PlaceDrop,DropHuskandPlaceRead(also for!Copy) into the borrow checkerPlaceBorrowinto the borrow checkerImplementation: implement a compiler experiment
Fieldtrait: add field representing types #152730Unaligned<T>field_of!in expression position to improve ergonomics (reducing need for turbofish)coreadd lang items for field projections via virtual places #154940unsafeto access)a-mir-formalitymodelunsaferequirement on syntaxExperimentation: stress-test the experiment in real code
@placebe inferred?Untrusted<T>SeqLockRef<'_, T>MutexGuard<'_ ,T>Mutex<T>->Rcu<U>Arc<T>Box<T>ArcBorrow<'_, T>MappedMutexGuard<'_, T>UnsafeCell<T>Cell<T>ManuallyDrop<T>MaybeUninit<T>*const T&*mut TNonNull<T>Box<T>Arc<T>Rc<T>&[mut] TArcRef<T>&UniqueArcRef<T>ArcBorrow<'_, T>ArcBox<T>(?)WrappingPtr<T>MutexGuardRef<'_, T>MutexRef<'_, T>Own<'_, T>(aka&own T)ArcRef<T>&UniqueArcRef<T>ArcBorrow<'_, T>ArcBox<T>(?)WrappingPtr<T>cell::Ref[Mut]<'_, T>MutexGuardRef<'_, T>MutexRef<'_, T>{btree_map,hash_map}::Entry@joshtriplettpyo3@davidhewittPyRef[Mut]<'_, T>crubit@tmandryUser Research
HasPlace? Some good candidates arePlaceandDerefable.Unresolved Questions
Making them inhabited would allow APIs to take their value to reduce the amount of turbo-fish syntax in code
my_fun(field_of!(Struct, field))instead ofmy_fun::<field_of!(Struct, field)>(). There currently is no known advantage for provably uninhabited FRTs.Implementation history