We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
try_from_lit
1 parent 2c93fab commit cd2b030Copy full SHA for cd2b030
compiler/rustc_middle/src/ty/consts.rs
@@ -305,6 +305,10 @@ impl<'tcx> Const<'tcx> {
305
// mir.
306
match tcx.at(expr.span).lit_to_const(lit_input) {
307
Ok(c) => return Some(c),
308
+ Err(_) if lit_input.ty.has_aliases() => {
309
+ // allow the `ty` to be an alias type, though we cannot handle it here
310
+ return None;
311
+ }
312
Err(e) => {
313
tcx.dcx().span_delayed_bug(
314
expr.span,
tests/crashes/116308.rs renamed to tests/ui/const-generics/adt_const_params/116308.rs
@@ -1,6 +1,8 @@
1
-//@ known-bug: #116308
+//@ check-pass
2
#![feature(adt_const_params)]
3
4
+// Regression test for #116308
5
+
6
pub trait Identity {
7
type Identity;
8
}
0 commit comments