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

Name shadowing within a single pattern should have a lint (or be an error) #14581

Closed
huonw opened this issue Jun 1, 2014 · 2 comments
Closed
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut.
Milestone

Comments

@huonw
Copy link
Member

huonw commented Jun 1, 2014

E.g.

let (a, a) = (1, 2);

is perfectly valid code, but it seems very useless and one would only do it by accident, i.e. we could lint it.

(That said, I imagine almost all examples of this will hit the "unused variable" warning too.)

@nikomatsakis
Copy link
Contributor

At triage meeting today, we decided this should be done by 1.0.

@nrc
Copy link
Member

nrc commented Jun 5, 2014

We also agreed it should be an error

pcwalton added a commit to pcwalton/rust that referenced this issue Jun 11, 2014
bindings and function arguments.

Issue rust-lang#14581.

To fix code that this breaks, give the pattern identifiers different names.

[breaking-change]
bors added a commit that referenced this issue Jun 12, 2014
…=alexcrichton

bindings and function arguments.

Issue #14581.

To fix code that this breaks, give the pattern identifiers different names.

[breaking-change]

r? @brson
bors added a commit to rust-lang-ci/rust that referenced this issue Jun 5, 2023
internal: Move layout logic from hir-def to hir-ty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut.
Projects
None yet
Development

No branches or pull requests

4 participants