Skip to content

Conversation

@N1ark
Copy link

@N1ark N1ark commented Nov 29, 2025

Adapt the unsizing metadata code, taking inspiration from rustc source. This means we now also support unsizes for e.g. Rc<[T;N]> -> Rc<[T]>.

Rename UnsizingMetadata::VTablePtr -> DirectVTable, to signify an unsize from a non-dyn type into a dyn type (meaning the VTable is statically known!).
This is in contrast to the new NestedVTable, for dyn-dyn casts. In these cases, we translate the ImplExprs from the source and target type, as well as a reindexes field, for whether a reindexing is needed (e.g. dyn T + 'static -> dyn T is a no-op).

@Nadrieril
Copy link
Member

For Rc etc, my plan is to add a fake to_unsize method to the CoerceUnsize trait and call that, which would enable composable and polymorphic tracking of what exactly happens, rather than needing a builtin operation that clients have to implement. We'd generate the body of that method for each custom ptr that supports unsizing.

@N1ark
Copy link
Author

N1ark commented Nov 30, 2025

For Rc etc, my plan is to add a fake to_unsize method to the CoerceUnsize trait and call that, which would enable composable and polymorphic tracking of what exactly happens, rather than needing a builtin operation that clients have to implement. We'd generate the body of that method for each custom ptr that supports unsizing.

hmm as long as that's optional that sounds good :) on a semantics level i'm not fully sure that works without implying any reborrows or loss of region tracking but it could be worth a try for sure

@N1ark N1ark force-pushed the vtables branch 3 times, most recently from 266d6a3 to 8791f80 Compare December 1, 2025 15:40
@Nadrieril Nadrieril merged commit 67e65e6 into AeneasVerif:main Dec 1, 2025
@N1ark N1ark deleted the vtables branch December 1, 2025 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants