mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-29 20:20:59 +03:00
Rollup merge of #104233 - compiler-errors:issue-104209, r=lcnr
Don't ICE when encountering `ConstKind::Error` in `RequiredConstsVisitor` Fixes #104209
This commit is contained in:
@@ -17,7 +17,7 @@ fn visit_constant(&mut self, constant: &Constant<'tcx>, _: Location) {
|
||||
let literal = constant.literal;
|
||||
match literal {
|
||||
ConstantKind::Ty(c) => match c.kind() {
|
||||
ConstKind::Param(_) => {}
|
||||
ConstKind::Param(_) | ConstKind::Error(_) => {}
|
||||
_ => bug!("only ConstKind::Param should be encountered here, got {:#?}", c),
|
||||
},
|
||||
ConstantKind::Unevaluated(..) => self.required_consts.push(*constant),
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
fn f() -> impl Sized {
|
||||
2.0E
|
||||
//~^ ERROR expected at least one digit in exponent
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,8 @@
|
||||
error: expected at least one digit in exponent
|
||||
--> $DIR/invalid-const-in-body.rs:2:5
|
||||
|
|
||||
LL | 2.0E
|
||||
| ^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
Reference in New Issue
Block a user