diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index 7c922417ee29f..4ad32d7c9fd94 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -2394,7 +2394,7 @@ impl FnSig { /// * the `G = Ty` in `Trait = Ty>` /// * the `A: Bound` in `Trait` /// * the `RetTy` in `Trait(ArgTy, ArgTy) -> RetTy` -/// * the `C = { Ct }` in `Trait` (feature `associated_const_equality`) +/// * the `C = { Ct }` in `Trait` (feature `min_generic_const_args`) /// * the `f(..): Bound` in `Trait` (feature `return_type_notation`) #[derive(Clone, Encodable, Decodable, Debug, Walkable)] pub struct AssocItemConstraint { diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index e13782282891b..1f3831243139c 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -3298,7 +3298,7 @@ pub enum ImplItemKind<'hir> { /// * the `G = Ty` in `Trait = Ty>` /// * the `A: Bound` in `Trait` /// * the `RetTy` in `Trait(ArgTy, ArgTy) -> RetTy` -/// * the `C = { Ct }` in `Trait` (feature `associated_const_equality`) +/// * the `C = { Ct }` in `Trait` (feature `min_generic_const_args`) /// * the `f(..): Bound` in `Trait` (feature `return_type_notation`) #[derive(Debug, Clone, Copy, HashStable_Generic)] pub struct AssocItemConstraint<'hir> { diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs index 9ae6a9fac5046..72d21371f66cc 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs @@ -575,8 +575,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { // FIXME: point at the type params that don't have appropriate lifetimes: // struct S1 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, diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_trait.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_trait.rs index edb79592e6c5e..2aed66d27e963 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_trait.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_trait.rs @@ -503,8 +503,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { // FIXME: point at the type params that don't have appropriate lifetimes: // struct S1 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, diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt index 45187a0b6450e..0b7fbad2a8a47 100644 --- a/src/tools/tidy/src/issues.txt +++ b/src/tools/tidy/src/issues.txt @@ -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 diff --git a/tests/ui/associated-type-bounds/const-projection-err.stock.stderr b/tests/ui/associated-type-bounds/const-projection-err.stock.stderr deleted file mode 100644 index 0cacec26aaeef..0000000000000 --- a/tests/ui/associated-type-bounds/const-projection-err.stock.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0271]: type mismatch resolving `::A == 1` - --> $DIR/const-projection-err.rs:16:11 - | -LL | foo::(); - | ^ 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>() {} - | ^^^^^ required by this bound in `foo` - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0271`. diff --git a/tests/ui/associated-consts/assoc-const-eq-ambiguity.rs b/tests/ui/const-generics/associated-const-bindings/ambiguity.rs similarity index 100% rename from tests/ui/associated-consts/assoc-const-eq-ambiguity.rs rename to tests/ui/const-generics/associated-const-bindings/ambiguity.rs diff --git a/tests/ui/associated-consts/assoc-const-eq-ambiguity.stderr b/tests/ui/const-generics/associated-const-bindings/ambiguity.stderr similarity index 92% rename from tests/ui/associated-consts/assoc-const-eq-ambiguity.stderr rename to tests/ui/const-generics/associated-const-bindings/ambiguity.stderr index cf4805aaf5920..a14afe9d6923b 100644 --- a/tests/ui/associated-consts/assoc-const-eq-ambiguity.stderr +++ b/tests/ui/const-generics/associated-const-bindings/ambiguity.stderr @@ -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) {} T: Parent0::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` diff --git a/tests/ui/associated-consts/assoc-const-ty-mismatch.rs b/tests/ui/const-generics/associated-const-bindings/assoc-const-ty-mismatch.rs similarity index 100% rename from tests/ui/associated-consts/assoc-const-ty-mismatch.rs rename to tests/ui/const-generics/associated-const-bindings/assoc-const-ty-mismatch.rs diff --git a/tests/ui/associated-consts/assoc-const-ty-mismatch.stderr b/tests/ui/const-generics/associated-const-bindings/assoc-const-ty-mismatch.stderr similarity index 100% rename from tests/ui/associated-consts/assoc-const-ty-mismatch.stderr rename to tests/ui/const-generics/associated-const-bindings/assoc-const-ty-mismatch.stderr diff --git a/tests/ui/associated-consts/assoc-const.rs b/tests/ui/const-generics/associated-const-bindings/assoc-const.rs similarity index 100% rename from tests/ui/associated-consts/assoc-const.rs rename to tests/ui/const-generics/associated-const-bindings/assoc-const.rs diff --git a/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty-not-wf.rs b/tests/ui/const-generics/associated-const-bindings/bound-var-in-ty-not-wf.rs similarity index 100% rename from tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty-not-wf.rs rename to tests/ui/const-generics/associated-const-bindings/bound-var-in-ty-not-wf.rs diff --git a/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty-not-wf.stderr b/tests/ui/const-generics/associated-const-bindings/bound-var-in-ty-not-wf.stderr similarity index 73% rename from tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty-not-wf.stderr rename to tests/ui/const-generics/associated-const-bindings/bound-var-in-ty-not-wf.stderr index 76868715b861a..a4f97525b5156 100644 --- a/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty-not-wf.stderr +++ b/tests/ui/const-generics/associated-const-bindings/bound-var-in-ty-not-wf.stderr @@ -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 { () } | ^^^^^^^^^^^^ diff --git a/tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty.rs b/tests/ui/const-generics/associated-const-bindings/bound-var-in-ty.rs similarity index 100% rename from tests/ui/associated-consts/assoc-const-eq-bound-var-in-ty.rs rename to tests/ui/const-generics/associated-const-bindings/bound-var-in-ty.rs diff --git a/tests/ui/associated-consts/assoc-const-eq-ty-alias-noninteracting.rs b/tests/ui/const-generics/associated-const-bindings/coexisting-with-type-binding.rs similarity index 100% rename from tests/ui/associated-consts/assoc-const-eq-ty-alias-noninteracting.rs rename to tests/ui/const-generics/associated-const-bindings/coexisting-with-type-binding.rs diff --git a/tests/ui/const-generics/associated_const_equality/coherence.rs b/tests/ui/const-generics/associated-const-bindings/coherence.rs similarity index 100% rename from tests/ui/const-generics/associated_const_equality/coherence.rs rename to tests/ui/const-generics/associated-const-bindings/coherence.rs diff --git a/tests/ui/const-generics/associated_const_equality/coherence.stderr b/tests/ui/const-generics/associated-const-bindings/coherence.stderr similarity index 100% rename from tests/ui/const-generics/associated_const_equality/coherence.stderr rename to tests/ui/const-generics/associated-const-bindings/coherence.stderr diff --git a/tests/ui/associated-type-bounds/issue-99828.rs b/tests/ui/const-generics/associated-const-bindings/const-bound-to-assoc-ty-99828.rs similarity index 100% rename from tests/ui/associated-type-bounds/issue-99828.rs rename to tests/ui/const-generics/associated-const-bindings/const-bound-to-assoc-ty-99828.rs diff --git a/tests/ui/associated-type-bounds/issue-99828.stderr b/tests/ui/const-generics/associated-const-bindings/const-bound-to-assoc-ty-99828.stderr similarity index 91% rename from tests/ui/associated-type-bounds/issue-99828.stderr rename to tests/ui/const-generics/associated-const-bindings/const-bound-to-assoc-ty-99828.stderr index e1dc1f07d9cb6..692e511fb469e 100644 --- a/tests/ui/associated-type-bounds/issue-99828.stderr +++ b/tests/ui/const-generics/associated-const-bindings/const-bound-to-assoc-ty-99828.stderr @@ -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 + '_ { | ^^^^^^^^^ @@ -9,7 +9,7 @@ LL | fn get_iter(vec: &[i32]) -> impl Iterator + '_ { = 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 + '_ { | ---- ^^ 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 + '_ { | ---- ^^ unexpected constant diff --git a/tests/ui/associated-type-bounds/const-projection-err.rs b/tests/ui/const-generics/associated-const-bindings/const-projection-err.rs similarity index 100% rename from tests/ui/associated-type-bounds/const-projection-err.rs rename to tests/ui/const-generics/associated-const-bindings/const-projection-err.rs diff --git a/tests/ui/associated-type-bounds/const-projection-err.stderr b/tests/ui/const-generics/associated-const-bindings/const-projection-err.stderr similarity index 100% rename from tests/ui/associated-type-bounds/const-projection-err.stderr rename to tests/ui/const-generics/associated-const-bindings/const-projection-err.stderr diff --git a/tests/ui/associated-consts/assoc-const-eq-const_evaluatable_unchecked.rs b/tests/ui/const-generics/associated-const-bindings/const_evaluatable_unchecked.rs similarity index 100% rename from tests/ui/associated-consts/assoc-const-eq-const_evaluatable_unchecked.rs rename to tests/ui/const-generics/associated-const-bindings/const_evaluatable_unchecked.rs diff --git a/tests/ui/associated-consts/equality-unused-issue-126729.rs b/tests/ui/const-generics/associated-const-bindings/equality-unused-issue-126729.rs similarity index 100% rename from tests/ui/associated-consts/equality-unused-issue-126729.rs rename to tests/ui/const-generics/associated-const-bindings/equality-unused-issue-126729.rs diff --git a/tests/ui/const-generics/associated_const_equality/equality_bound_with_infer.rs b/tests/ui/const-generics/associated-const-bindings/equality_bound_with_infer.rs similarity index 100% rename from tests/ui/const-generics/associated_const_equality/equality_bound_with_infer.rs rename to tests/ui/const-generics/associated-const-bindings/equality_bound_with_infer.rs diff --git a/tests/ui/associated-consts/assoc-const-eq-esc-bound-var-in-ty.rs b/tests/ui/const-generics/associated-const-bindings/esc-bound-var-in-ty.rs similarity index 100% rename from tests/ui/associated-consts/assoc-const-eq-esc-bound-var-in-ty.rs rename to tests/ui/const-generics/associated-const-bindings/esc-bound-var-in-ty.rs diff --git a/tests/ui/associated-consts/assoc-const-eq-esc-bound-var-in-ty.stderr b/tests/ui/const-generics/associated-const-bindings/esc-bound-var-in-ty.stderr similarity index 89% rename from tests/ui/associated-consts/assoc-const-eq-esc-bound-var-in-ty.stderr rename to tests/ui/const-generics/associated-const-bindings/esc-bound-var-in-ty.stderr index ef861cb7f49a4..122893662933d 100644 --- a/tests/ui/associated-consts/assoc-const-eq-esc-bound-var-in-ty.stderr +++ b/tests/ui/const-generics/associated-const-bindings/esc-bound-var-in-ty.stderr @@ -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` diff --git a/tests/ui/associated-consts/issue-102335-const.rs b/tests/ui/const-generics/associated-const-bindings/issue-102335-const.rs similarity index 100% rename from tests/ui/associated-consts/issue-102335-const.rs rename to tests/ui/const-generics/associated-const-bindings/issue-102335-const.rs diff --git a/tests/ui/associated-consts/issue-102335-const.stderr b/tests/ui/const-generics/associated-const-bindings/issue-102335-const.stderr similarity index 100% rename from tests/ui/associated-consts/issue-102335-const.stderr rename to tests/ui/const-generics/associated-const-bindings/issue-102335-const.stderr diff --git a/tests/ui/associated-consts/issue-105330.rs b/tests/ui/const-generics/associated-const-bindings/issue-105330.rs similarity index 100% rename from tests/ui/associated-consts/issue-105330.rs rename to tests/ui/const-generics/associated-const-bindings/issue-105330.rs diff --git a/tests/ui/associated-consts/issue-105330.stderr b/tests/ui/const-generics/associated-const-bindings/issue-105330.stderr similarity index 100% rename from tests/ui/associated-consts/issue-105330.stderr rename to tests/ui/const-generics/associated-const-bindings/issue-105330.stderr diff --git a/tests/ui/associated-consts/issue-93835.rs b/tests/ui/const-generics/associated-const-bindings/issue-93835.rs similarity index 100% rename from tests/ui/associated-consts/issue-93835.rs rename to tests/ui/const-generics/associated-const-bindings/issue-93835.rs diff --git a/tests/ui/associated-consts/issue-93835.stderr b/tests/ui/const-generics/associated-const-bindings/issue-93835.stderr similarity index 100% rename from tests/ui/associated-consts/issue-93835.stderr rename to tests/ui/const-generics/associated-const-bindings/issue-93835.stderr diff --git a/tests/ui/const-generics/associated_const_equality/mismatched-types-with-generic-in-ace-no-feature-gate.rs b/tests/ui/const-generics/associated-const-bindings/mismatched-types-with-generic-in-ace-no-feature-gate.rs similarity index 100% rename from tests/ui/const-generics/associated_const_equality/mismatched-types-with-generic-in-ace-no-feature-gate.rs rename to tests/ui/const-generics/associated-const-bindings/mismatched-types-with-generic-in-ace-no-feature-gate.rs diff --git a/tests/ui/const-generics/associated_const_equality/mismatched-types-with-generic-in-ace-no-feature-gate.stderr b/tests/ui/const-generics/associated-const-bindings/mismatched-types-with-generic-in-ace-no-feature-gate.stderr similarity index 100% rename from tests/ui/const-generics/associated_const_equality/mismatched-types-with-generic-in-ace-no-feature-gate.stderr rename to tests/ui/const-generics/associated-const-bindings/mismatched-types-with-generic-in-ace-no-feature-gate.stderr diff --git a/tests/ui/const-generics/associated_const_equality/mismatched-types-with-generic-in-ace.rs b/tests/ui/const-generics/associated-const-bindings/mismatched-types-with-generic-in-ace.rs similarity index 100% rename from tests/ui/const-generics/associated_const_equality/mismatched-types-with-generic-in-ace.rs rename to tests/ui/const-generics/associated-const-bindings/mismatched-types-with-generic-in-ace.rs diff --git a/tests/ui/const-generics/associated_const_equality/mismatched-types-with-generic-in-ace.stderr b/tests/ui/const-generics/associated-const-bindings/mismatched-types-with-generic-in-ace.stderr similarity index 100% rename from tests/ui/const-generics/associated_const_equality/mismatched-types-with-generic-in-ace.stderr rename to tests/ui/const-generics/associated-const-bindings/mismatched-types-with-generic-in-ace.stderr diff --git a/tests/ui/associated-consts/assoc-const-eq-missing.rs b/tests/ui/const-generics/associated-const-bindings/missing.rs similarity index 100% rename from tests/ui/associated-consts/assoc-const-eq-missing.rs rename to tests/ui/const-generics/associated-const-bindings/missing.rs diff --git a/tests/ui/associated-consts/assoc-const-eq-missing.stderr b/tests/ui/const-generics/associated-const-bindings/missing.stderr similarity index 82% rename from tests/ui/associated-consts/assoc-const-eq-missing.stderr rename to tests/ui/const-generics/associated-const-bindings/missing.stderr index 318c85dcfd6fd..cbcfcf4c62d12 100644 --- a/tests/ui/associated-consts/assoc-const-eq-missing.stderr +++ b/tests/ui/const-generics/associated-const-bindings/missing.stderr @@ -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>() {} | ^ 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>() {} | ^ 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>() {} | ^ help: there is an associated constant with a similar name: `N` diff --git a/tests/ui/associated-consts/assoc-const-eq-param-in-ty.rs b/tests/ui/const-generics/associated-const-bindings/param-in-ty.rs similarity index 100% rename from tests/ui/associated-consts/assoc-const-eq-param-in-ty.rs rename to tests/ui/const-generics/associated-const-bindings/param-in-ty.rs diff --git a/tests/ui/associated-consts/assoc-const-eq-param-in-ty.stderr b/tests/ui/const-generics/associated-const-bindings/param-in-ty.stderr similarity index 89% rename from tests/ui/associated-consts/assoc-const-eq-param-in-ty.stderr rename to tests/ui/const-generics/associated-const-bindings/param-in-ty.stderr index b742e68044b0c..719dad816a6f4 100644 --- a/tests/ui/associated-consts/assoc-const-eq-param-in-ty.stderr +++ b/tests/ui/const-generics/associated-const-bindings/param-in-ty.stderr @@ -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) {} | -------------^^^^------------ @@ -41,7 +41,7 @@ LL | fn take1(_: impl Project) {} | 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) {} | - ^^^^ its type must not depend on the type parameter `P` @@ -51,7 +51,7 @@ LL | fn take2>(_: 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: 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: Trait<'r, Self, Q, K = const { loop {} }> | ^ its type must not depend on `Self` @@ -70,7 +70,7 @@ LL | type Assoc: 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: Trait<'r, Self, Q, K = const { loop {} }> | - ^ its type must not depend on the const parameter `Q` @@ -80,7 +80,7 @@ LL | type Assoc: 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: 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: Trait<'r, Self, Q, K = const { loop {} }> | ^ its type must not depend on `Self` @@ -101,7 +101,7 @@ LL | type Assoc: 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: Trait<'r, Self, Q, K = const { loop {} }> | - ^ its type must not depend on the const parameter `Q` diff --git a/tests/ui/associated-consts/projection-unspecified-but-bounded.rs b/tests/ui/const-generics/associated-const-bindings/projection-unspecified-but-bounded.rs similarity index 100% rename from tests/ui/associated-consts/projection-unspecified-but-bounded.rs rename to tests/ui/const-generics/associated-const-bindings/projection-unspecified-but-bounded.rs diff --git a/tests/ui/associated-consts/projection-unspecified-but-bounded.stderr b/tests/ui/const-generics/associated-const-bindings/projection-unspecified-but-bounded.stderr similarity index 100% rename from tests/ui/associated-consts/projection-unspecified-but-bounded.stderr rename to tests/ui/const-generics/associated-const-bindings/projection-unspecified-but-bounded.stderr diff --git a/tests/ui/associated-consts/assoc-const-eq-supertraits.rs b/tests/ui/const-generics/associated-const-bindings/supertraits.rs similarity index 100% rename from tests/ui/associated-consts/assoc-const-eq-supertraits.rs rename to tests/ui/const-generics/associated-const-bindings/supertraits.rs diff --git a/tests/ui/const-generics/assoc_const_eq_diagnostic.rs b/tests/ui/const-generics/associated-const-bindings/unbraced-enum-variant.rs similarity index 100% rename from tests/ui/const-generics/assoc_const_eq_diagnostic.rs rename to tests/ui/const-generics/associated-const-bindings/unbraced-enum-variant.rs diff --git a/tests/ui/const-generics/assoc_const_eq_diagnostic.stderr b/tests/ui/const-generics/associated-const-bindings/unbraced-enum-variant.stderr similarity index 87% rename from tests/ui/const-generics/assoc_const_eq_diagnostic.stderr rename to tests/ui/const-generics/associated-const-bindings/unbraced-enum-variant.stderr index 05e0ec93d4945..6608df2ebfbca 100644 --- a/tests/ui/const-generics/assoc_const_eq_diagnostic.stderr +++ b/tests/ui/const-generics/associated-const-bindings/unbraced-enum-variant.stderr @@ -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 {} | ^^^^^^^^^^ @@ -8,7 +8,7 @@ LL | pub trait CoolStuff: Parse {} | 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 {} | ---- ^^^^^^^^^^ unexpected type @@ -25,7 +25,7 @@ LL | pub trait CoolStuff: Parse {} | 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 {} | + + 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 {} | ---- ^^^^^^^^^^ unexpected type @@ -43,7 +43,7 @@ LL | pub trait CoolStuff: Parse {} | 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 {} | + + 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 {} | ---- ^^^^^^^^^^ unexpected type @@ -62,7 +62,7 @@ LL | pub trait CoolStuff: Parse {} | 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; | ^^^^^^^^^^^^^^^^ diff --git a/tests/ui/const-generics/associated_const_equality/unconstrained_impl_param.rs b/tests/ui/const-generics/associated-const-bindings/unconstrained_impl_param.rs similarity index 100% rename from tests/ui/const-generics/associated_const_equality/unconstrained_impl_param.rs rename to tests/ui/const-generics/associated-const-bindings/unconstrained_impl_param.rs diff --git a/tests/ui/const-generics/associated_const_equality/unconstrained_impl_param.stderr b/tests/ui/const-generics/associated-const-bindings/unconstrained_impl_param.stderr similarity index 100% rename from tests/ui/const-generics/associated_const_equality/unconstrained_impl_param.stderr rename to tests/ui/const-generics/associated-const-bindings/unconstrained_impl_param.stderr diff --git a/tests/ui/const-generics/mgca/using-fnptr-as-type_const.rs b/tests/ui/const-generics/associated-const-bindings/using-fnptr-as-type_const.rs similarity index 100% rename from tests/ui/const-generics/mgca/using-fnptr-as-type_const.rs rename to tests/ui/const-generics/associated-const-bindings/using-fnptr-as-type_const.rs diff --git a/tests/ui/const-generics/mgca/using-fnptr-as-type_const.stderr b/tests/ui/const-generics/associated-const-bindings/using-fnptr-as-type_const.stderr similarity index 100% rename from tests/ui/const-generics/mgca/using-fnptr-as-type_const.stderr rename to tests/ui/const-generics/associated-const-bindings/using-fnptr-as-type_const.stderr diff --git a/tests/ui/generic-const-items/associated-const-equality.rs b/tests/ui/generic-const-items/assoc-const-bindings.rs similarity index 100% rename from tests/ui/generic-const-items/associated-const-equality.rs rename to tests/ui/generic-const-items/assoc-const-bindings.rs