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
Assigning priority as discussed in the of the Prioritization Working Group. label -I-prioritize +P-medium

Discussion:
} err } <del> ResolutionError::BindingShadowsSomethingUnacceptable(what_binding, name, binding) => { let res = binding.res(); let shadows_what = res.descr(); </del> <ins> ResolutionError::BindingShadowsSomethingUnacceptable { shadowing_binding_descr, name, participle, article, shadowed_binding_descr, shadowed_binding_span, } => { </ins> let mut err = struct_span_err!( self.session, span, E0530, "{}s cannot shadow {}s", <del> what_binding, shadows_what </del> <ins> shadowing_binding_descr, shadowed_binding_descr, </ins> ); err.span_label( span, <del> format!("cannot be named the same as {} {}", res.article(), shadows_what), </del> <ins> format!("cannot be named the same as {} {}", article, shadowed_binding_descr), </ins> ); <del> let participle = if binding.is_import() { "imported" } else { "defined" }; let msg = format!("the {} `{}` is {} here", shadows_what, name, participle); err.span_label(binding.span, msg); </del> <ins> let msg = format!("the {} `{}` is {} here", shadowed_binding_descr, name, participle); err.span_label(shadowed_binding_span, msg); </ins> err } ResolutionError::ForwardDeclaredTyParam => {

// to something unusable as a pattern (e.g., constructor function), // but we still conservatively report an error, see // issues/33118#issuecomment-233962221 for one reason why. <ins> let binding = binding.expect("no binding for a ctor or static"); </ins> self.report_error( ident.span, <del> ResolutionError::BindingShadowsSomethingUnacceptable( pat_src.descr(), ident.name, binding.expect("no binding for a ctor or static"), ), </del> <ins> ResolutionError::BindingShadowsSomethingUnacceptable { shadowing_binding_descr: pat_src.descr(), name: ident.name, participle: if binding.is_import() { "imported" } else { "defined" }, article: binding.res().article(), shadowed_binding_descr: binding.res().descr(), shadowed_binding_span: binding.span, }, ); None } Res::Def(DefKind::ConstParam, def_id) => { // Same as for DefKind::Const above, but here, `binding` is `None`, so we // have to construct the error differently self.report_error( ident.span, ResolutionError::BindingShadowsSomethingUnacceptable { shadowing_binding_descr: pat_src.descr(), name: ident.name, participle: "defined", article: res.article(), shadowed_binding_descr: res.descr(), shadowed_binding_span: self.r.opt_span(def_id).expect("const parameter defined outside of local crate"), } </ins> ); None }

/* current */ &'static str, ), /// Error E0530: `X` bindings cannot shadow `Y`s. <del> BindingShadowsSomethingUnacceptable(&'static str, Symbol, &'a NameBinding<'a>), </del> <ins> BindingShadowsSomethingUnacceptable { shadowing_binding_descr: &'static str, name: Symbol, participle: &'static str, article: &'static str, shadowed_binding_descr: &'static str, shadowed_binding_span: Span, }, </ins> /// Error E0128: generic parameters with a default cannot use forward-declared identifiers. ForwardDeclaredTyParam, // FIXME(const_generics_defaults) /// ERROR E0770: the type of const parameters must not depend on other generic parameters.

<ins> // Checks whether shadowing a const parameter leads to an ICE (#85348). impl<const N: usize> ArrayWindowsExample { //~^ ERROR: cannot find type `ArrayWindowsExample` in this scope [E0412] fn next() { let mut N; //~^ ERROR: let bindings cannot shadow const parameters [E0530] //~| ERROR: type annotations needed [E0282] } } fn main() {} </ins>

<ins> error[E0530]: let bindings cannot shadow const parameters --> $DIR/issue-85348.rs:6:17 | LL | impl<const N: usize> ArrayWindowsExample { |            - the const parameter `N` is defined here ... LL |         let mut N; |                 ^ cannot be named the same as a const parameter error[E0412]: cannot find type `ArrayWindowsExample` in this scope --> $DIR/issue-85348.rs:3:22 | LL | impl<const N: usize> ArrayWindowsExample { |                      ^^^^^^^^^^^^^^^^^^^ not found in this scope error[E0282]: type annotations needed --> $DIR/issue-85348.rs:6:13 | LL |         let mut N; |             ^^^^^ consider giving `N` a type error: aborting due to 3 previous errors Some errors have detailed explanations: E0282, E0412, E0530. For more information about an error, try `rustc --explain E0282`. </ins>

<ins> // Checks that const parameters cannot be shadowed with fresh bindings // even in syntactically unambiguous contexts. See // https://github.com/rust-lang/rust/issues/33118#issuecomment-233962221 fn foo<const N: i32>(i: i32) -> bool { match i { N @ _ => true, //~^ ERROR: match bindings cannot shadow const parameters [E0530] } } fn bar<const N: i32>(i: i32) -> bool { let N @ _ = 0; //~^ ERROR: let bindings cannot shadow const parameters [E0530] match i { N @ _ => true, } } fn main() {} </ins>

<ins> error[E0530]: match bindings cannot shadow const parameters --> $DIR/shadow-const-param.rs:7:9 | LL | fn foo<const N: i32>(i: i32) -> bool { |              - the const parameter `N` is defined here LL |     match i { LL |         N @ _ => true, |         ^ cannot be named the same as a const parameter error[E0530]: let bindings cannot shadow const parameters --> $DIR/shadow-const-param.rs:13:9 | LL | fn bar<const N: i32>(i: i32) -> bool { |              - the const parameter `N` is defined here LL |     let N @ _ = 0; |         ^ cannot be named the same as a const parameter error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0530`. </ins>