-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)]
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.