]> git.lizzy.rs Git - rust.git/commitdiff
Merge #7375
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Thu, 21 Jan 2021 15:28:40 +0000 (15:28 +0000)
committerGitHub <noreply@github.com>
Thu, 21 Jan 2021 15:28:40 +0000 (15:28 +0000)
7375: Add support for running name resolution in block expressions r=jonas-schievink a=jonas-schievink

This adds a `block_def_map` query that runs the name resolution algorithm on a block expression, and returns a `DefMap` that stores links to the parent `DefMap` (either the containing block or the crate-level `DefMap`). Blocks with no inner items return the parent's `DefMap` as-is, to avoid creating unnecessarily long `DefMap` chains.

Path resolution is updated to recurse into the parent `DefMap` after looking up a path in the original `DefMap`.

I've added a few new tests for this, but outside of those this isn't used yet.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>

Trivial merge