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

Resolve and lower parenthesized types #3328

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

CohenArthur
Copy link
Member

Needs #3324

This allows us to start looking at more handling for auto traits and multiple trait bounds, as they are always represented as parenthesized types when used in function parameters

This is useful for handling multiple trait bounds, and required for better handling of auto traits.

gcc/rust/ChangeLog:

	* hir/rust-ast-lower-type.cc (ASTLoweringType::visit): Add implementation for
	ParenthesizedType.
	* hir/rust-ast-lower-type.h: Declare that new visitor.

gcc/testsuite/ChangeLog:

	* rust/compile/auto_traits1.rs: New test.
This commit correctly lowers and typechecks parenthesized types, which are used for trait objects with additional bounds.

gcc/rust/ChangeLog:

	* resolve/rust-ast-resolve-type.cc (ResolveType::visit): New visitor to handle
	ParenthesizedType.
	* resolve/rust-ast-resolve-type.h: Likewise.
	* typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): Likewise.
	* typecheck/rust-hir-type-check-type.h: Likewise.

gcc/testsuite/ChangeLog:

	* rust/compile/auto_traits2.rs: New test.
	* rust/compile/auto_traits3.rs: New test.
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.

1 participant