Change:
<!-- Thank you for filing a regression report! A regression is something that changed between versions of Rust but was not supposed to. Please provide a short summary of the regression, along with any information you feel is relevant to replicate it. --I made a blank cargo project (ran in an empty directory), and dependencies to my like so: Originally when I went to run , I was in nightly, and got a compile error (full error below). Then, when i switched to stable, there was no error and everything built fine! <!-- Provide the most recent version this worked on, for example: It most recently worked on: Rust 1.47 --It most recently worked on: Rust 1.69 <!-- Provide the version you are using that has the regression. --: <!-- Did the compiler crash? If so, please provide a backtrace. --<!-- If you know when this regression occurred, please add a line like below, replacing with one of stable, beta, or nightly. modify labels: +regression-from-stable-to-{channel} -regression-untriaged -- modify labels: +regression-from-stable-to-nightly -regression-untriaged
searched nightlies: from nightly-2023-02-15 to nightly-2023-05-13 regressed nightly: nightly-2023-05-05 searched commit range: regressed commit: <details<summarybisected with <a href=''cargo-bisect-rustc</av0.6.6</summaryHost triple: x86_64-unknown-linux-gnu Reproduce with: </detailsrollup it didn't want to bisect the perf builds for some reason but i guess or could be at fault? haven't looked into the actual issue in detail, since it's behind a macro you probably know something about this anyways even if it may not be your fault
its not that is genericconstexprs only code
WG-prioritization assigning priority (). label -I-prioritize +P-high +T-compiler

Discussion:
let sm = self.tcx.sess.source_map(); let def_id = match outer_res { <del> Res::SelfTyParam { .. } | Res::SelfCtor(_) => { </del> <ins> Res::SelfTyParam { .. } => { </ins> err.span_label(span, "can't use `Self` here"); return err; }

return Res::Err; } } <del> Res::Def(DefKind::TyParam, _) | Res::SelfTyParam { .. } | Res::SelfTyAlias { .. } | Res::SelfCtor(_) => { </del> <ins> Res::Def(DefKind::TyParam, _) | Res::SelfTyParam { .. } | Res::SelfTyAlias { .. } => { </ins> for rib in ribs { let has_generic_params: HasGenericParams = match rib.kind { RibKind::Normal

<del> // Verify that we ban usage of `Self` as constructor from inner items. struct S0<T>(T); impl<T> S0<T> { fn foo() { const C: S0<u8> = Self(0); //~^ ERROR can't use generic parameters from outer function fn bar() -> Self { //~^ ERROR can't use generic parameters from outer function Self(0) //~^ ERROR can't use generic parameters from outer function } } } fn main() {} </del>

<del> error[E0401]: can't use generic parameters from outer function --> $DIR/self-ctor-inner-const.rs:7:27 | LL |         const C: S0<u8> = Self(0); |                           ^^^^ |                           | |                           use of generic parameter from outer function |                           can't use `Self` here error[E0401]: can't use generic parameters from outer function --> $DIR/self-ctor-inner-const.rs:9:21 | LL | impl<T> S0<T> { | ---- `Self` type implicitly declared here, by this `impl` ... LL |         fn bar() -> Self { |                     ^^^^ |                     | |                     use of generic parameter from outer function |                     use a type here instead error[E0401]: can't use generic parameters from outer function --> $DIR/self-ctor-inner-const.rs:11:13 | LL |             Self(0) |             ^^^^ |             | |             use of generic parameter from outer function |             can't use `Self` here error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0401`. </del>

<ins> // `Self` as a constructor is currently allowed when the outer item is not generic. // check-pass struct S0(usize); impl S0 { fn foo() { const C: S0 = Self(0); fn bar() -> S0 { Self(0) } } } fn main() {} </ins>