Skip to content

Commit 73db002

Browse files
committed
Address review comments
1 parent 7da95b8 commit 73db002

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

text/0000-const-trait-impls.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ This can be achieved across an edition by having some intermediate syntax like p
873873

874874
Then in the following edition, we can forbid the `#[next_const]` attribute and just make it the default.
875875

876-
The disadvantage of this is that by default, it creates stricter bounds than desired.
876+
The disadvantage of this is that sometimes, it creates stricter bounds than desired.
877877

878878
```rust
879879
const fn foo<T: Foo>() {
@@ -884,15 +884,13 @@ const fn foo<T: Foo>() {
884884
compiles today, and allows all types that implement `Foo`, irrespective of the constness of the impl.
885885
With the opt-out scheme that would still compile, but suddenly require callers to provide a const impl.
886886

887-
The safe default (and the one folks are used to for a few years now on stable), is that trait bounds just work, you just
888-
can't call methods on them.
889-
This is both useful in
887+
The alternative proposed above (and the one folks are used to for a few years now on stable), is that trait bounds mean the same on all functions, you just can't call methods on them in `const fn`.
890888

891889
* nudging function authors to using the minimal necessary bounds to get their function
892890
body to compile and thus requiring as little as possible from their callers,
893891
* ensuring our implementation is correct by default.
894892

895-
The implementation correctness argument is partially due to our history with `?const` (see https://github.com/rust-lang/rust/issues/83452 for where we got it wrong and thus decided to stop using opt-out), and partially with our history with `?` bounds not being great either (https://github.com/rust-lang/rust/issues/135229, https://github.com/rust-lang/rust/pull/132209). An opt-in is much easier to make sound and keep sound.
893+
The implementation correctness argument is partially due to our history with `cosnt fn` trait bounds (see https://github.com/rust-lang/rust/issues/83452 for where we got "reject all trait bounds" wrong and thus decided to stop using opt-out), and partially with our history with `?` bounds not being great either (https://github.com/rust-lang/rust/issues/135229, https://github.com/rust-lang/rust/pull/132209). An opt-in is much easier to make sound and keep sound.
896894

897895
To get more capabilities, you add more syntax. Thus the opt-out approach was not taken.
898896

0 commit comments

Comments
 (0)