FuelLabs/sway

Delete redundant spans in `sway_error::error`

Open

#4,818 opened on Jul 18, 2023

View on GitHub
 (7 comments) (0 reactions) (1 assignee)Rust (61,702 stars) (5,421 forks)batch import
ODHack13compilercompiler: uigood first issuemay be rewardedteam:compiler

Description

Now when Idents are used instead of strings, those redundant spans are really annoying and bloating the code.

See this TODO.

When removing those redundant spans we can have a situation that deduplication of error messages might remove errors that are actually not duplicates because although they point to the same Ident (in terms of name), their Spans can be different. Deduplication works on hashes and Ident's hash contains only the name and not the span.

That's why we should always using IdentUnique.

Contributor guide