FuelLabs/sway

Delete redundant spans in `sway_error::error`

Open

Aperta il 18 lug 2023

Vedi su GitHub
 (7 commenti) (0 reazioni) (1 assegnatario)Rust (61.702 star) (5421 fork)batch import
ODHack13compilercompiler: uigood first issuemay be rewardedteam:compiler

Descrizione

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.

Guida contributor