-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
rusti: duplicate definitions are accepted but break all further interaction #5675
Comments
Hang on... it's not at all clear to me that this should be fixed by allowing duplicate definitions. What's the semantic model for redefinitions? Scoping works differently for items, and it seems like we dodge a lot of questions by disallowing redefinitions here. In fact, it's not clear that the OP was actually asking for duplicate definitions, but simply for a better/earlier error message. Can I nominate this for WONTFIX ? Maybe I officially nominate it for not-a-bug / well-defined. |
I hoped we'd at least reject the duplicate definition right away rather than accepting it and then rejecting all further input, it doesn't seem very productive to brick the whole session but still accept input. I'd also say that redefinitions are really helpful for exploratory programming in the REPL. So even if this change isn't optimal yet (I haven't tried it), it's probably better than the current behavior? |
I certainly agree that it's far better to give an error message on the redefinition. |
Closed by #7070 |
Fix false negative of `checked_conversion` lint Closes rust-lang#5675 changelog: none
sample session:
The text was updated successfully, but these errors were encountered: