Move tests for assoc const bindings into dedicated directory

This commit is contained in:
León Orell Valerian Liehr 2026-01-07 18:28:12 +01:00
parent 4d73a008ea
commit 092e522fa8
No known key found for this signature in database
GPG key ID: D17A07215F68E713
45 changed files with 33 additions and 51 deletions

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
@ -499,6 +495,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

View file

@ -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`.

View file

@ -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`

View file

@ -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 { () }
| ^^^^^^^^^^^^

View file

@ -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

View file

@ -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`

View file

@ -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`

View file

@ -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`

View file

@ -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;
| ^^^^^^^^^^^^^^^^