]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/ty/adjustment.rs
update async-await send/sync test
[rust.git] / src / librustc / ty / adjustment.rs
index e1b63a6d9e703434c3a664831da4d5ea7b3f974b..db034d1618cea6cb35659e1792760e3418c47e5a 100644 (file)
@@ -1,7 +1,7 @@
-use crate::hir;
-use crate::hir::def_id::DefId;
 use crate::ty::subst::SubstsRef;
 use crate::ty::{self, Ty, TyCtxt};
+use rustc_hir as hir;
+use rustc_hir::def_id::DefId;
 use rustc_macros::HashStable;
 
 #[derive(Clone, Copy, Debug, PartialEq, Eq, RustcEncodable, RustcDecodable, HashStable)]
@@ -81,6 +81,15 @@ pub struct Adjustment<'tcx> {
     pub target: Ty<'tcx>,
 }
 
+impl Adjustment<'tcx> {
+    pub fn is_region_borrow(&self) -> bool {
+        match self.kind {
+            Adjust::Borrow(AutoBorrow::Ref(..)) => true,
+            _ => false,
+        }
+    }
+}
+
 #[derive(Clone, Debug, RustcEncodable, RustcDecodable, HashStable, TypeFoldable)]
 pub enum Adjust<'tcx> {
     /// Go from ! to any type.