1
Fork 0

Remove constness from ImplSource::Param

This commit is contained in:
Deadbeef 2023-08-13 13:59:19 +00:00
commit f441fa08da
29 changed files with 122 additions and 189 deletions

View file

@ -1,23 +1,33 @@
error: `~const` is not allowed here
--> $DIR/tilde-const-and-const-params.rs:25:11
--> $DIR/tilde-const-and-const-params.rs:26:11
|
LL | fn bar<A: ~const Add42, const N: usize>(_: Foo<N>) -> Foo<{ A::add(N) }> {
| ^^^^^^^^^^^^
|
note: this function is not `const`, so it cannot have `~const` trait bounds
--> $DIR/tilde-const-and-const-params.rs:25:4
--> $DIR/tilde-const-and-const-params.rs:26:4
|
LL | fn bar<A: ~const Add42, const N: usize>(_: Foo<N>) -> Foo<{ A::add(N) }> {
| ^^^
error[E0015]: cannot call non-const fn `<A as Add42>::add` in constants
--> $DIR/tilde-const-and-const-params.rs:25:61
error[E0308]: mismatched types
--> $DIR/tilde-const-and-const-params.rs:26:61
|
LL | fn bar<A: ~const Add42, const N: usize>(_: Foo<N>) -> Foo<{ A::add(N) }> {
| ^^^^^^^^^
| ^^^^^^^^^ expected `false`, found `true`
|
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
= note: expected constant `false`
found constant `true`
error: aborting due to 2 previous errors
error[E0308]: mismatched types
--> $DIR/tilde-const-and-const-params.rs:9:44
|
LL | fn add<A: ~const Add42>(self) -> Foo<{ A::add(N) }> {
| ^^^^^^^^^ expected `false`, found `true`
|
= note: expected constant `false`
found constant `true`
For more information about this error, try `rustc --explain E0015`.
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0308`.