-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Rename TyVariants and variants #53581
Conversation
6e61e3e
to
efe7612
Compare
src/librustc/hir/def.rs
Outdated
@@ -53,13 +53,13 @@ pub enum Def { | |||
Existential(DefId), | |||
/// `type Foo = Bar;` | |||
TyAlias(DefId), | |||
TyForeign(DefId), | |||
Foreign(DefId), | |||
TraitAlias(DefId), | |||
AssociatedTy(DefId), | |||
/// `existential type Foo: Bar;` | |||
AssociatedExistential(DefId), | |||
PrimTy(hir::PrimTy), |
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.
Hm, maybe drop Ty
here too? And in the other cases perhaps?
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.
No, this is "primitive type". Def
contains both types and values.
src/librustc/hir/def.rs
Outdated
@@ -53,13 +53,13 @@ pub enum Def { | |||
Existential(DefId), | |||
/// `type Foo = Bar;` | |||
TyAlias(DefId), | |||
TyForeign(DefId), | |||
Foreign(DefId), |
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.
This seems suboptimal... what if you first rename this to ForeignTy
and then do the other renames?
src/librustc/hir/def.rs
Outdated
TraitAlias(DefId), | ||
AssociatedTy(DefId), | ||
/// `existential type Foo: Bar;` | ||
AssociatedExistential(DefId), | ||
PrimTy(hir::PrimTy), | ||
TyParam(DefId), | ||
Param(DefId), |
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.
We probably want to keep this the way it is, assuming we need to tell apart ty params from const ones.
4afca34
to
f3fcbbc
Compare
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
☔ The latest upstream changes (presumably #50912) made this pull request unmergeable. Please resolve the merge conflicts. |
src/librustc/hir/def.rs
Outdated
@@ -53,13 +53,13 @@ pub enum Def { | |||
Existential(DefId), | |||
/// `type Foo = Bar;` | |||
TyAlias(DefId), | |||
Foreign(DefId), | |||
TyForeign(DefId), |
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 prefer ForeignTy
, specifically, just like AssociatedTy
below.
673fe3f
to
f6557d0
Compare
fn ty_param_secret(&self); | ||
} | ||
|
||
mod m { | ||
struct Priv; | ||
|
||
impl ::Arr0 for [Priv; 0] { fn arr0_secret(&self) {} } | ||
impl ::TyParam for Option<Priv> { fn ty_param_secret(&self) {} } | ||
impl ::Param for Option<Priv> { fn ty_param_secret(&self) {} } |
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.
Hehe you don't need to change this.
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.
Fixed.
f6557d0
to
b3018a9
Compare
☔ The latest upstream changes (presumably #53424) made this pull request unmergeable. Please resolve the merge conflicts. |
@varkor r=me when you rebase |
…ic|Closure|Generator|GeneratorWitness|Never|Tuple|Projection|Anon|Infer|Error}
b3018a9
to
4e62df4
Compare
4e62df4
to
71722b9
Compare
@bors r=eddyb p=10 (This bitrots very quickly.) |
📌 Commit 71722b9 has been approved by |
Rename TyVariants and variants - Rename `TypeVariants` to `TyKind`. - Remove the `Ty` prefix from each one of its variants (plus the identically-named variants of `PrimTy`). - Rename `ty::Slice` to `ty::List`. The new names look cleaner. r? @eddyb
☀️ Test successful - status-appveyor, status-travis |
📣 Toolstate changed by #53581! Tested on commit b75b047. 💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra). |
Tested on commit rust-lang/rust@b75b047. Direct link to PR: <rust-lang/rust#53581> 💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra). 💔 clippy-driver on linux: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk, @rust-lang/infra).
rustup, fix breakage introduced by rust-lang/rust#53581 and rust-lang/rust#53459
This has been renamed in rust-lang/rust#53581.
This has been renamed in rust-lang/rust#53581.
TypeVariants
toTyKind
.Ty
prefix from each one of its variants (plus the identically-named variants ofPrimTy
).ty::Slice
toty::List
.The new names look cleaner.
r? @eddyb