-
-
Notifications
You must be signed in to change notification settings - Fork 17.8k
Tracking Issue for #![feature(phantom_variance_markers)] #135806
Copy link
Copy link
Open
Labels
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 RFCI-libs-nominatedNominated for discussion during a libs team meeting.Nominated for discussion during a libs team meeting.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
Activity
Metadata
Metadata
Assignees
Labels
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 RFCI-libs-nominatedNominated for discussion during a libs team meeting.Nominated for discussion during a libs team meeting.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
View all comments
Feature gate:
#![feature(phantom_variance_markers)]This is a tracking issue for phantom variance markers, which are identical to
PhantomDatabut provide a self-documenting variance rather than contrived types such asPhantomData<fn() -> T>to indicate contravariance.Public API
Steps / History
Unresolved Questions
Lifetimetype or one for each possible variance? The former would mean writingPhantomCovariant<Lifetime<'a>>instead ofPhantomCovariantLifetime<'a>, with the API otherwise being identical.::new()? This would presumably mean adding 4–6 lang items, depending on the previous bullet point.#[rustc_pub_transparent]on these, allowing indirect inclusion in#[repr(transparent)]types?Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩