-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Receiver and DispatchFromDyn probably shouldn't be dyn-compatible? #149094
Copy link
Copy link
Open
Labels
A-dyn-compatibilityArea: Dyn compatibility (formerly: object safety)Area: Dyn compatibility (formerly: object safety)C-bugCategory: This is a bug.Category: This is a bug.F-arbitrary_self_types`#![feature(arbitrary_self_types)]``#![feature(arbitrary_self_types)]`F-dispatch_from_dyn`#![feature(dispatch_from_dyn)]``#![feature(dispatch_from_dyn)]`T-langRelevant to the language teamRelevant to the language teamT-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-dyn-compatibilityArea: Dyn compatibility (formerly: object safety)Area: Dyn compatibility (formerly: object safety)C-bugCategory: This is a bug.Category: This is a bug.F-arbitrary_self_types`#![feature(arbitrary_self_types)]``#![feature(arbitrary_self_types)]`F-dispatch_from_dyn`#![feature(dispatch_from_dyn)]``#![feature(dispatch_from_dyn)]`T-langRelevant to the language teamRelevant to the language teamT-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Currently,
ReceiverandDispatchFromDynare dyn-compatible. This is a way to produce a type that implements those two traits without going through the "normal procedures" of making animpl. This is rather strange. Should we make them dyn-incompatible?As far as I can tell, I can't cause ICEs or unsoundness with this.
dyn Receiverseems to function "correctly", such as in the below code, which compiles and runs without errors:Meanwhile, my attempt to abuse
dyn DispatchFromDynmerely caused a cycle error due to the type ouroboros required.cc @dingxiangfei2009
Meta
Tested on the playground with version
1.93.0-nightly (2025-11-18 3d461af2a23456a2676a)