Struct ra_ap_hir_def::body::BodySourceMap [−][src]
pub struct BodySourceMap { /* fields omitted */ }
Expand description
An item body together with the mapping from syntax nodes to HIR expression IDs. This is needed to go from e.g. a position in a file to the HIR expression containing it; but for type inference etc., we want to operate on a structure that is agnostic to the actual positions of expressions in the file, so that we don’t recompute types whenever some whitespace is typed.
One complication here is that, due to macro expansion, a single Body
might
be spread across several files. So, for each ExprId and PatId, we record
both the HirFileId and the position inside the file. However, we only store
AST -> ExprId mapping for non-macro files, as it is not clear how to handle
this properly for macros.
Implementations
Trait Implementations
Returns the “default value” for a type. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for BodySourceMap
impl Send for BodySourceMap
impl Sync for BodySourceMap
impl Unpin for BodySourceMap
impl UnwindSafe for BodySourceMap
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.