-
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
Implement Default
for DefId
#30039
Comments
Is this necessary for something in particular? |
@apasel422 |
I don't think it makes sense to return bad defids. There's a reason it has to be manually derived, since it could have been a case where autoderiving returns an invalid struct with a bad defid. |
I just needed to create dummy defids, so I wrote a |
But why? 😄 That shouldn't be necessary. |
@Manishearth I am working on an experimental refactoring tool. The existing code was written by somebody else and he uses dummy defids in some places. I don't yet know if it is necessary, though. I guess I will discover it later on, when I have a better understanding of the code. |
Ah, cool. Makes sense. As far as rustc goes we shouldn't be using dummy defids, and outside of rustc also it may not always be the best path. |
(Closing, unless anyone feels that there's a need for this in the compiler) |
Would it make sense to do this? If so, I would be happy to provide a PR. I guess it would look like the code below:
The text was updated successfully, but these errors were encountered: