Auto merge of #150844 - fmease:mv-ace-tests, r=BoxyUwU

mGCA: Move tests for assoc const bindings (formerly ACE) into dedicated directory & replace more mentions of ACE

Split out of PR rust-lang/rust#150843.
As discussed.

Somewhat obvious underlying principle: If the test checks basic or core parts of assoc const bindings and nothing else, move it, otherwise leave it even if it contains ACEs.

Motivation: It makes a lot easier for me to continue working on ACE efficiently.

r? @BoxyUwU
This commit is contained in:
bors
2026-01-12 20:08:40 +00:00
50 changed files with 37 additions and 57 deletions
+1 -1
View File
@@ -2396,7 +2396,7 @@ impl FnSig {
/// * the `G<Ty> = Ty` in `Trait<G<Ty> = Ty>`
/// * the `A: Bound` in `Trait<A: Bound>`
/// * the `RetTy` in `Trait(ArgTy, ArgTy) -> RetTy`
/// * the `C = { Ct }` in `Trait<C = { Ct }>` (feature `associated_const_equality`)
/// * the `C = { Ct }` in `Trait<C = { Ct }>` (feature `min_generic_const_args`)
/// * the `f(..): Bound` in `Trait<f(..): Bound>` (feature `return_type_notation`)
#[derive(Clone, Encodable, Decodable, Debug, Walkable)]
pub struct AssocItemConstraint {
+1 -1
View File
@@ -3312,7 +3312,7 @@ pub enum ImplItemKind<'hir> {
/// * the `G<Ty> = Ty` in `Trait<G<Ty> = Ty>`
/// * the `A: Bound` in `Trait<A: Bound>`
/// * the `RetTy` in `Trait(ArgTy, ArgTy) -> RetTy`
/// * the `C = { Ct }` in `Trait<C = { Ct }>` (feature `associated_const_equality`)
/// * the `C = { Ct }` in `Trait<C = { Ct }>` (feature `min_generic_const_args`)
/// * the `f(..): Bound` in `Trait<f(..): Bound>` (feature `return_type_notation`)
#[derive(Debug, Clone, Copy, HashStable_Generic)]
pub struct AssocItemConstraint<'hir> {
@@ -575,8 +575,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
// FIXME: point at the type params that don't have appropriate lifetimes:
// struct S1<F: for<'a> Fn(&i32, &i32) -> &'a i32>(F);
// ---- ---- ^^^^^^^
// NOTE(associated_const_equality): This error should be impossible to trigger
// with associated const equality constraints.
// NOTE(mgca): This error should be impossible to trigger with assoc const bindings.
self.validate_late_bound_regions(
late_bound_in_projection_ty,
late_bound_in_term,
@@ -503,8 +503,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
// FIXME: point at the type params that don't have appropriate lifetimes:
// struct S1<F: for<'a> Fn(&i32, &i32) -> &'a i32>(F);
// ---- ---- ^^^^^^^
// NOTE(associated_const_equality): This error should be impossible to trigger
// with associated const equality constraints.
// NOTE(mgca): This error should be impossible to trigger with assoc const bindings.
self.validate_late_bound_regions(
late_bound_in_projection_term,
late_bound_in_term,
+3 -4
View File
@@ -33,8 +33,6 @@ ui/asm/issue-99122.rs
ui/asm/x86_64/issue-82869.rs
ui/asm/x86_64/issue-89875.rs
ui/asm/x86_64/issue-96797.rs
ui/associated-consts/issue-102335-const.rs
ui/associated-consts/issue-105330.rs
ui/associated-consts/issue-110933.rs
ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.rs
ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.rs
@@ -45,7 +43,6 @@ ui/associated-consts/issue-63496.rs
ui/associated-consts/issue-69020-assoc-const-arith-overflow.rs
ui/associated-consts/issue-88599-ref-self.rs
ui/associated-consts/issue-93775.rs
ui/associated-consts/issue-93835.rs
ui/associated-inherent-types/issue-104260.rs
ui/associated-inherent-types/issue-109071.rs
ui/associated-inherent-types/issue-109299-1.rs
@@ -70,7 +67,6 @@ ui/associated-type-bounds/issue-73818.rs
ui/associated-type-bounds/issue-79949.rs
ui/associated-type-bounds/issue-81193.rs
ui/associated-type-bounds/issue-83017.rs
ui/associated-type-bounds/issue-99828.rs
ui/associated-type-bounds/return-type-notation/issue-120208-higher-ranked-const.rs
ui/associated-types/issue-18655.rs
ui/associated-types/issue-19081.rs
@@ -498,6 +494,9 @@ ui/confuse-field-and-method/issue-18343.rs
ui/confuse-field-and-method/issue-2392.rs
ui/confuse-field-and-method/issue-32128.rs
ui/confuse-field-and-method/issue-33784.rs
ui/const-generics/associated-const-bindings/issue-102335-const.rs
ui/const-generics/associated-const-bindings/issue-105330.rs
ui/const-generics/associated-const-bindings/issue-93835.rs
ui/const-generics/generic_arg_infer/issue-91614.rs
ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.rs
ui/const-generics/generic_const_exprs/issue-100217.rs
@@ -1,17 +0,0 @@
error[E0271]: type mismatch resolving `<T as TraitWAssocConst>::A == 1`
--> $DIR/const-projection-err.rs:16:11
|
LL | foo::<T>();
| ^ expected `1`, found `0`
|
= note: expected constant `1`
found constant `0`
note: required by a bound in `foo`
--> $DIR/const-projection-err.rs:13:28
|
LL | fn foo<T: TraitWAssocConst<A = 1>>() {}
| ^^^^^ required by this bound in `foo`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0271`.
@@ -1,5 +1,5 @@
error[E0222]: ambiguous associated constant `K` in bounds of `Trait0`
--> $DIR/assoc-const-eq-ambiguity.rs:13:25
--> $DIR/ambiguity.rs:13:25
|
LL | const K: ();
| -----------
@@ -17,7 +17,7 @@ LL | fn take0(_: impl Trait0<K = const { }>) {}
T: Parent0<i32>::K = const { }
error[E0222]: ambiguous associated constant `C` in bounds of `Trait1`
--> $DIR/assoc-const-eq-ambiguity.rs:26:25
--> $DIR/ambiguity.rs:26:25
|
LL | const C: i32;
| ------------ ambiguous `C` from `Parent1`
@@ -1,11 +1,11 @@
error: higher-ranked subtype error
--> $DIR/assoc-const-eq-bound-var-in-ty-not-wf.rs:21:13
--> $DIR/bound-var-in-ty-not-wf.rs:21:13
|
LL | K = const { () }
| ^^^^^^^^^^^^
error: higher-ranked subtype error
--> $DIR/assoc-const-eq-bound-var-in-ty-not-wf.rs:21:13
--> $DIR/bound-var-in-ty-not-wf.rs:21:13
|
LL | K = const { () }
| ^^^^^^^^^^^^
@@ -1,5 +1,5 @@
error[E0658]: associated const equality is incomplete
--> $DIR/issue-99828.rs:1:43
--> $DIR/const-bound-to-assoc-ty-99828.rs:1:43
|
LL | fn get_iter(vec: &[i32]) -> impl Iterator<Item = {}> + '_ {
| ^^^^^^^^^
@@ -9,7 +9,7 @@ LL | fn get_iter(vec: &[i32]) -> impl Iterator<Item = {}> + '_ {
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error: expected type, found constant
--> $DIR/issue-99828.rs:1:50
--> $DIR/const-bound-to-assoc-ty-99828.rs:1:50
|
LL | fn get_iter(vec: &[i32]) -> impl Iterator<Item = {}> + '_ {
| ---- ^^ unexpected constant
@@ -20,7 +20,7 @@ note: the associated type is defined here
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
error: expected type, found constant
--> $DIR/issue-99828.rs:1:50
--> $DIR/const-bound-to-assoc-ty-99828.rs:1:50
|
LL | fn get_iter(vec: &[i32]) -> impl Iterator<Item = {}> + '_ {
| ---- ^^ unexpected constant
@@ -1,5 +1,5 @@
error: the type of the associated constant `K` cannot capture late-bound generic parameters
--> $DIR/assoc-const-eq-esc-bound-var-in-ty.rs:15:35
--> $DIR/esc-bound-var-in-ty.rs:15:35
|
LL | fn take(_: impl for<'r> Trait<'r, K = const { &() }>) {}
| -- ^ its type cannot capture the late-bound lifetime parameter `'r`
@@ -1,17 +1,17 @@
error[E0220]: associated constant `Z` not found for `Foo`
--> $DIR/assoc-const-eq-missing.rs:14:16
--> $DIR/missing.rs:14:16
|
LL | fn foo1<F: Foo<Z = 3>>() {}
| ^ help: there is an associated constant with a similar name: `N`
error[E0220]: associated type `Z` not found for `Foo`
--> $DIR/assoc-const-eq-missing.rs:16:16
--> $DIR/missing.rs:16:16
|
LL | fn foo2<F: Foo<Z = usize>>() {}
| ^ associated type `Z` not found
error[E0220]: associated constant `Z` not found for `Foo`
--> $DIR/assoc-const-eq-missing.rs:18:16
--> $DIR/missing.rs:18:16
|
LL | fn foo3<F: Foo<Z = 5>>() {}
| ^ help: there is an associated constant with a similar name: `N`
@@ -1,5 +1,5 @@
error: the type of the associated constant `K` must not depend on generic parameters
--> $DIR/assoc-const-eq-param-in-ty.rs:22:29
--> $DIR/param-in-ty.rs:22:29
|
LL | fn take0<'r, A: 'r + ConstParamTy_, const Q: usize>(
| -- the lifetime parameter `'r` is defined here
@@ -10,7 +10,7 @@ LL | _: impl Trait<'r, A, Q, K = const { loop {} }>
= note: `K` has type `&'r [A; Q]`
error: the type of the associated constant `K` must not depend on generic parameters
--> $DIR/assoc-const-eq-param-in-ty.rs:22:29
--> $DIR/param-in-ty.rs:22:29
|
LL | fn take0<'r, A: 'r + ConstParamTy_, const Q: usize>(
| - the type parameter `A` is defined here
@@ -21,7 +21,7 @@ LL | _: impl Trait<'r, A, Q, K = const { loop {} }>
= note: `K` has type `&'r [A; Q]`
error: the type of the associated constant `K` must not depend on generic parameters
--> $DIR/assoc-const-eq-param-in-ty.rs:22:29
--> $DIR/param-in-ty.rs:22:29
|
LL | fn take0<'r, A: 'r + ConstParamTy_, const Q: usize>(
| - the const parameter `Q` is defined here
@@ -32,7 +32,7 @@ LL | _: impl Trait<'r, A, Q, K = const { loop {} }>
= note: `K` has type `&'r [A; Q]`
error: the type of the associated constant `SELF` must not depend on `impl Trait`
--> $DIR/assoc-const-eq-param-in-ty.rs:39:26
--> $DIR/param-in-ty.rs:39:26
|
LL | fn take1(_: impl Project<SELF = const {}>) {}
| -------------^^^^------------
@@ -41,7 +41,7 @@ LL | fn take1(_: impl Project<SELF = const {}>) {}
| the `impl Trait` is specified here
error: the type of the associated constant `SELF` must not depend on generic parameters
--> $DIR/assoc-const-eq-param-in-ty.rs:44:21
--> $DIR/param-in-ty.rs:44:21
|
LL | fn take2<P: Project<SELF = const {}>>(_: P) {}
| - ^^^^ its type must not depend on the type parameter `P`
@@ -51,7 +51,7 @@ LL | fn take2<P: Project<SELF = const {}>>(_: P) {}
= note: `SELF` has type `P`
error: the type of the associated constant `K` must not depend on generic parameters
--> $DIR/assoc-const-eq-param-in-ty.rs:53:52
--> $DIR/param-in-ty.rs:53:52
|
LL | trait Iface<'r>: ConstParamTy_ {
| -- the lifetime parameter `'r` is defined here
@@ -62,7 +62,7 @@ LL | type Assoc<const Q: usize>: Trait<'r, Self, Q, K = const { loop {} }>
= note: `K` has type `&'r [Self; Q]`
error: the type of the associated constant `K` must not depend on `Self`
--> $DIR/assoc-const-eq-param-in-ty.rs:53:52
--> $DIR/param-in-ty.rs:53:52
|
LL | type Assoc<const Q: usize>: Trait<'r, Self, Q, K = const { loop {} }>
| ^ its type must not depend on `Self`
@@ -70,7 +70,7 @@ LL | type Assoc<const Q: usize>: Trait<'r, Self, Q, K = const { loop {} }>
= note: `K` has type `&'r [Self; Q]`
error: the type of the associated constant `K` must not depend on generic parameters
--> $DIR/assoc-const-eq-param-in-ty.rs:53:52
--> $DIR/param-in-ty.rs:53:52
|
LL | type Assoc<const Q: usize>: Trait<'r, Self, Q, K = const { loop {} }>
| - ^ its type must not depend on the const parameter `Q`
@@ -80,7 +80,7 @@ LL | type Assoc<const Q: usize>: Trait<'r, Self, Q, K = const { loop {} }>
= note: `K` has type `&'r [Self; Q]`
error: the type of the associated constant `K` must not depend on generic parameters
--> $DIR/assoc-const-eq-param-in-ty.rs:53:52
--> $DIR/param-in-ty.rs:53:52
|
LL | trait Iface<'r>: ConstParamTy_ {
| -- the lifetime parameter `'r` is defined here
@@ -92,7 +92,7 @@ LL | type Assoc<const Q: usize>: Trait<'r, Self, Q, K = const { loop {} }>
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: the type of the associated constant `K` must not depend on `Self`
--> $DIR/assoc-const-eq-param-in-ty.rs:53:52
--> $DIR/param-in-ty.rs:53:52
|
LL | type Assoc<const Q: usize>: Trait<'r, Self, Q, K = const { loop {} }>
| ^ its type must not depend on `Self`
@@ -101,7 +101,7 @@ LL | type Assoc<const Q: usize>: Trait<'r, Self, Q, K = const { loop {} }>
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: the type of the associated constant `K` must not depend on generic parameters
--> $DIR/assoc-const-eq-param-in-ty.rs:53:52
--> $DIR/param-in-ty.rs:53:52
|
LL | type Assoc<const Q: usize>: Trait<'r, Self, Q, K = const { loop {} }>
| - ^ its type must not depend on the const parameter `Q`
@@ -1,5 +1,5 @@
error[E0573]: expected type, found variant `Mode::Cool`
--> $DIR/assoc_const_eq_diagnostic.rs:13:35
--> $DIR/unbraced-enum-variant.rs:13:35
|
LL | pub trait CoolStuff: Parse<MODE = Mode::Cool> {}
| ^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | pub trait CoolStuff: Parse<MODE = Mode::Cool> {}
| help: try using the variant's enum: `Mode`
error[E0573]: expected type, found variant `Mode::Cool`
--> $DIR/assoc_const_eq_diagnostic.rs:19:17
--> $DIR/unbraced-enum-variant.rs:19:17
|
LL | fn no_help() -> Mode::Cool {}
| ^^^^^^^^^^
@@ -17,7 +17,7 @@ LL | fn no_help() -> Mode::Cool {}
| help: try using the variant's enum: `Mode`
error: expected constant, found type
--> $DIR/assoc_const_eq_diagnostic.rs:13:35
--> $DIR/unbraced-enum-variant.rs:13:35
|
LL | pub trait CoolStuff: Parse<MODE = Mode::Cool> {}
| ---- ^^^^^^^^^^ unexpected type
@@ -25,7 +25,7 @@ LL | pub trait CoolStuff: Parse<MODE = Mode::Cool> {}
| expected a constant because of this associated constant
|
note: the associated constant is defined here
--> $DIR/assoc_const_eq_diagnostic.rs:10:5
--> $DIR/unbraced-enum-variant.rs:10:5
|
LL | const MODE: Mode;
| ^^^^^^^^^^^^^^^^
@@ -35,7 +35,7 @@ LL | pub trait CoolStuff: Parse<MODE = { Mode::Cool }> {}
| + +
error: expected constant, found type
--> $DIR/assoc_const_eq_diagnostic.rs:13:35
--> $DIR/unbraced-enum-variant.rs:13:35
|
LL | pub trait CoolStuff: Parse<MODE = Mode::Cool> {}
| ---- ^^^^^^^^^^ unexpected type
@@ -43,7 +43,7 @@ LL | pub trait CoolStuff: Parse<MODE = Mode::Cool> {}
| expected a constant because of this associated constant
|
note: the associated constant is defined here
--> $DIR/assoc_const_eq_diagnostic.rs:10:5
--> $DIR/unbraced-enum-variant.rs:10:5
|
LL | const MODE: Mode;
| ^^^^^^^^^^^^^^^^
@@ -54,7 +54,7 @@ LL | pub trait CoolStuff: Parse<MODE = { Mode::Cool }> {}
| + +
error: expected constant, found type
--> $DIR/assoc_const_eq_diagnostic.rs:13:35
--> $DIR/unbraced-enum-variant.rs:13:35
|
LL | pub trait CoolStuff: Parse<MODE = Mode::Cool> {}
| ---- ^^^^^^^^^^ unexpected type
@@ -62,7 +62,7 @@ LL | pub trait CoolStuff: Parse<MODE = Mode::Cool> {}
| expected a constant because of this associated constant
|
note: the associated constant is defined here
--> $DIR/assoc_const_eq_diagnostic.rs:10:5
--> $DIR/unbraced-enum-variant.rs:10:5
|
LL | const MODE: Mode;
| ^^^^^^^^^^^^^^^^