Skip to content

Commit 3b7d008

Browse files
committed
test(toolchain_limitations): mark some traits with #[const_trait]
Again, implementing `const Trait` requires `Trait` to be marked with `#[const_trait]` starting from [rust-lang/rust#100982][1]. [1]: rust-lang/rust#100982
1 parent 3bb2017 commit 3b7d008

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

doc/toolchain_limitations.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ fn clone_projection<T: Trait>(p: &T::Proj) -> T::Proj {
147147
```rust,compile_fail,E0277
148148
#![feature(const_trait_impl)]
149149
150+
#[const_trait]
150151
trait Trait {
151152
type Proj: ~const Clone;
152153
}
@@ -163,6 +164,7 @@ const fn clone_projection<T: ~const Trait>(p: &T::Proj) -> T::Proj {
163164
```rust,compile_fail
164165
#![feature(const_trait_impl)]
165166
struct Cfg<C>(C);
167+
#[const_trait]
166168
trait CfgBase {}
167169
// error: `~const` is not allowed here
168170
impl<C: ~const CfgBase> Cfg<C> {
@@ -175,6 +177,7 @@ A work-around is to move the trait bounds to the `const fn`s inside.
175177
```rust
176178
#![feature(const_trait_impl)]
177179
struct Cfg<C>(C);
180+
#[const_trait]
178181
trait CfgBase {}
179182
impl<C> Cfg<C> {
180183
const fn num_task_priority_levels(&self, _: usize)

0 commit comments

Comments
 (0)