You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: text/0000-const-trait-impls.md
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -545,6 +545,10 @@ In practice we have noticed that a large portion of APIs will have a `~const Des
545
545
This bound has little value as an explicit bound that appears almost everywhere.
546
546
Especially since it is a fairly straight forward assumption that a type that has const trait impls will also have a `const Drop` impl or only contain `const Destruct` types.
547
547
548
+
In the future we will also want to support `dyn ~const Trait` bounds, which invariably will require the type to implement `~const Destruct` in order to fill in the function pointer for the `drop` slot in the vtable.
549
+
While that can in generic contexts always be handled by adding more `~const Destruct` bounds, it would be more similar to how normal `dyn` safety
550
+
works if there were implicit `~const Destruct` bounds for (most?) `~const Trait` bounds.
551
+
548
552
Thus we give all `const trait`s a `~const Destruct` super trait to ensure users don't need to add `~const Destruct` bounds everywhere.
549
553
We may offer an opt out of this behaviour in the future, if there are convincing real world use cases.
0 commit comments