@@ -326,15 +326,15 @@ The idea is that you can annotate a test like:
326326#[rustc_if_this_changed]
327327fn foo () { }
328328
329- #[rustc_then_this_would_need(TypeckItemBody )] // ~ ERROR OK
329+ #[rustc_then_this_would_need(Tables )] // ~ ERROR OK
330330fn bar () { foo (); }
331331
332- #[rustc_then_this_would_need(TypeckItemBody )] // ~ ERROR no path
332+ #[rustc_then_this_would_need(Tables )] // ~ ERROR no path
333333fn baz () { }
334334```
335335
336336This will check whether there is a path in the dependency graph from
337- ` Hir(foo) ` to ` TypeckItemBody (bar)` . An error is reported for each
337+ ` Hir(foo) ` to ` Tables (bar)` . An error is reported for each
338338` #[rustc_then_this_would_need] ` annotation that indicates whether a
339339path exists. ` //~ ERROR ` annotations can then be used to test if a
340340path is found (as demonstrated above).
@@ -371,27 +371,27 @@ A node is considered to match a filter if all of those strings appear in its
371371label. So, for example:
372372
373373```
374- RUST_DEP_GRAPH_FILTER='-> TypeckItemBody '
374+ RUST_DEP_GRAPH_FILTER='-> Tables '
375375```
376376
377- would select the predecessors of all ` TypeckItemBody ` nodes. Usually though you
378- want the ` TypeckItemBody ` node for some particular fn, so you might write:
377+ would select the predecessors of all ` Tables ` nodes. Usually though you
378+ want the ` Tables ` node for some particular fn, so you might write:
379379
380380```
381- RUST_DEP_GRAPH_FILTER='-> TypeckItemBody & bar'
381+ RUST_DEP_GRAPH_FILTER='-> Tables & bar'
382382```
383383
384- This will select only the ` TypeckItemBody ` nodes for fns with ` bar ` in their name.
384+ This will select only the ` Tables ` nodes for fns with ` bar ` in their name.
385385
386386Perhaps you are finding that when you change ` foo ` you need to re-type-check ` bar ` ,
387387but you don't think you should have to. In that case, you might do:
388388
389389```
390- RUST_DEP_GRAPH_FILTER='Hir&foo -> TypeckItemBody & bar'
390+ RUST_DEP_GRAPH_FILTER='Hir&foo -> Tables & bar'
391391```
392392
393393This will dump out all the nodes that lead from ` Hir(foo) ` to
394- ` TypeckItemBody (bar)` , from which you can (hopefully) see the source
394+ ` Tables (bar)` , from which you can (hopefully) see the source
395395of the erroneous edge.
396396
397397#### Tracking down incorrect edges
@@ -417,8 +417,8 @@ dep-graph as described in the previous section and open `dep-graph.txt`
417417to see something like:
418418
419419 Hir(foo) -> Collect(bar)
420- Collect(bar) -> TypeckItemBody (bar)
421-
420+ Collect(bar) -> Tables (bar)
421+
422422That first edge looks suspicious to you. So you set
423423` RUST_FORBID_DEP_GRAPH_EDGE ` to ` Hir&foo -> Collect&bar ` , re-run, and
424424then observe the backtrace. Voila, bug fixed!
@@ -440,4 +440,6 @@ To achieve this, the HIR map will detect if the def-id originates in
440440an inlined node and add a dependency to a suitable ` MetaData ` node
441441instead. If you are reading a HIR node and are not sure if it may be
442442inlined or not, you can use ` tcx.map.read(node_id) ` and it will detect
443- whether the node is inlined or not and do the right thing.
443+ whether the node is inlined or not and do the right thing. You can
444+ also use ` tcx.map.is_inlined_def_id() ` and
445+ ` tcx.map.is_inlined_node_id() ` to test.
0 commit comments