Skip to content

Add desugaring to fixed point - #4080

Closed
CohenArthur wants to merge 3 commits into
Rust-GCC:masterfrom
CohenArthur:fixed-point-desugar
Closed

Add desugaring to fixed point#4080
CohenArthur wants to merge 3 commits into
Rust-GCC:masterfrom
CohenArthur:fixed-point-desugar

Conversation

@CohenArthur

Copy link
Copy Markdown
Member

Marking this as a draft since it might not be what we actually want, but we do get a lot further when expanding macros in core. For example, things like write!(fmt, ...)?; now work properly. Note that this may also be because the ExpandVisitor is lacking in many places... so just looking for comments on this for now

@powerboat9

Copy link
Copy Markdown
Collaborator

I don't think desugaring needs to be fixed point -- unless the resolver is supposed to rely on things being desugared to complete resolution? It seems like the macro issues are all problems local to ExpandVisitor.

gcc/rust/ChangeLog:

	* Make-lang.in: Compile it.
	* ast/rust-builtin-ast-nodes.h: Add missing methods for getting pointers.
	* ast/rust-expr.h: Likewise.
	* ast/rust-item.h: Likewise.
	* ast/rust-path.h: Likewise.
	* ast/rust-pattern.h: Likewise.
	* ast/rust-type.h: Likewise.
	* ast/rust-ast-pointer-visitor.cc: New file.
	* ast/rust-ast-pointer-visitor.h: New file.
gcc/rust/ChangeLog:

	* ast/rust-expression-yeast.cc (ExpressionYeast::dispatch): Rename to...
	(ExpressionYeast::reseat): ...this.
	(ExpressionYeast::visit): Remove.
	* ast/rust-expression-yeast.h: Inherit from PointerVisitor, override reseat instead
	of declaring dispatch.
gcc/rust/ChangeLog:

	* expand/rust-expand-visitor.cc: Remove old visitors.
	* expand/rust-expand-visitor.h: Likewise, plus inherit from PointerVisitor.
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.

2 participants