Struct rustc_span::source_map::StableSourceFileId
source · Expand description
This is a SourceFile identifier that is used to correlate source files between subsequent compilation sessions (which is something we need to do during incremental compilation).
The StableSourceFileId also contains the CrateNum of the crate the source file was originally parsed for. This way we get two separate entries in the SourceMap if the same file is part of both the local and an upstream crate. Trying to only have one entry for both cases is problematic because at the point where we discover that there’s a local use of the file in addition to the upstream one, we might already have made decisions based on the assumption that it’s an upstream file. Treating the two files as different has no real downsides.
Fields
file_name_hash: u64
cnum: CrateNum
Implementations
sourceimpl StableSourceFileId
impl StableSourceFileId
pub fn new(source_file: &SourceFile) -> StableSourceFileId
fn new_from_name(name: &FileName, cnum: CrateNum) -> StableSourceFileId
Trait Implementations
sourceimpl Clone for StableSourceFileId
impl Clone for StableSourceFileId
sourcefn clone(&self) -> StableSourceFileId
fn clone(&self) -> StableSourceFileId
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for StableSourceFileId
impl Debug for StableSourceFileId
sourceimpl<__D: Decoder> Decodable<__D> for StableSourceFileId
impl<__D: Decoder> Decodable<__D> for StableSourceFileId
sourceimpl<__E: Encoder> Encodable<__E> for StableSourceFileId
impl<__E: Encoder> Encodable<__E> for StableSourceFileId
sourceimpl Hash for StableSourceFileId
impl Hash for StableSourceFileId
sourceimpl PartialEq<StableSourceFileId> for StableSourceFileId
impl PartialEq<StableSourceFileId> for StableSourceFileId
sourcefn eq(&self, other: &StableSourceFileId) -> bool
fn eq(&self, other: &StableSourceFileId) -> bool
impl Copy for StableSourceFileId
impl Eq for StableSourceFileId
impl StructuralEq for StableSourceFileId
impl StructuralPartialEq for StableSourceFileId
Auto Trait Implementations
impl RefUnwindSafe for StableSourceFileId
impl Send for StableSourceFileId
impl Sync for StableSourceFileId
impl Unpin for StableSourceFileId
impl UnwindSafe for StableSourceFileId
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 16 bytes