-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Cleanup: rename middle::ty::sty and its variants. #26232
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nrc (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
☔ The latest upstream changes (presumably #26225) made this pull request unmergeable. Please resolve the merge conflicts. |
LGTM, but a could of names seem somewhat long: |
I can shorten I don't really know how to shorten As for getting rid of the |
In general, I don't mind long names so much. TyRef is fine. I think TyArray would be fine instead of TyArrayOrSlice - it is close enough. Dropping the Ty prefix in favour of Ty:: would be nice. But I don't want to see TyV at all - that's indecipherable. (In general, we have a history of short and somewhat bad names in the compiler and we've been moving towards longer, more understandable names. Obviously there are specific places where concision is still warranted though). |
ty_uint(ast::UintTy), | ||
ty_float(ast::FloatTy), | ||
/// Substs here, possibly against intuition, *may* contain `ty_param`s. | ||
pub enum TypeVariants<'tcx> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe Types
rather than TyV
or TypeVariants
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @nikomatsakis also mentioned TyKind
a long time ago (when I considered making this cleanup).
This is a great PR, I've wanted to rename these things for a while. Thanks for making the changes. If you could at least change TyArrayOrSlice and TyReference we could land this. You could try changing to use the prefix, or we could land this and do that as a follow up - I realise this PR will rot quite quickly. |
877fef6
to
9fad9af
Compare
Rebased, and amended to use TyRef and TyArray. I think I'll experiment with the prefixes later; there's already a variant named "Types" in librustc/middle/infer/mod.rs. |
@bors: r+ p=1 |
📌 Commit 9fad9af has been approved by |
⌛ Testing commit 9fad9af with merge 7626e9f... |
💔 Test failed - auto-linux-64-nopt-t |
I didn't rebase correctly; sorry about the churn. Amended with fix. |
@bors: r+ p=1 |
📌 Commit 00f86fe has been approved by |
⌛ Testing commit 00f86fe with merge f4bdebf... |
Use camel-case naming, and use names which actually make sense in modern Rust.
💔 Test failed - auto-mac-64-opt |
Use camel-case naming, and use names which actually make sense in modern Rust.
Updated again; I thought I had built everything, but I somehow missed librustdoc. |
@bors r=nrc |
📌 Commit 3c69db4 has been approved by |
Use camel-case naming, and use names which actually make sense in modern Rust.
Use camel-case naming, and use names which actually make sense in modern Rust.