Skip to content

Commit e18f475

Browse files
committed
RPIT
1 parent bc5cc29 commit e18f475

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

text/0000-const-trait-impls.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ Everywhere where non-const trait bounds can be written, but only for traits that
518518
* super trait bounds
519519
* where bounds
520520
* associated type bounds
521+
* return position impl trait
521522

522523
### `const` desugaring
523524

@@ -653,8 +654,9 @@ In the future we will also want to support `dyn (const) Trait` bounds, which inv
653654
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
654655
works if there were implicit `(const) Destruct` bounds for (most?) `(const) Trait` bounds.
655656

656-
Thus we require that all `trait`s with `(const)` methods also have a `(const) Destruct` super trait bound to ensure users don't need to add `(const) Destruct` bounds everywhere.
657-
We may relax this requirement in the future or make it implied.
657+
Thus we lint all `const trait`s with `(const)` methods that take `self` by value to also have a `(const) Destruct` super trait bound to ensure users don't need to add `(const) Destruct` bounds everywhere.
658+
Other traits may want to add them, and some traits with `self` by value methods may not want to add them. Since it is not backwards compatible to require or relax that super trait bound later,
659+
we aren't requiring users to choose either, but are suggesting good defaults via lints.
658660

659661
## `(const)` bounds on `Drop` impls
660662

0 commit comments

Comments
 (0)