You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
llogiq opened this issue
Feb 25, 2016
· 2 comments
Labels
A-lintArea: New lintsE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.T-ASTType: Requires working with the AST
We should lint labels that aren't used anywhere, as in
fn unused_label() {
'label: for i in 1..2 {
if i > 4 { continue }
}
}
To do this, we can use a Visitor to walk any FnDecl, collecting all used labels in a HashSet, then for all loops lint labels whose name isn't in the set. We also probably want to store the function's Block somewhere so we can clear the set in its check_block_post method – or perhaps I'll add another rustc PR with a check_fn_post method for both LintPasses.
The text was updated successfully, but these errors were encountered:
llogiq
added
E-medium
Call for participation: Medium difficulty level problem and requires some initial experience.
T-AST
Type: Requires working with the AST
A-lint
Area: New lints
labels
Feb 26, 2016
I believe this is something rustc should do, since this is a relatively simple task, which will not break any consistencies in the current upstream lints.
A-lintArea: New lintsE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.T-ASTType: Requires working with the AST
We should lint labels that aren't used anywhere, as in
To do this, we can use a
Visitor
to walk any FnDecl, collecting all used labels in a HashSet, then for all loops lint labels whose name isn't in the set. We also probably want to store the function'sBlock
somewhere so we can clear the set in itscheck_block_post
method – or perhaps I'll add another rustc PR with acheck_fn_post
method for bothLintPass
es.The text was updated successfully, but these errors were encountered: