Change:
<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --I don't have a reasonable sized reproducer yet. <!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: Regression occurred ~between ..~ in () <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
Updated the issue description with a complete backtrace that has full line info (435 frames deep!)
Update: I bisected this to () cc
it looks like this match needs to be updated somehow: Does this bug report contain enough information to understand the problem, or do you need an MCVE?
Could you reproduce but debug print the the scrutinee in the arm?
I'm surprised since we should return before calling for all other types. It must be one of the variants. That means we're using the of the associated const definition instead of the declaration. Maybe a defaulted associated const? I dunno.
Indeed, here's the source for the item being checked (specifically, ):
Ah okay. We should already be encoding the s for associated type defaults. If so, just adding an would resolve the issue. I think I can synthesize a test case from here though, so don't worry about reducing further. Thanks for the help!
No problem! Since I'd kicked this off already, here's the debug print:

Discussion:
match self.kind(id) { EntryKind::Const(qualif, _) | EntryKind::AssocConst( <del> AssocContainer::ImplDefault | AssocContainer::ImplFinal, </del> <ins> AssocContainer::ImplDefault | AssocContainer::ImplFinal | AssocContainer::TraitWithDefault, </ins> qualif, _, ) => qualif, <del> _ => bug!(), </del> <ins> _ => bug!("mir_const_qualif: unexpected kind"), </ins> } }

pub const NONE: Option<CustomEq> = None; pub const SOME: Option<CustomEq> = Some(CustomEq); <ins> pub trait AssocConst { const NONE: Option<CustomEq> = None; const SOME: Option<CustomEq> = Some(CustomEq); } </ins>

extern crate consts; <ins> struct Defaulted; impl consts::AssocConst for Defaulted {} </ins> fn main() { <ins> let _ = Defaulted; </ins> match None { consts::SOME => panic!(), //~^ must be annotated with `#[derive(PartialEq, Eq)]`

_ => {} } <ins> match None { <Defaulted as consts::AssocConst>::SOME  => panic!(), //~^ must be annotated with `#[derive(PartialEq, Eq)]` //~| must be annotated with `#[derive(PartialEq, Eq)]` _ => {} } </ins> }

error: to use a constant of type `consts::CustomEq` in a pattern, `consts::CustomEq` must be annotated with `#[derive(PartialEq, Eq)]` <del> --> $DIR/cross-crate-fail.rs:9:9 </del> <ins> --> $DIR/cross-crate-fail.rs:13:9 </ins> | LL |         consts::SOME => panic!(), |         ^^^^^^^^^^^^ error: to use a constant of type `consts::CustomEq` in a pattern, `consts::CustomEq` must be annotated with `#[derive(PartialEq, Eq)]` <del> --> $DIR/cross-crate-fail.rs:9:9 </del> <ins> --> $DIR/cross-crate-fail.rs:21:9 | LL |         <Defaulted as consts::AssocConst>::SOME  => panic!(), |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: to use a constant of type `consts::CustomEq` in a pattern, `consts::CustomEq` must be annotated with `#[derive(PartialEq, Eq)]` --> $DIR/cross-crate-fail.rs:13:9 </ins> | LL |         consts::SOME => panic!(), |         ^^^^^^^^^^^^ <del> error: aborting due to 2 previous errors </del> <ins> error: to use a constant of type `consts::CustomEq` in a pattern, `consts::CustomEq` must be annotated with `#[derive(PartialEq, Eq)]` --> $DIR/cross-crate-fail.rs:21:9 | LL |         <Defaulted as consts::AssocConst>::SOME  => panic!(), |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 4 previous errors </ins>

extern crate consts; use consts::CustomEq; <ins> struct Defaulted; impl consts::AssocConst for Defaulted {} </ins> fn main() { <ins> let _ = Defaulted; </ins> match Some(CustomEq) { consts::NONE => panic!(), _ => {} } <ins> match Some(CustomEq) { <Defaulted as consts::AssocConst>::NONE  => panic!(), _ => {} } </ins> }