MCPcopy Create free account
hub / github.com/Rust-GPU/rust-gpu / DebugFileKey

Class DebugFileKey

crates/rustc_codegen_spirv/src/builder_spirv.rs:325–325  ·  view source on GitHub ↗

`HashMap` key type (for `debug_file_cache` in `BuilderSpirv`), which is equivalent to a whole `rustc` `SourceFile`, but has O(1) `Eq` and `Hash` implementations (i.e. not involving the path or the contents of the file). This is possible because we can compare `Lrc `s by equality, as `rustc`'s `SourceMap` already ensures that only one `SourceFile` will be allocated for some given file.

Source from the content-addressed store, hash-verified

323/// allocated for some given file. For hashing, we could hash the address, or
324///
325struct DebugFileKey(Lrc<SourceFile>);
326
327impl PartialEq for DebugFileKey {
328 fn eq(&self, other: &Self) -> bool {

Callers 1

def_debug_fileMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected