Change:
I expect the following code to be rejected by the compiler but it is actually accepted and compiles successfully: The associated constant does not have any generic parameters / associated items (constants cannot have those anyways in the current version of Rust) and thus the argument list should be flagged as erroneous. Interestingly, if you remove the , the compiler correctly identifies this as an error: . I think is to be interpreted as a nested equality constraint (and not as a “defaulted” parameter, i.e. a parameter with a default value). : label T-compiler requires-nightly (it now does) Hence, I am just going to mention its tracking issue: . CC <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
Doesn't need assoc const equality: Let me take a quick stab at this. claim
On a related note, a slightly modified version of the code above leads to an ICE (I was about to create a separate issue for this, should I still do that?): <details<summarystderr (diagnostics & backtrace)</summary</detailsThis only leads to an ICE on the current nightly (2022-09-27) (e.g. on the playground) but not on older ones like (2022-09-21).
If you want to bisect it feel free, but I think fixing the original issue in this report will also fix this one.
Yeah, I think so, too. I guess I won't bisect this.
This regressed in the last day
Oh wait, I caused it: searched nightlies: from nightly-2022-08-01 to nightly-2022-09-26 regressed nightly: nightly-2022-09-26 searched commit range: regressed commit: <details<summarybisected with <a href=''cargo-bisect-rustc</av0.6.3</summaryHost triple: x86_64-unknown-linux-gnu Reproduce with: </details

Discussion:
"create_substs_for_associated_item(span: {:?}, item_def_id: {:?}, item_segment: {:?}", span, item_def_id, item_segment ); <del> self.create_substs_for_ast_path( </del> <ins> let (args, _) = self.create_substs_for_ast_path( </ins> span, item_def_id, parent_substs,

item_segment.args(), item_segment.infer_args, None, <del> ) .0 </del> <ins> ); let assoc_bindings = self.create_assoc_bindings_for_generic_args(item_segment.args()); if let Some(b) = assoc_bindings.first() { Self::prohibit_assoc_ty_binding(self.tcx(), b.span); } args </ins> } /// Instantiates the path for the given trait reference, assuming that it's

<ins> #![feature(associated_const_equality)] trait T { type A: S<C<X = 0i32> = 34>; //~^ ERROR associated type bindings are not allowed here } trait S { const C: i32; } fn main() {} </ins>

<ins> error[E0229]: associated type bindings are not allowed here --> $DIR/issue-102335-const.rs:4:17 | LL |     type A: S<C<X = 0i32> = 34>; |                 ^^^^^^^^ associated type not allowed here error: aborting due to previous error For more information about this error, try `rustc --explain E0229`. </ins>

<ins> trait T { type A: S<C<i32 = u32> = ()>; //~^ ERROR associated type bindings are not allowed here } trait Q {} trait S { type C: Q; } fn main() {} </ins>

<ins> error[E0229]: associated type bindings are not allowed here --> $DIR/issue-102335-ty.rs:2:17 | LL |     type A: S<C<i32 = u32> = ()>; |                 ^^^^^^^^^ associated type not allowed here error: aborting due to previous error For more information about this error, try `rustc --explain E0229`. </ins>

<ins> trait T { type A: S<C<(), i32 = ()> = ()>; //~^ ERROR associated type bindings are not allowed here } trait Q {} trait S { type C<T>: Q; } fn main() {} </ins>

<ins> error[E0229]: associated type bindings are not allowed here --> $DIR/issue-102335-gat.rs:2:21 | LL |     type A: S<C<(), i32 = ()> = ()>; |                     ^^^^^^^^ associated type not allowed here error: aborting due to previous error For more information about this error, try `rustc --explain E0229`. </ins>

trait Foo { type Bar<'a>: Deref<Target = <Self>::Bar<Target = Self>>; //~^ ERROR this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied <ins> //~| ERROR associated type bindings are not allowed here </ins> //~| HELP add missing }

LL |     type Bar<'a>: Deref<Target = <Self>::Bar<'a, Target = Self>>; |                                              +++ <del> error: aborting due to previous error </del> <ins> error[E0229]: associated type bindings are not allowed here --> $DIR/issue-85347.rs:3:46 | LL |     type Bar<'a>: Deref<Target = <Self>::Bar<Target = Self>>; |                                              ^^^^^^^^^^^^^ associated type not allowed here error: aborting due to 2 previous errors </ins> <del> For more information about this error, try `rustc --explain E0107`. </del> <ins> Some errors have detailed explanations: E0107, E0229. For more information about an error, try `rustc --explain E0107`. </ins>