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

Create base class AssociatedItem #2679

Merged
merged 1 commit into from
Oct 18, 2023
Merged

Conversation

powerboat9
Copy link
Contributor

Taken from #2670

@dkm
Copy link
Member

dkm commented Oct 12, 2023

Is "deconstructor" a reference to something precise, or is it supposed to read "destructor"?

@powerboat9
Copy link
Contributor Author

@dkm
Copy link
Member

dkm commented Oct 12, 2023

It refers to member functions which are called when the lifetime of an object ends :P

Ok, so destructor, not deconstructor as you had in the commit log :) I was wondering if this was yet-another C++ concept I didn't know :)

@powerboat9 powerboat9 changed the title Unify cloning of associated items Create base class AssociatedItem Oct 14, 2023
gcc/rust/ChangeLog:

	* ast/rust-ast.h
	(class AssociatedItem):
	New, based on TraitItem, InherentImplItem, and TraitImplItem classes.
	(class TraitItem): Inherit from AssociatedItem.
	(class InherentImplItem): Likewise.
	(class TraitImplItem): Likewise.
	* ast/rust-item.h
	(class Method): Update cloning functions.
	(class Function): Likewise.
	(class TypeAlias): Likewise.
	(class ConstantItem): Likewise.
	(class TraitItemFunc): Likewise.
	(class TraitItemMethod): Likewise.
	(class TraitItemConst): Likewise.
	(class TraitItemType): Likewise.
	* ast/rust-macro.h
	(class MacroInvocation): Likewise.

Signed-off-by: Owen Avery <[email protected]>
Copy link
Member

@philberty philberty left a comment

Choose a reason for hiding this comment

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

I can see this being useful can you do the same for the HIR?

Need @CohenArthur sign off here too for this one. I like this idea

@powerboat9
Copy link
Contributor Author

I'd probably want to modify the HIR in another pull request -- it looks like the HIR representation of associated items is already slightly different from the AST representation

Copy link
Member

@CohenArthur CohenArthur left a comment

Choose a reason for hiding this comment

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

looks great! thank you :D I like these changes

@CohenArthur CohenArthur added this pull request to the merge queue Oct 18, 2023
Merged via the queue into Rust-GCC:master with commit cdd548b Oct 18, 2023
9 checks passed
@powerboat9 powerboat9 deleted the clone-unify branch October 18, 2023 14:22
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.

4 participants