@@ -31,20 +31,19 @@ impl<'a, 'tcx> At<'a, 'tcx> {
31
31
/// normalized. If you don't care about regions, you should prefer
32
32
/// `normalize_erasing_regions`, which is more efficient.
33
33
///
34
- /// If the normalization succeeds and is unambiguous , returns back
35
- /// the normalized value along with various outlives relations (in
36
- /// the form of obligations that must be discharged).
34
+ /// If the normalization succeeds, returns back the normalized
35
+ /// value along with various outlives relations (in the form of
36
+ /// obligations that must be discharged).
37
37
///
38
- /// N.B., this will *eventually* be the main means of
39
- /// normalizing, but for now should be used only when we actually
40
- /// know that normalization will succeed, since error reporting
41
- /// and other details are still "under development".
42
- ///
43
- /// This normalization should *only* be used when the projection does not
44
- /// have possible ambiguity or may not be well-formed.
38
+ /// This normalization should *only* be used when the projection is well-formed and
39
+ /// does not have possible ambiguity (contains inference variables).
45
40
///
46
41
/// After codegen, when lifetimes do not matter, it is preferable to instead
47
42
/// use [`TyCtxt::normalize_erasing_regions`], which wraps this procedure.
43
+ ///
44
+ /// N.B. Once the new solver is stabilized this method of normalization will
45
+ /// likely be removed as trait solver operations are already cached by the query
46
+ /// system making this redundant.
48
47
fn query_normalize < T > ( self , value : T ) -> Result < Normalized < ' tcx , T > , NoSolution >
49
48
where
50
49
T : TypeFoldable < TyCtxt < ' tcx > > ,
@@ -210,8 +209,6 @@ impl<'a, 'tcx> FallibleTypeFolder<TyCtxt<'tcx>> for QueryNormalizer<'a, 'tcx> {
210
209
211
210
// See note in `rustc_trait_selection::traits::project` about why we
212
211
// wait to fold the args.
213
-
214
- // Wrap this in a closure so we don't accidentally return from the outer function
215
212
let res = match kind {
216
213
ty:: Opaque => {
217
214
// Only normalize `impl Trait` outside of type inference, usually in codegen.
0 commit comments