Repository navigation
Tracking issue for dyn-star #102425
Copy link
Copy link
Closed
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-dyn_star`#![feature(dyn_star)]``#![feature(dyn_star)]`T-langRelevant to the language teamRelevant to the language team
Description
This issue tracks known issues or missing functionality with support for dyn* Trait objects. These are an experimental feature that are meant to support async function in dyn traits.
In addition to the issues linked here, you can also find things that need to be done by greping the code for // FIXME(dyn-star) or looking at the F-dyn_star label.
- dyn* ICE primitive read not possible for type: [i32; 4] #102173
- &dyn* causes an ICE #102172
- Broken LLVM function when pushing
dyn*item to Vec. #102141 - Boxes can not be cast to dyn* #102427
- ICE involving references to dyn* #102429
- Bad MIR when casting a reference to dyn* #102430
- rustfmt eats dyn_star syntax rustfmt#5542
- Support pretty-printing
dyn*trait objects #134601 -
dyn*does not support trait upcasting #104800 -
dynanddyn*should (probably?) have their TyKind representation split from one another -- Create a new TyKind::DynStar variant #107908 was an attempt at this
Associated PRs
- Initial implementation of dyn* #101212
- (list is incomplete)
About this issue
This is a lang-team experiment -- there hasn't been an RFC for this functionality, we're exploring it both as a potential implementation detail and (more speculatively) a possible language feature in the future. You can read more about dyn* at this blog post.
Lang-team champion: @nikomatsakis
Reactions are currently unavailable
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-dyn_star`#![feature(dyn_star)]``#![feature(dyn_star)]`T-langRelevant to the language teamRelevant to the language team
Type
Projects
- StatusShow more project fieldsExploration
- StatusShow more project fieldsFeature Complete
Activity
Rageking8 commentedon Sep 29, 2022
@rustbot label +C-tracking-issue
Rollup merge of rust-lang#104557 - eholk:dyn-star-in-traits, r=compil…
Auto merge of rust-lang#106349 - LeSeulArtichaut:dyn-star-tracking-is…
RalfJung commentedon Feb 6, 2023
Currently the dynamic type hidden by
dyn*is required to matchusizein size and alignment. In principle it seems possible to allow smaller alignment, and possibly even smaller size (though in the latter case care has to be taken that the vtable always ends up at the same offset -- this would be easier if the vtable was the first component of the pair, not the 2nd). Are there plans to allow that?ds84182 commentedon Feb 6, 2023
Right now you can actually place smaller size & align types with
dyn*by stuffing it inside ausizewith a little bit ofunsafe. Due to the existing alignment requirements for the vtable ptr, it will always end up at the same offset as long assize_of::<T>() <= size_of::<usize>() && align_of::<T>() <= align_of::<usize>().RalfJung commentedon Feb 6, 2023
This is not true for
size_of::<T>() == 0. Also, this assumes that for ausize(and pointers),size == align.ds84182 commentedon Feb 6, 2023
Ah, right. I guess a better way to describe the requirements is something like
where
DynStarCompatible<T>matches the size and align ofusize. (of course, this still has the same assumption about usize and ptrs, but this could be trivially replaced with*const ())eholk commentedon Feb 7, 2023
Yes, this is something I would like to support.
RalfJung commentedon Feb 10, 2023
From the initial PR:
Honestly that seems like a shame -- this could be useful way beyond
async fnI think. (But then there are other proposals that are even more general so indeed stabilizing this particular one might be the wrong call.)20 remaining items
Unrolled build for rust-lang#134601
Rollup merge of rust-lang#134642 - kpreid:pointerlike-cell, r=compile…
Unrolled build for rust-lang#134642
Rollup merge of rust-lang#134642 - kpreid:pointerlike-cell, r=compile…
Rollup merge of rust-lang#143036 - compiler-errors:no-dyn-star, r=oli…
Auto merge of #143036 - compiler-errors:no-dyn-star, r=oli-obk
Auto merge of #143036 - compiler-errors:no-dyn-star, r=oli-obk
Auto merge of #143036 - compiler-errors:no-dyn-star, r=oli-obk
Auto merge of #143036 - compiler-errors:no-dyn-star, r=oli-obk
Auto merge of #143036 - compiler-errors:no-dyn-star, r=oli-obk
Auto merge of #143036 - compiler-errors:no-dyn-star, r=oli-obk