1
Fork 0

Use () in dependency_formats.

This commit is contained in:
Camille GILLOT 2021-05-11 11:26:52 +02:00
parent ac923d94f8
commit 85a14d70bb
8 changed files with 18 additions and 13 deletions

View file

@ -21,6 +21,16 @@ pub trait Key {
fn default_span(&self, tcx: TyCtxt<'_>) -> Span;
}
impl Key for () {
fn query_crate(&self) -> CrateNum {
LOCAL_CRATE
}
fn default_span(&self, _: TyCtxt<'_>) -> Span {
DUMMY_SP
}
}
impl<'tcx> Key for ty::InstanceDef<'tcx> {
fn query_crate(&self) -> CrateNum {
LOCAL_CRATE