pub struct Source {
pub map: SourceMap,
pub root: FileId,
pub mode: InputMode,
/* private fields */
}Expand description
The captured macro input: a SourceMap plus the id of the root file.
Fields§
§map: SourceMapAll source files seen so far.
root: FileIdThe file holding the macro’s own C text.
mode: InputModeHow the root file was captured.
Implementations§
Source§impl Source
impl Source
Sourcepub fn unit_id(&self) -> u64
pub fn unit_id(&self) -> u64
A number that identifies this macro invocation.
Two c99! blocks in one Rust module generate items into the same
namespace, so every synthetic name — the module holding the extern
block, the mangling of a function-local static, the name given to an
anonymous struct — has to carry something that tells the two apart.
This is that something: a hash of where the invocation is (its file,
line and column) together with its text, which makes it deterministic
across compilations of the same code, unique between invocations, and
stable enough for a snapshot test to record.
Auto Trait Implementations§
impl !RefUnwindSafe for Source
impl !Send for Source
impl !Sync for Source
impl !UnwindSafe for Source
impl Freeze for Source
impl Unpin for Source
impl UnsafeUnpin for Source
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more