]> git.lizzy.rs Git - rust.git/commit - src/tools/rust-analyzer
Rollup merge of #90727 - GuillaumeGomez:remove-potential-useless-search-index-data...
authorMatthias Krüger <matthias.krueger@famsik.de>
Wed, 10 Nov 2021 17:52:28 +0000 (18:52 +0100)
committerGitHub <noreply@github.com>
Wed, 10 Nov 2021 17:52:28 +0000 (18:52 +0100)
commitb31f0198b14300d232dc1b6d1f52dc92da7818ff
treea3a7cface2d874cb785cdee72d57033afdeb43f9
parent858fea410d89986669c3613c63b5401abd72b891
parent8d5ef320fc6c2d4436692d1558d36bd59c49394b
Rollup merge of #90727 - GuillaumeGomez:remove-potential-useless-search-index-data, r=notriddle,camelid

Remove potential useless data for search index

I uncovered this case when working on https://github.com/rust-lang/rust/pull/90726 to debug https://github.com/rust-lang/rust/pull/90385.

Explanations: if we have a full generic, we check if it has generics then we do the following:
 * If it has only one generic, we remove one nested level in order to not keep the "parent" generic (since it has empty name, it's useless after all).
 * Otherwise we add it alongside its generics.

However, I didn't handle the case where a generic had no generics. Meaning that we were adding items with empty names in the search index. So basically useless data in the search index.

r? `@camelid`