Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2394,7 +2394,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 {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3298,7 +3298,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> {
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 3 additions & 4 deletions src/tools/tidy/src/issues.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
17 changes: 0 additions & 17 deletions tests/ui/associated-type-bounds/const-projection-err.stock.stderr

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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: ();
| -----------
Expand All @@ -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`
Expand Down
Original file line number Diff line number Diff line change
@@ -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 { () }
| ^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -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 = {}> + '_ {
| ^^^^^^^^^
Expand All @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 {}>) {}
| -------------^^^^------------
Expand All @@ -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`
Expand All @@ -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
Expand All @@ -62,15 +62,15 @@ 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`
|
= 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`
Expand All @@ -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
Expand All @@ -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`
Expand All @@ -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`
Expand Down
Original file line number Diff line number Diff line change
@@ -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> {}
| ^^^^^^^^^^
Expand All @@ -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 {}
| ^^^^^^^^^^
Expand All @@ -17,15 +17,15 @@ 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
| |
| 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;
| ^^^^^^^^^^^^^^^^
Expand All @@ -35,15 +35,15 @@ 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
| |
| 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;
| ^^^^^^^^^^^^^^^^
Expand All @@ -54,15 +54,15 @@ 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
| |
| 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;
| ^^^^^^^^^^^^^^^^
Expand Down
Loading