You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ebdddb5
Browse filesBrowse the repository at this point in the historyBrowse files
Rollup merge of #162942 - nnethercote:rm-StashKey-AssociatedTypeSuggestion, r=davidtwco
Remove `StashKey::AssociatedTypeSuggestion`
Currently it's used in a really hacky way: a diagnostic with an empty message and some suggestions is stashed. Later on it might be retrieved and its suggestions extracted. It uses `Level::Allow` so that it isn't printed by `emit_stashed_diagnostics` at shutdown if it hasn't been retrieved.
This isn't a normal stashed diagnostic, more just a case of "save some information that might be useful for diagnostics later". We can record the information more simply and directly.
This commit adds `paths_matching_assoc_types` fields to `Resolver` and `ResolverGlobalCtxt`. These store the spans of the paths of interest. The new subdiagnostic `AssocTypeWithSameName` is used to construct the relevant suggestions when they are needed. Much nicer. The old approach removed the stashed diagnostic and the new approach doesn't remove the set entry, so a single span could conceivably match more than once, presumably a good thing, though this doesn't show up in the test suite.
r? @davidtwco
0 commit comments