Replace absolute paths with relative ones

Modern compilers allow reaching external crates
like std or core via relative paths in modules
outside of lib.rs and main.rs.
This commit is contained in:
est31 2020-10-13 10:17:05 +02:00
parent f54072bb81
commit a0fc455d30
32 changed files with 73 additions and 76 deletions

View file

@ -341,7 +341,7 @@ where
// been fully instantiated and hence the set of scopes we have
// doesn't matter -- just to be sure, put an empty vector
// in there.
let old_a_scopes = ::std::mem::take(pair.vid_scopes(self));
let old_a_scopes = std::mem::take(pair.vid_scopes(self));
// Relate the generalized kind to the original one.
let result = pair.relate_generalized_ty(self, generalized_ty);
@ -680,7 +680,7 @@ where
// itself occurs. Note that `'b` and `'c` must both
// include P. At the point, the call works because of
// subtyping (i.e., `&'b u32 <: &{P} u32`).
let variance = ::std::mem::replace(&mut self.ambient_variance, ty::Variance::Covariant);
let variance = std::mem::replace(&mut self.ambient_variance, ty::Variance::Covariant);
self.relate(a.skip_binder(), b.skip_binder())?;
@ -709,7 +709,7 @@ where
// Reset ambient variance to contravariance. See the
// covariant case above for an explanation.
let variance =
::std::mem::replace(&mut self.ambient_variance, ty::Variance::Contravariant);
std::mem::replace(&mut self.ambient_variance, ty::Variance::Contravariant);
self.relate(a.skip_binder(), b.skip_binder())?;

View file

@ -110,7 +110,7 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
/// Trait queries just want to pass back type obligations "as is"
pub fn take_registered_region_obligations(&self) -> Vec<(hir::HirId, RegionObligation<'tcx>)> {
::std::mem::take(&mut self.inner.borrow_mut().region_obligations)
std::mem::take(&mut self.inner.borrow_mut().region_obligations)
}
/// Process the region obligations that must be proven (during