Skip to content

Make def names and HIR names consistent.#95435

Merged
bors merged 3 commits intorust-lang:masterfrom
cjgillot:one-name
Apr 10, 2022
Merged

Make def names and HIR names consistent.#95435
bors merged 3 commits intorust-lang:masterfrom
cjgillot:one-name

Conversation

@cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Mar 29, 2022

The name in the DefKey is interned to create the DefId, so it does not
require any query to access. This can be leveraged to avoid a few useless
HIR accesses for names.

In order to achieve that, generic parameters created from universal
impl-trait are given the pretty-printed ast as a name, instead of
{{opaque}}.

Drive-by: the TyCtxt::opt_item_name used a dummy span for non-local
definitions. We have access to def_ident_span, so we use it.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants