rust/tests/ui/const-generics/mgca/tuple_expr_arg_complex.stderr
Noah Lev 9a30ec8149 Implement MVP for opaque generic const arguments
This is meant to be the interim successor to generic const expressions.
Essentially, const item RHS's will be allowed to do arbitrary const
operations using generics. The limitation is that these const items will
be treated opaquely, like ADTs in nominal typing, such that uses of them
will only be equal if the same const item is referenced. In other words,
two const items with the exact same RHS will not be considered equal.

I also added some logic to check feature gates that depend on others
being enabled (like oGCA depending on mGCA).

= Coherence =

During coherence, OGCA consts should be normalized ambiguously because
they are opaque but eventually resolved to a real value. We don't want
two OGCAs that have the same value to be treated as distinct for
coherence purposes. (Just like opaque types.)

This actually doesn't work yet because there are pre-existing
fundamental issues with equate relations involving consts that need to
be normalized. The problem is that we normalize only one layer of the
const item and don't actually process the resulting anon const. Normally
the created inference variable should be handled, which in this case
would cause us to hit the anon const, but that's not happening.
Specifically, `visit_const` on `Generalizer` should be updated to be
similar to `visit_ty`.
2026-02-08 18:15:11 +00:00

28 lines
1,014 B
Text

error: complex const arguments must be placed inside of a `const` block
--> $DIR/tuple_expr_arg_complex.rs:13:25
|
LL | takes_tuple::<{ (N, N + 1) }>();
| ^^^^^
error: complex const arguments must be placed inside of a `const` block
--> $DIR/tuple_expr_arg_complex.rs:14:25
|
LL | takes_tuple::<{ (N, T::ASSOC + 1) }>();
| ^^^^^^^^^^^^
error: complex const arguments must be placed inside of a `const` block
--> $DIR/tuple_expr_arg_complex.rs:16:36
|
LL | takes_nested_tuple::<{ (N, (N, N + 1)) }>();
| ^^^^^
error: generic parameters may not be used in const operations
--> $DIR/tuple_expr_arg_complex.rs:17:44
|
LL | takes_nested_tuple::<{ (N, (N, const { N + 1 })) }>();
| ^
|
= help: add `#![feature(opaque_generic_const_args)]` to allow generic expressions as the RHS of const items
error: aborting due to 4 previous errors