Deadbeef | ebf5028 | 2022-10-20 19:32:16 | [diff] [blame] | 1 | error: `~const` is not allowed here |
Raekye | 884af36 | 2023-09-27 21:25:31 | [diff] [blame] | 2 | --> $DIR/tilde-const-and-const-params.rs:9:15 |
| 3 | | |
| 4 | LL | fn add<A: ~const Add42>(self) -> Foo<{ A::add(N) }> { |
Deadbeef | 16040a1 | 2023-11-24 14:32:05 | [diff] [blame] | 5 | | ^^^^^^ |
Raekye | 884af36 | 2023-09-27 21:25:31 | [diff] [blame] | 6 | | |
| 7 | note: this function is not `const`, so it cannot have `~const` trait bounds |
| 8 | --> $DIR/tilde-const-and-const-params.rs:9:8 |
| 9 | | |
| 10 | LL | fn add<A: ~const Add42>(self) -> Foo<{ A::add(N) }> { |
| 11 | | ^^^ |
| 12 | |
| 13 | error: `~const` is not allowed here |
Michael Goulet | 8b7b8e5 | 2024-10-22 03:22:57 | [diff] [blame] | 14 | --> $DIR/tilde-const-and-const-params.rs:27:11 |
Deadbeef | ebf5028 | 2022-10-20 19:32:16 | [diff] [blame] | 15 | | |
| 16 | LL | fn bar<A: ~const Add42, const N: usize>(_: Foo<N>) -> Foo<{ A::add(N) }> { |
Deadbeef | 16040a1 | 2023-11-24 14:32:05 | [diff] [blame] | 17 | | ^^^^^^ |
Deadbeef | ebf5028 | 2022-10-20 19:32:16 | [diff] [blame] | 18 | | |
| 19 | note: this function is not `const`, so it cannot have `~const` trait bounds |
Michael Goulet | 8b7b8e5 | 2024-10-22 03:22:57 | [diff] [blame] | 20 | --> $DIR/tilde-const-and-const-params.rs:27:4 |
Deadbeef | ebf5028 | 2022-10-20 19:32:16 | [diff] [blame] | 21 | | |
| 22 | LL | fn bar<A: ~const Add42, const N: usize>(_: Foo<N>) -> Foo<{ A::add(N) }> { |
| 23 | | ^^^ |
| 24 | |
Michael Goulet | 8b7b8e5 | 2024-10-22 03:22:57 | [diff] [blame] | 25 | error[E0277]: the trait bound `A: const Add42` is not satisfied |
| 26 | --> $DIR/tilde-const-and-const-params.rs:27:61 |
Deadbeef | daff015 | 2024-06-30 17:08:45 | [diff] [blame] | 27 | | |
Michael Goulet | 8b7b8e5 | 2024-10-22 03:22:57 | [diff] [blame] | 28 | LL | fn bar<A: ~const Add42, const N: usize>(_: Foo<N>) -> Foo<{ A::add(N) }> { |
Michael Goulet | 30afeb0 | 2024-11-24 01:15:04 | [diff] [blame] | 29 | | ^ |
Deadbeef | daff015 | 2024-06-30 17:08:45 | [diff] [blame] | 30 | |
Michael Goulet | 8b7b8e5 | 2024-10-22 03:22:57 | [diff] [blame] | 31 | error[E0277]: the trait bound `A: const Add42` is not satisfied |
| 32 | --> $DIR/tilde-const-and-const-params.rs:9:44 |
| 33 | | |
| 34 | LL | fn add<A: ~const Add42>(self) -> Foo<{ A::add(N) }> { |
Michael Goulet | 30afeb0 | 2024-11-24 01:15:04 | [diff] [blame] | 35 | | ^ |
Deadbeef | ebf5028 | 2022-10-20 19:32:16 | [diff] [blame] | 36 | |
Michael Goulet | 8b7b8e5 | 2024-10-22 03:22:57 | [diff] [blame] | 37 | error: aborting due to 4 previous errors |
| 38 | |
| 39 | For more information about this error, try `rustc --explain E0277`. |