2025-07-13 16:49:19 +08:00
|
|
|
error: `[const]` can only be applied to `const` traits
|
2025-06-29 01:31:53 +02:00
|
|
|
--> $DIR/const-bounds-non-const-trait.rs:6:21
|
2023-12-18 17:55:55 +01:00
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
LL | const fn perform<T: [const] NonConst>() {}
|
2025-06-29 01:31:53 +02:00
|
|
|
| ^^^^^^^ can't be applied to `NonConst`
|
2024-12-09 19:34:43 +00:00
|
|
|
|
|
2025-07-13 16:49:19 +08:00
|
|
|
help: mark `NonConst` as `const` to allow it to have `const` implementations
|
2024-12-09 19:34:43 +00:00
|
|
|
|
|
|
|
|
|
LL | #[const_trait] trait NonConst {}
|
|
|
|
|
| ++++++++++++++
|
2023-12-18 17:55:55 +01:00
|
|
|
|
2025-07-13 16:49:19 +08:00
|
|
|
error: `[const]` can only be applied to `const` traits
|
2025-06-29 01:31:53 +02:00
|
|
|
--> $DIR/const-bounds-non-const-trait.rs:6:21
|
2024-10-20 19:49:11 +00:00
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
LL | const fn perform<T: [const] NonConst>() {}
|
2025-06-29 01:31:53 +02:00
|
|
|
| ^^^^^^^ can't be applied to `NonConst`
|
2024-10-20 19:49:11 +00:00
|
|
|
|
|
|
|
|
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
2025-07-13 16:49:19 +08:00
|
|
|
help: mark `NonConst` as `const` to allow it to have `const` implementations
|
2024-12-09 19:34:43 +00:00
|
|
|
|
|
|
|
|
|
LL | #[const_trait] trait NonConst {}
|
|
|
|
|
| ++++++++++++++
|
2024-10-20 19:49:11 +00:00
|
|
|
|
2025-07-13 16:49:19 +08:00
|
|
|
error: `const` can only be applied to `const` traits
|
2024-10-26 20:54:38 +00:00
|
|
|
--> $DIR/const-bounds-non-const-trait.rs:10:15
|
2023-12-18 17:55:55 +01:00
|
|
|
|
|
|
|
|
|
LL | fn operate<T: const NonConst>() {}
|
2024-12-09 19:34:43 +00:00
|
|
|
| ^^^^^ can't be applied to `NonConst`
|
|
|
|
|
|
|
2025-07-13 16:49:19 +08:00
|
|
|
help: mark `NonConst` as `const` to allow it to have `const` implementations
|
2024-12-09 19:34:43 +00:00
|
|
|
|
|
|
|
|
|
LL | #[const_trait] trait NonConst {}
|
|
|
|
|
| ++++++++++++++
|
2023-12-18 17:55:55 +01:00
|
|
|
|
2024-10-30 18:03:44 +00:00
|
|
|
error: aborting due to 3 previous errors
|
2023-12-18 17:55:55 +01:00
|
|
|
|