Skip to content

Commit c6363b8

Browse files
committed
ignore dep-graph when loading inlined HIR
We touch the krate to adjust the maps, but we don't expose that data widely.
1 parent 5415b34 commit c6363b8

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

src/librustc/hir/map/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,8 @@ pub fn map_decoded_item<'ast, F: FoldOps>(map: &Map<'ast>,
927927
ii: InlinedItem,
928928
fold_ops: F)
929929
-> &'ast InlinedItem {
930+
let _ignore = map.forest.dep_graph.in_ignore();
931+
930932
let mut fld = IdAndSpanUpdater::new(fold_ops);
931933
let ii = match ii {
932934
II::Item(d, i) => II::Item(fld.fold_ops.new_def_id(d),

src/test/incremental/krate-inlined.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// revisions: rpass1 rpass2
12+
// compile-flags: -Z query-dep-graph
13+
14+
#![allow(warnings)]
15+
#![feature(rustc_attrs)]
16+
#![rustc_partition_reused(module="krate_inlined-x", cfg="rpass2")]
17+
18+
fn main() { }
19+
20+
mod x {
21+
fn method() {
22+
// use some methods that require inlining HIR from another crate:
23+
let mut v = vec![];
24+
v.push(1);
25+
}
26+
}
27+
28+
#[cfg(rpass1)]
29+
fn bar() { } // remove this unrelated fn in rpass2, which should not affect `x::method`

0 commit comments

Comments
 (0)