1
Fork 0

Add ty helper function for mir constants

This is in preparation of the `literal` field becoming an enum that distinguishes between type level constants and runtime constants
This commit is contained in:
Oli Scherer 2021-03-08 14:14:11 +00:00
parent d5eec653c0
commit 914df2a493
5 changed files with 9 additions and 10 deletions

View file

@ -2421,6 +2421,9 @@ impl Constant<'tcx> {
_ => None,
}
}
pub fn ty(&self) -> Ty<'tcx> {
self.literal.ty
}
}
/// A collection of projections into user types.