@@ -18,7 +18,6 @@ use rustc_middle::ty::{self, TyCtxt};
1818/// that type check should guarantee to us that all nested
1919/// obligations *could be* resolved if we wanted to.
2020///
21- /// Assumes that this is run after the entire crate has been successfully type-checked.
2221/// This also expects that `trait_ref` is fully normalized.
2322pub fn codegen_fulfill_obligation < ' tcx > (
2423 tcx : TyCtxt < ' tcx > ,
@@ -101,7 +100,7 @@ pub fn codegen_fulfill_obligation<'tcx>(
101100/// Finishes processes any obligations that remain in the
102101/// fulfillment context, and then returns the result with all type
103102/// variables removed and regions erased. Because this is intended
104- /// for use after type-check has completed , if any errors occur,
103+ /// for use outside of type inference , if any errors occur,
105104/// it will panic. It is used during normalization and other cases
106105/// where processing the obligations in `fulfill_cx` may cause
107106/// type inference variables that appear in `result` to be
@@ -124,7 +123,10 @@ where
124123 if !errors. is_empty ( ) {
125124 infcx. tcx . sess . delay_span_bug (
126125 rustc_span:: DUMMY_SP ,
127- & format ! ( "Encountered errors `{:?}` resolving bounds after type-checking" , errors) ,
126+ & format ! (
127+ "Encountered errors `{:?}` resolving bounds outside of type inference" ,
128+ errors
129+ ) ,
128130 ) ;
129131 }
130132
0 commit comments