2023-12-18 17:55:55 +01:00
|
|
|
error: const trait bounds are not allowed in trait object types
|
2024-06-25 07:52:44 +00:00
|
|
|
--> $DIR/const-trait-bounds-trait-objects.rs:9:17
|
2023-12-18 17:55:55 +01:00
|
|
|
|
|
|
|
|
|
LL | let _: &dyn const Trait;
|
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
error: `[const]` is not allowed here
|
|
|
|
|
--> $DIR/const-trait-bounds-trait-objects.rs:10:13
|
2024-01-03 09:24:42 +01:00
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
LL | let _: &dyn [const] Trait;
|
|
|
|
|
| ^^^^^^^^^^^
|
2024-01-03 09:24:42 +01:00
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
= note: trait objects cannot have `[const]` trait bounds
|
2024-01-03 09:24:42 +01:00
|
|
|
|
|
|
|
|
error: const trait bounds are not allowed in trait object types
|
2024-06-25 07:52:44 +00:00
|
|
|
--> $DIR/const-trait-bounds-trait-objects.rs:15:25
|
2024-01-03 09:24:42 +01:00
|
|
|
|
|
|
|
|
|
LL | const fn handle(_: &dyn const NonConst) {}
|
|
|
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
error: `[const]` is not allowed here
|
|
|
|
|
--> $DIR/const-trait-bounds-trait-objects.rs:17:19
|
2024-01-03 09:24:42 +01:00
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
LL | const fn take(_: &dyn [const] NonConst) {}
|
|
|
|
|
| ^^^^^^^^^^^
|
2024-01-03 09:24:42 +01:00
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
= note: trait objects cannot have `[const]` trait bounds
|
2024-01-03 09:24:42 +01:00
|
|
|
|
2024-06-25 07:52:44 +00:00
|
|
|
error: aborting due to 4 previous errors
|
2023-12-18 17:55:55 +01:00
|
|
|
|