blob: 3ba5da39106d64f1e78b43c0fb2cbe43055e14ce (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
error: const trait bounds are not allowed in trait object types
--> $DIR/const-trait-bounds-trait-objects.rs:7:17
|
LL | let _: &dyn const Trait;
| ^^^^^^^^^^^
error: `[const]` is not allowed here
--> $DIR/const-trait-bounds-trait-objects.rs:8:17
|
LL | let _: &dyn [const] Trait;
| ^^^^^^^
|
= note: trait objects cannot have `[const]` trait bounds
error: const trait bounds are not allowed in trait object types
--> $DIR/const-trait-bounds-trait-objects.rs:13:25
|
LL | const fn handle(_: &dyn const NonConst) {}
| ^^^^^^^^^^^^^^
error: `[const]` is not allowed here
--> $DIR/const-trait-bounds-trait-objects.rs:16:23
|
LL | const fn take(_: &dyn [const] NonConst) {}
| ^^^^^^^
|
= note: trait objects cannot have `[const]` trait bounds
error: `const` can only be applied to `const` traits
--> $DIR/const-trait-bounds-trait-objects.rs:13:25
|
LL | const fn handle(_: &dyn const NonConst) {}
| ^^^^^ can't be applied to `NonConst`
|
help: mark `NonConst` as `const` to allow it to have `const` implementations
|
LL | #[const_trait] trait NonConst {}
| ++++++++++++++
error: `[const]` can only be applied to `const` traits
--> $DIR/const-trait-bounds-trait-objects.rs:16:23
|
LL | const fn take(_: &dyn [const] NonConst) {}
| ^^^^^^^ can't be applied to `NonConst`
|
help: mark `NonConst` as `const` to allow it to have `const` implementations
|
LL | #[const_trait] trait NonConst {}
| ++++++++++++++
error: aborting due to 6 previous errors
|