Skip to content

Conversation

tirr-c
Copy link
Contributor

@tirr-c tirr-c commented Apr 3, 2020

This PR interns ProgramClause and Vec<ProgramClause>, and makes changes accordingly.

Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

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

Thanks! A few nits.


#[derive(Clone, PartialEq, Eq, Hash, PartialOrd, Ord, HasInterner)]
pub struct ProgramClause<I: Interner> {
clause: I::InternedProgramClause,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I think we we call this interned in all the other structs

Copy link
Member

Choose a reason for hiding this comment

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

We call it interned except in Goal and Goals IIRC. I think those should be renamed and everything should be interned.

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like @tirr-c fixed the new cases in this PR, we can create an issue for the others

pub fn data(&self, interner: &I) -> &ProgramClauseData<I> {
interner.program_clause_data(&self.clause)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Also I think we should add an interned(&self) -> &I::InternedProgramClause accessor

@nikomatsakis
Copy link
Contributor

Looks like the tests need to be updated, too

@tirr-c
Copy link
Contributor Author

tirr-c commented Apr 4, 2020

@nikomatsakis Done, pushed changes!

@nikomatsakis nikomatsakis merged commit 30efe09 into rust-lang:master Apr 6, 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