mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-18 18:04:13 +00:00
Special-case alias ty in try_from_lit
This commit is contained in:
parent
2c93fabd98
commit
cd2b0309cc
@ -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,
|
||||
|
@ -1,6 +1,8 @@
|
||||
//@ known-bug: #116308
|
||||
//@ check-pass
|
||||
#![feature(adt_const_params)]
|
||||
|
||||
// Regression test for #116308
|
||||
|
||||
pub trait Identity {
|
||||
type Identity;
|
||||
}
|
Loading…
Reference in New Issue
Block a user