]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_traits/normalize_erasing_regions.rs
Add test for issue-69092
[rust.git] / src / librustc_traits / normalize_erasing_regions.rs
index d138ce753b07e4be6eb18047e728050834faf07f..4e5f20d80b0d8d0ec445212aaca7d31ba6a4c04e 100644 (file)
@@ -1,14 +1,12 @@
-use rustc::traits::{Normalized, ObligationCause};
 use rustc::traits::query::NoSolution;
 use rustc::ty::query::Providers;
 use rustc::ty::{self, ParamEnvAnd, Ty, TyCtxt};
+use rustc_infer::infer::TyCtxtInferExt;
+use rustc_infer::traits::{Normalized, ObligationCause};
 use std::sync::atomic::Ordering;
 
 crate fn provide(p: &mut Providers<'_>) {
-    *p = Providers {
-        normalize_ty_after_erasing_regions,
-        ..*p
-    };
+    *p = Providers { normalize_ty_after_erasing_regions, ..*p };
 }
 
 fn normalize_ty_after_erasing_regions<'tcx>(
@@ -22,17 +20,12 @@ fn normalize_ty_after_erasing_regions<'tcx>(
     tcx.infer_ctxt().enter(|infcx| {
         let cause = ObligationCause::dummy();
         match infcx.at(&cause, param_env).normalize(&value) {
-            Ok(Normalized {
-                value: normalized_value,
-                obligations: normalized_obligations,
-            }) => {
+            Ok(Normalized { value: normalized_value, obligations: normalized_obligations }) => {
                 // We don't care about the `obligations`; they are
                 // always only region relations, and we are about to
                 // erase those anyway:
                 debug_assert_eq!(
-                    normalized_obligations
-                        .iter()
-                        .find(|p| not_outlives_predicate(&p.predicate)),
+                    normalized_obligations.iter().find(|p| not_outlives_predicate(&p.predicate)),
                     None,
                 );