[][src]Struct c2rust_refactor::RefactorCtxt

pub struct RefactorCtxt<'a, 'tcx: 'a> { /* fields omitted */ }

Driver context. Contains all available analysis results as of the current compiler phase.

Accessor methods will panic if the requested results are not available.

Methods

impl<'a, 'tcx: 'a> RefactorCtxt<'a, 'tcx>[src]

pub fn new_phase_1(
    sess: &'a Session,
    cstore: &'a CStore
) -> RefactorCtxt<'a, 'tcx>
[src]

pub fn new_phase_2(
    sess: &'a Session,
    cstore: &'a CStore,
    map: &'a Map<'tcx>
) -> RefactorCtxt<'a, 'tcx>
[src]

pub fn new_phase_3(
    sess: &'a Session,
    cstore: &'a CStore,
    map: &'a Map<'tcx>,
    tcx: TyCtxt<'a, 'tcx, 'tcx>
) -> RefactorCtxt<'a, 'tcx>
[src]

impl<'a, 'tcx: 'a> RefactorCtxt<'a, 'tcx>[src]

pub fn new(
    sess: &'a Session,
    cstore: &'a CStore,
    map: Option<&'a Map<'tcx>>,
    tcx: Option<TyCtxt<'a, 'tcx, 'tcx>>
) -> Self
[src]

impl<'a, 'tcx: 'a> RefactorCtxt<'a, 'tcx>[src]

pub fn session(&self) -> &'a Session[src]

pub fn cstore(&self) -> &'a CStore[src]

pub fn hir_map(&self) -> &'a Map<'tcx>[src]

pub fn ty_ctxt(&self) -> TyCtxt<'a, 'tcx, 'tcx>[src]

pub fn has_ty_ctxt(&self) -> bool[src]

impl<'a, 'tcx: 'a> RefactorCtxt<'a, 'tcx>[src]

pub fn node_type(&self, id: NodeId) -> Ty<'tcx>[src]

Get the ty::Ty computed for a node.

pub fn opt_node_type(&self, id: NodeId) -> Option<Ty<'tcx>>[src]

pub fn adjusted_node_type(&self, id: NodeId) -> Ty<'tcx>[src]

Get the ty::Ty computed for a node, taking into account any adjustments that were applied.

pub fn opt_adjusted_node_type(&self, id: NodeId) -> Option<Ty<'tcx>>[src]

pub fn def_type(&self, id: DefId) -> Ty<'tcx>[src]

pub fn def_path(&self, id: DefId) -> Path[src]

Build a Path referring to a particular def. This method returns an absolute path when possible.

pub fn def_qpath(&self, id: DefId) -> (Option<QSelf>, Path)[src]

pub fn node_def_id(&self, id: NodeId) -> DefId[src]

Obtain the DefId of a definition node, such as a fn item.

pub fn def_to_hir_id(&self, def: &Def) -> Option<HirId>[src]

pub fn try_resolve_expr_to_hid(&self, e: &Expr) -> Option<HirId>[src]

pub fn try_resolve_expr(&self, e: &Expr) -> Option<DefId>[src]

pub fn resolve_expr(&self, e: &Expr) -> DefId[src]

Get the target DefId of a path expr.

pub fn try_resolve_ty(&self, t: &Ty) -> Option<DefId>[src]

pub fn resolve_ty(&self, t: &Ty) -> DefId[src]

Get the target DefId of a path ty.

pub fn opt_callee(&self, e: &Expr) -> Option<DefId>[src]

pub fn callee(&self, e: &Expr) -> DefId[src]

Get the DefId of the function or method being called by a Call or MethodCall expr.

pub fn opt_callee_info(&self, e: &Expr) -> Option<CalleeInfo<'tcx>>[src]

pub fn opt_callee_fn_sig(&self, e: &Expr) -> Option<FnSig<'tcx>>[src]

pub fn try_resolve_expr_hir(&self, e: &Expr) -> Option<Def>[src]

pub fn try_resolve_ty_hir(&self, t: &Ty) -> Option<Def>[src]

pub fn try_resolve_node_type_dep(&self, id: NodeId) -> Option<Def>[src]

Try to resolve a node as a reference to a type-dependent definition, like Vec::new (a.k.a. <Vec>::new) or <Vec as IntoIterator>::into_iter.

Note that this method doesn't look up the node itself, so it can return results even for non-path nodes (unlike try_resolve_expr/ty_hir).

pub fn resolve_use(&self, u: &Item) -> P<Path>[src]

Attempt to resolve a Use item to the hir::Path of the imported item. The given item must be a Use.

pub fn structural_eq(&self, item1: &Item, item2: &Item) -> bool[src]

Compare two items for internal structural equivalence, ignoring field names.

pub fn compatible_fn_prototypes(&self, decl1: &FnDecl, decl2: &FnDecl) -> bool[src]

Compare two function declarations for equivalent argument and return types, ignoring argument names.

Trait Implementations

impl<'a, 'tcx: 'a> Clone for RefactorCtxt<'a, 'tcx>[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<'a, 'tcx> !Send for RefactorCtxt<'a, 'tcx>

impl<'a, 'tcx> !Sync for RefactorCtxt<'a, 'tcx>

Blanket Implementations

impl<T> Lone for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<E> SpecializationError for E[src]

impl<T> Erased for T[src]

impl<T> Send for T where
    T: ?Sized
[src]

impl<T> Sync for T where
    T: ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self

impl<T> MaybeResult for T[src]

impl<'a, T> Captures for T where
    T: ?Sized
[src]

impl<T> Erased for T

impl<T> Make for T[src]

impl<T> Slottable for T[src]