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

Rename TyData to TyKind #628

Merged
merged 4 commits into from
Oct 21, 2020
Merged

Rename TyData to TyKind #628

merged 4 commits into from
Oct 21, 2020

Conversation

jackh726
Copy link
Member

Part of #627

Copy link
Member

@nathanwhit nathanwhit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple nits, but then r=me

@@ -165,13 +165,13 @@ other type without any effect, and so forth.

## Mapping to rustc types

The rustc [`TyKind`] enum has a lot more variants than chalk. This
The rustc [`TyVariableKind`] enum has a lot more variants than chalk. This
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should stay as TyKind, so just s/TyVariableKind/TyKind in the book (should fix the link too)

pub fn inference_var(&self, interner: &I) -> Option<InferenceVar> {
if let TyData::InferenceVar(depth, _) = self.data(interner) {
if let TyKind::InferenceVar(depth, _) = &self.data(interner).kind {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.data(interner).kind -> self.kind(interner) here and in the rest of chalk-ir

@@ -2431,8 +2447,8 @@ impl<I: Interner> Substitution<I> {
self.iter(interner).zip(0..).all(|(generic_arg, index)| {
let index_db = BoundVar::new(DebruijnIndex::INNERMOST, index);
match generic_arg.data(interner) {
GenericArgData::Ty(ty) => match ty.data(interner) {
TyData::BoundVar(depth) => index_db == *depth,
GenericArgData::Ty(ty) => match &ty.data(interner).kind {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty.data(interner).kind -> ty.kind(interner

@jackh726
Copy link
Member Author

@bors r=nathanwhit

@bors
Copy link
Contributor

bors commented Oct 21, 2020

📌 Commit 21b44ab has been approved by nathanwhit

@bors
Copy link
Contributor

bors commented Oct 21, 2020

⌛ Testing commit 21b44ab with merge 30f4a12...

@bors
Copy link
Contributor

bors commented Oct 21, 2020

☀️ Test successful - checks-actions
Approved by: nathanwhit
Pushing 30f4a12 to master...

@bors bors merged commit 30f4a12 into master Oct 21, 2020
@jackh726 jackh726 deleted the tykind branch October 21, 2020 20:10
@bors bors mentioned this pull request Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants