FuelLabs/sway

DCA improvements

Open

#6,007 建立於 2024年5月14日

在 GitHub 查看
 (2 留言) (0 反應) (1 負責人)Rust (61,702 star) (5,421 fork)batch import
DCAgood first issue

描述

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".

貢獻者指南