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:
parent
d5eec653c0
commit
914df2a493
5 changed files with 9 additions and 10 deletions
|
@ -2421,6 +2421,9 @@ impl Constant<'tcx> {
|
|||
_ => None,
|
||||
}
|
||||
}
|
||||
pub fn ty(&self) -> Ty<'tcx> {
|
||||
self.literal.ty
|
||||
}
|
||||
}
|
||||
|
||||
/// A collection of projections into user types.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue