1
Fork 0

Improve terminology around "after typeck"

This commit is contained in:
pierwill 2021-10-25 15:43:07 -05:00
parent 089a016919
commit 521b1ee974
13 changed files with 20 additions and 18 deletions

View file

@ -18,7 +18,6 @@ use rustc_middle::ty::{self, TyCtxt};
/// that type check should guarantee to us that all nested
/// obligations *could be* resolved if we wanted to.
///
/// Assumes that this is run after the entire crate has been successfully type-checked.
/// This also expects that `trait_ref` is fully normalized.
pub fn codegen_fulfill_obligation<'tcx>(
tcx: TyCtxt<'tcx>,
@ -101,7 +100,7 @@ pub fn codegen_fulfill_obligation<'tcx>(
/// Finishes processes any obligations that remain in the
/// fulfillment context, and then returns the result with all type
/// variables removed and regions erased. Because this is intended
/// for use after type-check has completed, if any errors occur,
/// for use outside of type inference, if any errors occur,
/// it will panic. It is used during normalization and other cases
/// where processing the obligations in `fulfill_cx` may cause
/// type inference variables that appear in `result` to be
@ -123,7 +122,10 @@ where
if let Err(errors) = fulfill_cx.select_all_or_error(infcx) {
infcx.tcx.sess.delay_span_bug(
rustc_span::DUMMY_SP,
&format!("Encountered errors `{:?}` resolving bounds after type-checking", errors),
&format!(
"Encountered errors `{:?}` resolving bounds outside of type inference",
errors
),
);
}

View file

@ -295,7 +295,7 @@ pub fn normalize_param_env_or_error<'tcx>(
//
// In any case, in practice, typeck constructs all the
// parameter environments once for every fn as it goes,
// and errors will get reported then; so after typeck we
// and errors will get reported then; so outside of type inference we
// can be sure that no errors should occur.
debug!(

View file

@ -392,7 +392,7 @@ impl<'a, 'b, 'tcx> TypeFolder<'tcx> for AssocTypeNormalizer<'a, 'b, 'tcx> {
// severe performance implications for large opaque types with
// late-bound regions. See `issue-88862` benchmark.
ty::Opaque(def_id, substs) if !substs.has_escaping_bound_vars() => {
// Only normalize `impl Trait` after type-checking, usually in codegen.
// Only normalize `impl Trait` outside of type inference, usually in codegen.
match self.param_env.reveal() {
Reveal::UserFacing => ty.super_fold_with(self),

View file

@ -210,7 +210,7 @@ impl<'cx, 'tcx> TypeFolder<'tcx> for QueryNormalizer<'cx, 'tcx> {
// severe performance implications for large opaque types with
// late-bound regions. See `issue-88862` benchmark.
ty::Opaque(def_id, substs) if !substs.has_escaping_bound_vars() => {
// Only normalize `impl Trait` after type-checking, usually in codegen.
// Only normalize `impl Trait` outside of type inference, usually in codegen.
match self.param_env.reveal() {
Reveal::UserFacing => ty.super_fold_with(self),