diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-01-13 05:26:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-13 05:26:53 +0100 |
| commit | edec83835aed689a9f5c6ab50d3eb5491007de25 (patch) | |
| tree | c5f466100926ade0fdf9c388de267eb7b6572f91 /src/test/ui/missing/missing-alloc_error_handler.rs | |
| parent | b3290fd14ce4d15ccd6e4719af5d98552cb85efd (diff) | |
| parent | c47ed149b2efe537822632c11d0675bdfb3d790c (diff) | |
| download | rust-edec83835aed689a9f5c6ab50d3eb5491007de25.tar.gz rust-edec83835aed689a9f5c6ab50d3eb5491007de25.zip | |
Rollup merge of #57474 - emilio:save-analysis-path, r=nrc
save-analysis: Get path def from parent in case there's no def for the path itself.
This fixes #57462.
The relevant part from the hir type collector is:
```
DEBUG 2019-01-09T15:42:58Z: rustc::hir::map::collector: hir_map: NodeId(32) => Entry { parent: NodeId(33), dep_node: 4294967040, node: Expr(expr(32: <Foo>::new)) }
DEBUG 2019-01-09T15:42:58Z: rustc::hir::map::collector: hir_map: NodeId(48) => Entry { parent: NodeId(32), dep_node: 4294967040, node: Ty(type(Foo)) }
DEBUG 2019-01-09T15:42:58Z: rustc::hir::map::collector: hir_map: NodeId(30) => Entry { parent: NodeId(48), dep_node: 4294967040, node: PathSegment(PathSegment { ident: Foo#0, id: Some(NodeId(30)), def: Some(Err), args: None, infer_types: true }) }
DEBUG 2019-01-09T15:42:58Z: rustc::hir::map::collector: hir_map: NodeId(31) => Entry { parent: NodeId(32), dep_node: 4294967040, node: PathSegment(PathSegment { ident: new#0, id: Some(NodeId(31)), def: Some(Err), args: None, infer_types: true }) }
```
We have the right ID when looking for NodeId(31) and try with NodeId(32) (which
is the right thing to look for) from get_path_data. But not when we look from `write_sub_paths_truncated`
Basically process_path takes an id which is always the parent, and that we
fall back to in get_path_data(), so we get the right result for the last path
segment, but not for the other segments that get written to from
write_sub_paths_truncated.
I think we can stop passing the explicit `id` around to get_path_data as a followup.
Diffstat (limited to 'src/test/ui/missing/missing-alloc_error_handler.rs')
0 files changed, 0 insertions, 0 deletions
