Skip to content

Commit c76dc95

Browse files
committed
Remove the delayed bug emission in try_from_lit
1 parent 91376f4 commit c76dc95

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

compiler/rustc_middle/src/ty/consts.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,7 @@ impl<'tcx> Const<'tcx> {
305305
// mir.
306306
match tcx.at(expr.span).lit_to_const(lit_input) {
307307
Ok(c) => return Some(c),
308-
Err(e) => {
309-
tcx.dcx().span_delayed_bug(
310-
expr.span,
311-
format!("Const::from_anon_const: couldn't lit_to_const {e:?}"),
312-
);
313-
}
308+
Err(_) => return None,
314309
}
315310
}
316311

tests/crashes/116308.rs renamed to tests/ui/const-generics/adt_const_params/116308.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
//@ known-bug: #116308
1+
//@ check-pass
22
#![feature(adt_const_params)]
33

4+
// Regression test for #116308
5+
46
pub trait Identity {
57
type Identity;
68
}

0 commit comments

Comments
 (0)