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

Begin splitting middle::ty #28274

Merged
merged 4 commits into from
Sep 15, 2015
Merged

Begin splitting middle::ty #28274

merged 4 commits into from
Sep 15, 2015

Conversation

arielb1
Copy link
Contributor

@arielb1 arielb1 commented Sep 6, 2015

That file got way too big for its own good. It could be split more - this is just a start.

r? @nikomatsakis

@arielb1
Copy link
Contributor Author

arielb1 commented Sep 6, 2015

Let the bikeshedding commence.

@bors
Copy link
Contributor

bors commented Sep 6, 2015

☔ The latest upstream changes (presumably #27893) made this pull request unmergeable. Please resolve the merge conflicts.

@bors
Copy link
Contributor

bors commented Sep 9, 2015

☔ The latest upstream changes (presumably #28300) made this pull request unmergeable. Please resolve the merge conflicts.

@nikomatsakis
Copy link
Contributor

I basically like this. I'm not sure about moving all the impls to a single module, but it might be nice. I've been wanting to split ty.rs into a directory for some time, for sure.

@arielb1 this is just a reorganization, right? No behavioral changes?

@arielb1
Copy link
Contributor Author

arielb1 commented Sep 10, 2015

@nikomatsakis

Right. No behavioral or (intentional) performance changes.

@arielb1
Copy link
Contributor Author

arielb1 commented Sep 10, 2015

I didn't move all impls, just Lift, HasTypeFlags, RegionEscape and TypeFoldable.

/// value's 'lt exist
///
/// NonZero is used rather than Unique because Unique isn't Copy.
pub struct TyIVar<'tcx, 'lt: 'tcx>(ivar::Ivar<NonZero<*const TyS<'static>>>,
Copy link
Member

Choose a reason for hiding this comment

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

I'm not a huge fan of having a redundant prefix on the name, but I guess you are doing it to disambiguate with Ivar.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is an Ivar<Ty<'tcx>>, not inline because of variance being annoying.

@jroesch
Copy link
Member

jroesch commented Sep 11, 2015

I like this as well 👍, but after 1214, MIR, and HIR this is going to be another "fun" rebase on my branch.

@nikomatsakis
Copy link
Contributor

@arielb1

I didn't move all impls, just Lift, HasTypeFlags, RegionEscape and TypeFoldable.

So I guess the interesting question is where these impls should go in general. I've sometimes regretted the current style -- I tend to think the impls should probably go with the types (though it's natural when first defining the traits to stick them with the trait). This is particularly true since in the cross-crate case they must go with the types. Note that "impls go with the types" might be loosely defined -- e.g., all types defined in the ty module might put their impls under ty::impls, but things in traits might be under traits::impls, etc.

@nikomatsakis
Copy link
Contributor

r+ from me, in any case. This looks like progress to me. I second the... joyful thoughts of rebases to come.

@arielb1
Copy link
Contributor Author

arielb1 commented Sep 13, 2015

@nikomatsakis

90% of the impls are for ty and rustc dependencies (std, syntax, etc.), and therefore would go in ty::structural_impls anyway. Should I create a similar traits::structural_impls for these?

@bors
Copy link
Contributor

bors commented Sep 14, 2015

☔ The latest upstream changes (presumably #28392) made this pull request unmergeable. Please resolve the merge conflicts.

@nikomatsakis
Copy link
Contributor

@arielb1 I think I would prefer that, yes. The Debug impls for traits are already stashed in util.rs, they could be combined together as well (basically, all the... de rigeur impls).

@nikomatsakis
Copy link
Contributor

But then I see you already did it.

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Sep 14, 2015

📌 Commit 5a95acb has been approved by nikomatsakis

@bors
Copy link
Contributor

bors commented Sep 15, 2015

⌛ Testing commit 5a95acb with merge b1c9616...

bors added a commit that referenced this pull request Sep 15, 2015
That file got way too big for its own good. It could be split more - this is just a start.

r? @nikomatsakis
@munyari
Copy link
Contributor

munyari commented Aug 7, 2016

Are InfrigingField and InfrigingVariant not typos?

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.

5 participants