Skip to content

Commit 7d86f87

Browse files
committed
Clarify where the new function cannot be called
1 parent 5948264 commit 7d86f87

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

const-generic-const-fn-bounds.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ situations like the one described above.
129129
## `?const` opt out
130130

131131
There is often desire to add bounds to a `const` function's generic arguments, without wanting to
132-
call any of the methods on those generic bounds. Prominent examples are `new` methods:
132+
call any of the methods on those generic bounds. Prominent examples are `new` functions:
133133

134134
```rust
135135
struct Foo<T: Trait>(T);
@@ -138,7 +138,8 @@ const fn new<T: Trait>(t: T) -> Foo<T> {
138138
}
139139
```
140140

141-
Unfortunately, with the given syntax in this RFC, one can now only call the `new` method if `T` has
141+
Unfortunately, with the given syntax in this RFC, one can now only call the `new` function in a const
142+
context if `T` has
142143
an `impl const Trait for T { ... }`. Thus an opt-out similar to `?Sized` can be used:
143144

144145
```rust

0 commit comments

Comments
 (0)