Skip to content

Commit

Permalink
not cache def_ident_span from disk
Browse files Browse the repository at this point in the history
  • Loading branch information
bvanjoi committed Jul 3, 2024
1 parent c872a14 commit a248ad1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
1 change: 0 additions & 1 deletion compiler/rustc_middle/src/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,6 @@ rustc_queries! {
/// Gets the span for the identifier of the definition.
query def_ident_span(def_id: DefId) -> Option<Span> {
desc { |tcx| "looking up span for `{}`'s identifier", tcx.def_path_str(def_id) }
cache_on_disk_if { def_id.is_local() }
separate_provide_extern
feedable
}
Expand Down
34 changes: 34 additions & 0 deletions tests/incremental/decl_macro.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//@ revisions: rpass1 rpass2

// issue#112680

#![feature(decl_macro)]

pub trait T {
type Key;
fn index_from_key(key: Self::Key) -> usize;
}

pub macro m($key_ty:ident, $val_ty:ident) {
struct $key_ty {
inner: usize,
}

impl T for $val_ty {
type Key = $key_ty;

fn index_from_key(key: Self::Key) -> usize {
key.inner
}
}
}

m!(TestId, Test);

#[cfg(rpass1)]
struct Test(u32);

#[cfg(rpass2)]
struct Test;

fn main() {}

0 comments on commit a248ad1

Please sign in to comment.