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<strongSample Backtrace</strong</summary<p</p</detailsThe original code () is already fixed by , however some other mutations of the original code still ICEs with the same backtrace and error. Thanks. <brCC <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
If the parsing error is not needed to manifest the issue, can that be fixed () in the MCVE you provided? since more error messages just obscures the underlying ICE that needs to be fixed here.
(also this could probably use a more descriptive title that reflects the ICE, and doesn't just point to another issue, but that's just my opinion)
Is that better?
claim

Discussion:
// FIXME(valtrees): check whether const qualifs should behave the same // way for type and mir constants. let uneval = match constant.literal { <del> ConstantKind::Ty(ct) if matches!(ct.kind(), ty::ConstKind::Param(_)) => None, </del> <ins> ConstantKind::Ty(ct) if matches!(ct.kind(), ty::ConstKind::Param(_) | ty::ConstKind::Error(_)) => { None } </ins> ConstantKind::Ty(c) => bug!("expected ConstKind::Param here, found {:?}", c), ConstantKind::Unevaluated(uv, _) => Some(uv), ConstantKind::Val(..) => None,

<ins> fn f1() -> impl Sized { & 2E } //~ ERROR expected at least one digit in exponent fn f2() -> impl Sized { && 2E } //~ ERROR expected at least one digit in exponent fn f3() -> impl Sized { &'a 2E } //~ ERROR expected at least one digit in exponent //~^ ERROR borrow expressions cannot be annotated with lifetimes fn f4() -> impl Sized { &'static 2E } //~ ERROR expected at least one digit in exponent //~^ ERROR borrow expressions cannot be annotated with lifetimes fn f5() -> impl Sized { *& 2E } //~ ERROR expected at least one digit in exponent fn f6() -> impl Sized { &'_ 2E } //~ ERROR expected at least one digit in exponent //~^ ERROR borrow expressions cannot be annotated with lifetimes fn main() {} </ins>

<ins> error: expected at least one digit in exponent --> $DIR/issue-104390.rs:1:27 | LL | fn f1() -> impl Sized { & 2E } |                           ^^ error: expected at least one digit in exponent --> $DIR/issue-104390.rs:2:28 | LL | fn f2() -> impl Sized { && 2E } |                            ^^ error: expected at least one digit in exponent --> $DIR/issue-104390.rs:3:29 | LL | fn f3() -> impl Sized { &'a 2E } |                             ^^ error: expected at least one digit in exponent --> $DIR/issue-104390.rs:5:34 | LL | fn f4() -> impl Sized { &'static 2E } |                                  ^^ error: expected at least one digit in exponent --> $DIR/issue-104390.rs:7:28 | LL | fn f5() -> impl Sized { *& 2E } |                            ^^ error: expected at least one digit in exponent --> $DIR/issue-104390.rs:8:29 | LL | fn f6() -> impl Sized { &'_ 2E } |                             ^^ error: borrow expressions cannot be annotated with lifetimes --> $DIR/issue-104390.rs:3:25 | LL | fn f3() -> impl Sized { &'a 2E } |                         ^--^^^ |                          | |                          annotated with lifetime here |                          help: remove the lifetime annotation error: borrow expressions cannot be annotated with lifetimes --> $DIR/issue-104390.rs:5:25 | LL | fn f4() -> impl Sized { &'static 2E } |                         ^-------^^^ |                          | |                          annotated with lifetime here |                          help: remove the lifetime annotation error: borrow expressions cannot be annotated with lifetimes --> $DIR/issue-104390.rs:8:25 | LL | fn f6() -> impl Sized { &'_ 2E } |                         ^--^^^ |                          | |                          annotated with lifetime here |                          help: remove the lifetime annotation error: aborting due to 9 previous errors </ins>