fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.6 KiB45 linesraw
1error: `~const` is not allowed here
2  --> $DIR/tilde-const-and-const-params.rs:9:15
3   |
4LL |     fn add<A: ~const Add42>(self) -> Foo<{ A::add(N) }> {
5   |               ^^^^^^^^^^^^
6   |
7note: this function is not `const`, so it cannot have `~const` trait bounds
8  --> $DIR/tilde-const-and-const-params.rs:9:8
9   |
10LL |     fn add<A: ~const Add42>(self) -> Foo<{ A::add(N) }> {
11   |        ^^^
12
13error: `~const` is not allowed here
14  --> $DIR/tilde-const-and-const-params.rs:27:11
15   |
16LL | fn bar<A: ~const Add42, const N: usize>(_: Foo<N>) -> Foo<{ A::add(N) }> {
17   |           ^^^^^^^^^^^^
18   |
19note: this function is not `const`, so it cannot have `~const` trait bounds
20  --> $DIR/tilde-const-and-const-params.rs:27:4
21   |
22LL | fn bar<A: ~const Add42, const N: usize>(_: Foo<N>) -> Foo<{ A::add(N) }> {
23   |    ^^^
24
25error[E0308]: mismatched types
26  --> $DIR/tilde-const-and-const-params.rs:27:61
27   |
28LL | fn bar<A: ~const Add42, const N: usize>(_: Foo<N>) -> Foo<{ A::add(N) }> {
29   |                                                             ^^^^^^^^^ expected `false`, found `true`
30   |
31   = note: expected constant `false`
32              found constant `true`
33
34error[E0308]: mismatched types
35  --> $DIR/tilde-const-and-const-params.rs:9:44
36   |
37LL |     fn add<A: ~const Add42>(self) -> Foo<{ A::add(N) }> {
38   |                                            ^^^^^^^^^ expected `false`, found `true`
39   |
40   = note: expected constant `false`
41              found constant `true`
42
43error: aborting due to 4 previous errors
44
45For more information about this error, try `rustc --explain E0308`.