Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DCA improvements #6007

Open
xunilrj opened this issue May 14, 2024 · 0 comments
Open

DCA improvements #6007

xunilrj opened this issue May 14, 2024 · 0 comments
Labels
DCA Everything to do with Dead Code Analysis good first issue Good for newcomers

Comments

@xunilrj
Copy link
Contributor

xunilrj commented May 14, 2024

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

@tritao tritao added good first issue Good for newcomers DCA Everything to do with Dead Code Analysis labels May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DCA Everything to do with Dead Code Analysis good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants