[−][src]Struct c2rust_refactor::analysis::labeled_ty::LabeledTyCtxt
Context for constructing LabeledTy
s.
Methods
impl<'lty, 'tcx: 'lty, L: Clone> LabeledTyCtxt<'lty, L>
[src]
pub fn new(arena: &'lty SyncDroplessArena) -> LabeledTyCtxt<'lty, L>
[src]
Build a new LabeledTyCtxt
. The arena
must be the same one used by the TyCtxt
that
built the underlying Ty
s to be labeled.
pub fn mk_slice(
&self,
ltys: &[LabeledTy<'lty, 'tcx, L>]
) -> &'lty [LabeledTy<'lty, 'tcx, L>]
[src]
&self,
ltys: &[LabeledTy<'lty, 'tcx, L>]
) -> &'lty [LabeledTy<'lty, 'tcx, L>]
Manually construct a slice in the context's arena.
pub fn mk(
&self,
ty: Ty<'tcx>,
args: &'lty [LabeledTy<'lty, 'tcx, L>],
label: L
) -> LabeledTy<'lty, 'tcx, L>
[src]
&self,
ty: Ty<'tcx>,
args: &'lty [LabeledTy<'lty, 'tcx, L>],
label: L
) -> LabeledTy<'lty, 'tcx, L>
Manually construct a labeled type. Note that this does not do any checks on args
! The
caller is responsible for making sure the number of arguments matches ty.sty
.
pub fn label<F: FnMut(Ty<'tcx>) -> L>(
&self,
ty: Ty<'tcx>,
f: &mut F
) -> LabeledTy<'lty, 'tcx, L>
[src]
&self,
ty: Ty<'tcx>,
f: &mut F
) -> LabeledTy<'lty, 'tcx, L>
Label a Ty
using a callback. The callback runs at every type constructor to produce a
label for that node in the tree.
pub fn label_slice<F>(
&self,
tys: &[Ty<'tcx>],
f: &mut F
) -> &'lty [LabeledTy<'lty, 'tcx, L>] where
F: FnMut(Ty<'tcx>) -> L,
[src]
&self,
tys: &[Ty<'tcx>],
f: &mut F
) -> &'lty [LabeledTy<'lty, 'tcx, L>] where
F: FnMut(Ty<'tcx>) -> L,
Label multiple Ty
s using a callback.
pub fn subst(
&self,
lty: LabeledTy<'lty, 'tcx, L>,
substs: &[LabeledTy<'lty, 'tcx, L>]
) -> LabeledTy<'lty, 'tcx, L>
[src]
&self,
lty: LabeledTy<'lty, 'tcx, L>,
substs: &[LabeledTy<'lty, 'tcx, L>]
) -> LabeledTy<'lty, 'tcx, L>
Substitute in arguments for any type parameter references (Param
) in a labeled type.
Panics if lty
contains a reference to a type parameter that is past the end of substs
(usually this means the caller is providing the wrong list of type arguments as substs
).
TODO: This produces a LabeledTy
with the right structure, but doesn't actually do
substitution on the underlying Ty
s! This means if you substitute u32
for T
, you can
end up with a LabeledTy
whose ty
is S<T>
, but whose args are [u32]
. By some
miracle, this hasn't broken anything yet, but we may need to fix it eventually.
pub fn subst_slice(
&self,
ltys: &[LabeledTy<'lty, 'tcx, L>],
substs: &[LabeledTy<'lty, 'tcx, L>]
) -> &'lty [LabeledTy<'lty, 'tcx, L>]
[src]
&self,
ltys: &[LabeledTy<'lty, 'tcx, L>],
substs: &[LabeledTy<'lty, 'tcx, L>]
) -> &'lty [LabeledTy<'lty, 'tcx, L>]
Substitute arguments in multiple labeled types.
pub fn relabel<L2, F>(
&self,
lty: LabeledTy<'lty, 'tcx, L2>,
func: &mut F
) -> LabeledTy<'lty, 'tcx, L> where
F: FnMut(&L2) -> L,
[src]
&self,
lty: LabeledTy<'lty, 'tcx, L2>,
func: &mut F
) -> LabeledTy<'lty, 'tcx, L> where
F: FnMut(&L2) -> L,
Run a callback to replace the labels on a type.
pub fn relabel_slice<L2, F>(
&self,
ltys: &'lty [LabeledTy<'lty, 'tcx, L2>],
func: &mut F
) -> &'lty [LabeledTy<'lty, 'tcx, L>] where
F: FnMut(&L2) -> L,
[src]
&self,
ltys: &'lty [LabeledTy<'lty, 'tcx, L2>],
func: &mut F
) -> &'lty [LabeledTy<'lty, 'tcx, L>] where
F: FnMut(&L2) -> L,
Replace the labels on several labeled types.
Auto Trait Implementations
impl<'lty, L> !Send for LabeledTyCtxt<'lty, L>
impl<'lty, L> !Sync for LabeledTyCtxt<'lty, L>
Blanket Implementations
impl<T> Lone for T
[src]
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<E> SpecializationError for E
[src]
default fn not_found<S, T>(
trait_name: &'static str,
method_name: &'static str
) -> E where
T: ?Sized,
[src]
trait_name: &'static str,
method_name: &'static str
) -> E where
T: ?Sized,
impl<T> Erased for T
[src]
impl<T> Send for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Sync for T where
T: ?Sized,
[src]
T: ?Sized,
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]
T: ?Sized,