Skip to content

Commit

Permalink
Special-case alias ty in try_from_lit
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaic1 committed Aug 16, 2024
1 parent 2c93fab commit cd2b030
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions compiler/rustc_middle/src/ty/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,10 @@ impl<'tcx> Const<'tcx> {
// mir.
match tcx.at(expr.span).lit_to_const(lit_input) {
Ok(c) => return Some(c),
Err(_) if lit_input.ty.has_aliases() => {
// allow the `ty` to be an alias type, though we cannot handle it here
return None;
}
Err(e) => {
tcx.dcx().span_delayed_bug(
expr.span,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//@ known-bug: #116308
//@ check-pass
#![feature(adt_const_params)]

// Regression test for #116308

pub trait Identity {
type Identity;
}
Expand Down

0 comments on commit cd2b030

Please sign in to comment.