Struct rustc::mir::LocalDecl
[−]
[src]
pub struct LocalDecl<'tcx> { pub mutability: Mutability, pub ty: Ty<'tcx>, pub name: Option<Name>, pub source_info: Option<SourceInfo>, }
rustc_private
)A MIR local.
This can be a binding declared by the user, a temporary inserted by the compiler, a function argument, or the return pointer.
Fields
mutability: Mutability
rustc_private
)let mut x
vs let x
.
Temporaries and the return pointer are always mutable.
ty: Ty<'tcx>
rustc_private
)Type of this local.
name: Option<Name>
rustc_private
)Name of the local, used in debuginfo and pretty-printing.
Note that function arguments can also have this set to Some(_)
to generate better debuginfo.
source_info: Option<SourceInfo>
rustc_private
)For user-declared variables, stores their source information.
For temporaries, this is None
.
This is the primary way to differentiate between user-declared variables and compiler-generated temporaries.
Methods
impl<'tcx> LocalDecl<'tcx>
[src]
fn new_temp(ty: Ty<'tcx>) -> Self
rustc_private
)Create a new LocalDecl
for a temporary.
fn new_return_pointer(return_ty: Ty) -> LocalDecl
rustc_private
)Builds a LocalDecl
for the return pointer.
This must be inserted into the local_decls
list as the first local.
Trait Implementations
impl<'tcx> Clone for LocalDecl<'tcx>
[src]
fn clone(&self) -> LocalDecl<'tcx>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<'tcx> Debug for LocalDecl<'tcx>
[src]
impl<'tcx> Encodable for LocalDecl<'tcx>
[src]
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
deprecated in favor of rustc-serialize on crates.io
impl<'tcx> Decodable for LocalDecl<'tcx>
[src]
fn decode<__D: Decoder>(__arg_0: &mut __D)
-> Result<LocalDecl<'tcx>, __D::Error>
-> Result<LocalDecl<'tcx>, __D::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
deprecated in favor of rustc-serialize on crates.io
impl<'tcx> TypeFoldable<'tcx> for LocalDecl<'tcx>
[src]
fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self,
folder: &mut F)
-> Self
folder: &mut F)
-> Self
rustc_private
)fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool
rustc_private
)fn fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self,
folder: &mut F)
-> Self
folder: &mut F)
-> Self
rustc_private
)fn visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool
rustc_private
)fn has_regions_escaping_depth(&self, depth: u32) -> bool
rustc_private
)fn has_escaping_regions(&self) -> bool
rustc_private
)fn has_type_flags(&self, flags: TypeFlags) -> bool
rustc_private
)fn has_projection_types(&self) -> bool
rustc_private
)fn references_error(&self) -> bool
rustc_private
)fn has_param_types(&self) -> bool
rustc_private
)fn has_self_ty(&self) -> bool
rustc_private
)fn has_infer_types(&self) -> bool
rustc_private
)fn needs_infer(&self) -> bool
rustc_private
)fn needs_subst(&self) -> bool
rustc_private
)fn has_re_skol(&self) -> bool
rustc_private
)fn has_closure_types(&self) -> bool
rustc_private
)fn has_erasable_regions(&self) -> bool
rustc_private
)fn is_normalized_for_trans(&self) -> bool
rustc_private
)fn is_global(&self) -> bool
rustc_private
)Indicates whether this value references only 'global' types/lifetimes that are the same regardless of what fn we are in. This is used for caching. Errs on the side of returning false. Read more