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. --cc still crashes after <!-- 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. --: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details<!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
Sigh, yeah, this is just the same bug but for lifetime params. I'll fix it, shouldn't be too hard. claim
Hey, , thanks for getting this fixed! Unfortunately, I seem to be running into the same issue (or a very similar one) using the latest nightly, and I've not been able to create a standalone reproducer: <details<summaryBacktrace</summary<p</p</detailsSorry if this is the wrong place to be reporting this ICE, but I wasn't sure whether to file a new issue or maybe get one of the resolved issues re-opened. Thank you!

Discussion:
| DefKind::AssocTy | DefKind::TyParam | DefKind::ConstParam <ins> | DefKind::LifetimeParam </ins> | DefKind::Fn | DefKind::Const | DefKind::Static(_)

| DefKind::Impl { .. } | DefKind::Closure | DefKind::Generator => true, <del> DefKind::ForeignMod | DefKind::ImplTraitPlaceholder | DefKind::LifetimeParam | DefKind::GlobalAsm => false, </del> <ins> DefKind::ForeignMod | DefKind::ImplTraitPlaceholder | DefKind::GlobalAsm => false, </ins> } }

<del> pub fn test<const N: usize, T>() {} </del>

<del> // aux-build: foreign-generic-mismatch-with-const-arg.rs extern crate foreign_generic_mismatch_with_const_arg; fn main() { foreign_generic_mismatch_with_const_arg::test::<1>(); //~^ ERROR function takes 2 generic arguments but 1 generic argument was supplied } </del>

<del> error[E0107]: function takes 2 generic arguments but 1 generic argument was supplied --> $DIR/foreign-generic-mismatch-with-const-arg.rs:6:46 | LL |     foreign_generic_mismatch_with_const_arg::test::<1>(); |                                              ^^^^   - supplied 1 generic argument |                                              | |                                              expected 2 generic arguments | note: function defined here, with 2 generic parameters: `N`, `T` --> $DIR/auxiliary/foreign-generic-mismatch-with-const-arg.rs:1:8 | LL | pub fn test<const N: usize, T>() {} |        ^^^^ --------------  - help: add missing generic argument | LL |     foreign_generic_mismatch_with_const_arg::test::<1, T>(); |                                                      +++ error: aborting due to previous error For more information about this error, try `rustc --explain E0107`. </del>

<ins> pub fn const_arg<const N: usize, T>() {} pub fn lt_arg<'a: 'a>() {} </ins>

<ins> // aux-build: foreign-generic-mismatch.rs extern crate foreign_generic_mismatch; fn main() { foreign_generic_mismatch::const_arg::<()>(); //~^ ERROR function takes 2 generic arguments but 1 generic argument was supplied foreign_generic_mismatch::lt_arg::<'static, 'static>(); //~^ ERROR function takes 1 lifetime argument but 2 lifetime arguments were supplied } </ins>

<ins> error[E0107]: function takes 2 generic arguments but 1 generic argument was supplied --> $DIR/foreign-generic-mismatch.rs:6:31 | LL |     foreign_generic_mismatch::const_arg::<()>(); |                               ^^^^^^^^^   -- supplied 1 generic argument |                               | |                               expected 2 generic arguments | note: function defined here, with 2 generic parameters: `N`, `T` --> $DIR/auxiliary/foreign-generic-mismatch.rs:1:8 | LL | pub fn const_arg<const N: usize, T>() {} |        ^^^^^^^^^ --------------  - help: add missing generic argument | LL |     foreign_generic_mismatch::const_arg::<(), T>(); |                                             +++ error[E0107]: function takes 1 lifetime argument but 2 lifetime arguments were supplied --> $DIR/foreign-generic-mismatch.rs:8:31 | LL |     foreign_generic_mismatch::lt_arg::<'static, 'static>(); |                               ^^^^^^            ------- help: remove this lifetime argument |                               | |                               expected 1 lifetime argument | note: function defined here, with 1 lifetime parameter: `'a` --> $DIR/auxiliary/foreign-generic-mismatch.rs:3:8 | LL | pub fn lt_arg<'a: 'a>() {} |        ^^^^^^ -- error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0107`. </ins>