FuelLabs/sway

DCA improvements

Open

#6.007 aberto em 14 de mai. de 2024

Ver no GitHub
 (2 comments) (0 reactions) (1 assignee)Rust (5.421 forks)batch import
DCAgood first issue

Métricas do repositório

Stars
 (61.702 stars)
Métricas de merge de PR
 (Mesclagem média 5d 4h) (19 fundiu PRs em 30d)

Description

I think there is room for improvement on our DCA. For example, the screenshot below shows how rustc considers: A, T and f to be dead, because no "live code" actually uses them.

image

We, on the other hand, consider the mere presence of impls enough for them to not be dead.

image

Remove the impl and we now correctly mark this as dead. But the error message is not as clear as rustc's, which says the struct is never "constructed".

image image

This is all done at sway-core/src/control_flow_analysis/dead_code_analysis.rs and seems a candidate for "good first issue".

Guia do colaborador