2025-03-11 12:08:45 +00:00
|
|
|
error: `[const]` is not allowed here
|
2025-06-29 01:31:53 +02:00
|
|
|
--> $DIR/conditionally-const-and-const-params.rs:8:15
|
2023-09-27 17:25:31 -04:00
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
LL | fn add<A: [const] Add42>(self) -> Foo<{ A::add(N) }> {
|
2025-06-29 01:31:53 +02:00
|
|
|
| ^^^^^^^
|
2023-09-27 17:25:31 -04:00
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
note: this function is not `const`, so it cannot have `[const]` trait bounds
|
2025-06-26 10:25:24 +00:00
|
|
|
--> $DIR/conditionally-const-and-const-params.rs:8:8
|
2023-09-27 17:25:31 -04:00
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
LL | fn add<A: [const] Add42>(self) -> Foo<{ A::add(N) }> {
|
2023-09-27 17:25:31 -04:00
|
|
|
| ^^^
|
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
error: `[const]` is not allowed here
|
2025-06-29 01:31:53 +02:00
|
|
|
--> $DIR/conditionally-const-and-const-params.rs:26:11
|
2022-10-20 19:32:16 +00:00
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
LL | fn bar<A: [const] Add42, const N: usize>(_: Foo<N>) -> Foo<{ A::add(N) }> {
|
2025-06-29 01:31:53 +02:00
|
|
|
| ^^^^^^^
|
2022-10-20 19:32:16 +00:00
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
note: this function is not `const`, so it cannot have `[const]` trait bounds
|
2025-06-26 10:25:24 +00:00
|
|
|
--> $DIR/conditionally-const-and-const-params.rs:26:4
|
2022-10-20 19:32:16 +00:00
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
LL | fn bar<A: [const] Add42, const N: usize>(_: Foo<N>) -> Foo<{ A::add(N) }> {
|
2022-10-20 19:32:16 +00:00
|
|
|
| ^^^
|
|
|
|
|
|
2024-10-22 03:22:57 +00:00
|
|
|
error[E0277]: the trait bound `A: const Add42` is not satisfied
|
2025-06-26 10:25:24 +00:00
|
|
|
--> $DIR/conditionally-const-and-const-params.rs:26:62
|
2024-06-30 17:08:45 +00:00
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
LL | fn bar<A: [const] Add42, const N: usize>(_: Foo<N>) -> Foo<{ A::add(N) }> {
|
|
|
|
|
| ^
|
2024-10-22 03:22:57 +00:00
|
|
|
|
|
|
|
|
error[E0277]: the trait bound `A: const Add42` is not satisfied
|
2025-06-26 10:25:24 +00:00
|
|
|
--> $DIR/conditionally-const-and-const-params.rs:8:45
|
2024-10-22 03:22:57 +00:00
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
LL | fn add<A: [const] Add42>(self) -> Foo<{ A::add(N) }> {
|
|
|
|
|
| ^
|
2024-06-30 17:08:45 +00:00
|
|
|
|
2024-10-22 03:22:57 +00:00
|
|
|
error: aborting due to 4 previous errors
|
2022-10-20 19:32:16 +00:00
|
|
|
|
2024-10-22 03:22:57 +00:00
|
|
|
For more information about this error, try `rustc --explain E0277`.
|