Skip to content

Conversation

@CohenArthur
Copy link
Member

No description provided.

gcc/rust/ChangeLog:

	* resolve/rust-early-name-resolver-2.0.cc (Early::finalize_glob_import): Save prelude
	if we find one.
	* resolve/rust-name-resolution-context.h: Add field.
	* resolve/rust-toplevel-name-resolver-2.0.cc (has_prelude_import): New function.
	(TopLevel::visit): Create a prelude glob import if necessary.
	* resolve/rust-toplevel-name-resolver-2.0.h: Allow glob imports to be prelude imports.
gcc/rust/ChangeLog:

	* resolve/rust-forever-stack.h: Add new resolve_path function.
	* resolve/rust-forever-stack.hxx: Implement it.
gcc/rust/ChangeLog:

	* resolve/rust-early-name-resolver-2.0.cc (Early::finalize_glob_import):
	* resolve/rust-forever-stack.hxx:
	* resolve/rust-name-resolution-context.h:
gcc/rust/ChangeLog:

	* resolve/rust-forever-stack.h: New function.
	* resolve/rust-forever-stack.hxx: Implement it.
	* resolve/rust-late-name-resolver-2.0.cc (Late::visit): Call it if the prelude exists
	and we have an unresolved Identifier Call it if the prelude exists and we have an unresolved Identifier.
This commit adds a new visitor in charge of checking whether
a #[prelude_import] already exists or whether one is required - and which
one. For example, in #[no_std] environments, we will want to use the
`core` prelude rather than the `std` one - furthermore, the prelude is
dependent on the Rust edition.

gcc/rust/ChangeLog:

	* resolve/rust-std-prelude.cc: New file.
	* resolve/rust-std-prelude.h: New file.
	* Make-lang.in: Compile it.
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