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

Wrong "This declaration is never used." warning when variables are used only in reassignment LHS in index expressions #5920

Closed
ironcev opened this issue Apr 25, 2024 · 0 comments · Fixed by #5923
Assignees
Labels
bug Something isn't working compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen compiler General compiler. Should eventually become more specific as the issue is triaged DCA Everything to do with Dead Code Analysis team:compiler Compiler Team

Comments

@ironcev
Copy link
Member

ironcev commented Apr 25, 2024

E.g., this example will emit a false warning:

script;

fn main() {
    let i = 0;
    //  - This declaration is never used.  <<<----- WRONG WARNING.
    let mut array = [1, 2, 3];

    array[i] = 0; // <<<----- `i` is used here.
}
@ironcev ironcev added bug Something isn't working compiler General compiler. Should eventually become more specific as the issue is triaged compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen DCA Everything to do with Dead Code Analysis labels Apr 25, 2024
@ironcev ironcev self-assigned this Apr 25, 2024
@IGI-111 IGI-111 added the team:compiler Compiler Team label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen compiler General compiler. Should eventually become more specific as the issue is triaged DCA Everything to do with Dead Code Analysis team:compiler Compiler Team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants