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. --<!-- 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
Regression in nightly-2021-09-01 found 9 bors merge commits in the specified range commit[0] 2021-08-30: Auto merge of - sexxi-goose:issue-, r=nikomatsakis commit[1] 2021-08-30: Auto merge of - lcnr:cec-rename, r=oli-obk commit[2] 2021-08-31: Auto merge of - HTG-YT:edition2021-compopt-stabilization, r=m-ou-se commit[3] 2021-08-31: Auto merge of - Aaron1011:guess-foreign-head-span, r=estebank commit[4] 2021-08-31: Auto merge of - sexxi-goose:issue-, r=nikomatsakis commit[5] 2021-08-31: Auto merge of - RalfJung:miri, r=RalfJung commit[6] 2021-08-31: Auto merge of - m-ou-se:rollup-az6xtc5, r=m-ou-se commit[7] 2021-08-31: Auto merge of - m-ou-se:rollup-jeusxbo, r=m-ou-se commit[8] 2021-08-31: Auto merge of - Mark-Simulacrum:fix-rlibs, r=ehuss

Discussion:
use rustc_hir::{HirId, Pat, PatKind}; use rustc_infer::infer; use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind}; <ins> use rustc_middle::mir::interpret::ErrorHandled; </ins> use rustc_middle::ty::{self, Adt, BindingMode, Ty, TypeVisitableExt}; use rustc_session::lint::builtin::NON_EXHAUSTIVE_OMITTED_PATTERNS; use rustc_span::edit_distance::find_best_match_for_name;

len: ty::Const<'tcx>, min_len: u64, ) -> (Option<Ty<'tcx>>, Ty<'tcx>) { <del> let guar = if let Some(len) = len.try_eval_target_usize(self.tcx, self.param_env) { </del> <ins> let len = match len.eval(self.tcx, self.param_env, None) { Ok(val) => val .try_to_scalar() .and_then(|scalar| scalar.try_to_int().ok()) .and_then(|int| int.try_to_target_usize(self.tcx).ok()), Err(ErrorHandled::Reported(..)) => { let guar = self.error_scrutinee_unfixed_length(span); return (Some(Ty::new_error(self.tcx, guar)), arr_ty); } Err(ErrorHandled::TooGeneric(..)) => None, }; let guar = if let Some(len) = len { </ins> // Now we know the length... if slice.is_none() { // ...and since there is no variable-length pattern,

<ins> #![allow(incomplete_features)] #![feature(generic_const_exprs)] fn something(path: [usize; N]) -> impl Clone { //~^ ERROR cannot find value `N` in this scope match path { [] => 0, //~ ERROR cannot pattern-match on an array without a fixed length _ => 1, }; } fn main() {} </ins>

<ins> error[E0425]: cannot find value `N` in this scope --> $DIR/issue-116186.rs:4:28 | LL | fn something(path: [usize; N]) -> impl Clone { |                            ^ not found in this scope | help: you might be missing a const parameter | LL | fn something<const N: /* Type */>(path: [usize; N]) -> impl Clone { |             +++++++++++++++++++++ error[E0730]: cannot pattern-match on an array without a fixed length --> $DIR/issue-116186.rs:7:9 | LL |         [] => 0, |         ^^ error: aborting due to 2 previous errors Some errors have detailed explanations: E0425, E0730. For more information about an error, try `rustc --explain E0425`. </ins>