FnCtxt normalization stuff
This commit is contained in:
parent
fc710832ea
commit
52cd342696
15 changed files with 41 additions and 67 deletions
|
@ -109,6 +109,9 @@ pub trait AstConv<'tcx> {
|
|||
) -> Ty<'tcx>;
|
||||
|
||||
/// Normalize an associated type coming from the user.
|
||||
///
|
||||
/// This should only be used by astconv. Use `FnCtxt::normalize`
|
||||
/// or `ObligationCtxt::normalize` in downstream crates.
|
||||
fn normalize_ty(&self, span: Span, ty: Ty<'tcx>) -> Ty<'tcx>;
|
||||
|
||||
/// Invoked when we encounter an error from some prior pass
|
||||
|
|
|
@ -53,6 +53,8 @@ impl<'tcx> WfCheckingCtxt<'_, 'tcx> {
|
|||
self.ocx.infcx.tcx
|
||||
}
|
||||
|
||||
// Convenience function to normalize during wfcheck. This performs
|
||||
// `ObligationCtxt::normalize`, but provides a nice `ObligationCauseCode`.
|
||||
fn normalize<T>(&self, span: Span, loc: Option<WellFormedLoc>, value: T) -> T
|
||||
where
|
||||
T: TypeFoldable<'tcx>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue