Skip to content

Commit ddc5eb0

Browse files
committed
Mark span parent in def_collector.
1 parent 1d07d68 commit ddc5eb0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

compiler/rustc_resolve/src/def_collector.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ impl<'a, 'ra, 'tcx> DefCollector<'a, 'ra, 'tcx> {
100100
}
101101

102102
impl<'a, 'ra, 'tcx> mut_visit::MutVisitor for DefCollector<'a, 'ra, 'tcx> {
103+
fn visit_span(&mut self, span: &mut Span) {
104+
if self.resolver.tcx.sess.opts.incremental.is_some() {
105+
*span = span.with_parent(Some(self.invocation_parent.parent_def));
106+
}
107+
}
108+
103109
fn visit_item(&mut self, i: &mut Item) {
104110
// Pick the def data. This need not be unique, but the more
105111
// information we encapsulate into, the better

tests/incremental/hashes/function_interfaces.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ pub fn change_return_impl_trait() -> impl Clone {
320320
#[cfg(not(any(cfail1,cfail4)))]
321321
#[rustc_clean(cfg = "cfail2", except = "opt_hir_owner_nodes")]
322322
#[rustc_clean(cfg = "cfail3")]
323-
#[rustc_clean(cfg = "cfail5", except = "opt_hir_owner_nodes, typeck")]
323+
#[rustc_clean(cfg = "cfail5", except = "opt_hir_owner_nodes")]
324324
#[rustc_clean(cfg = "cfail6")]
325325
pub fn change_return_impl_trait() -> impl Copy {
326326
0u32

0 commit comments

Comments
 (0)