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

rustc_expand: remember module #[path]s during expansion #130246

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

Conversation

dianne
Copy link

@dianne dianne commented Sep 11, 2024

During invocation collection, if a module item parsed from a #[path] attribute needed a second pass after parsing, its path wouldn't get added to the file path stack, so cycle detection broke. This checks the #[path] in such cases, so that it gets added appropriately. I think it should work identically to the case for external modules that don't need a second pass, but I'm not 100% sure.

Fixes #97589

this fixes cycle detection for modules that need a second invocation collection pass after parsing
@rustbot
Copy link
Collaborator

rustbot commented Sep 11, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @fee1-dead (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 11, 2024
@jieyouxu
Copy link
Member

This probably wants @petrochenkov to double check, so
r? @petrochenkov

@rustbot rustbot assigned petrochenkov and unassigned fee1-dead Sep 11, 2024
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Sep 21, 2024

📌 Commit a187d0a has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 21, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 21, 2024
…nkov

rustc_expand: remember module `#[path]`s during expansion

During invocation collection, if a module item parsed from a `#[path]` attribute needed a second pass after parsing, its path wouldn't get added to the file path stack, so cycle detection broke. This checks the `#[path]` in such cases, so that it gets added appropriately. I think it should work identically to the case for external modules that don't need a second pass, but I'm not 100% sure.

Fixes rust-lang#97589
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 21, 2024
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#127766 (add `extern "C-cmse-nonsecure-entry" fn` )
 - rust-lang#129629 (Implement Return Type Notation (RTN)'s path form in where clauses)
 - rust-lang#130246 (rustc_expand: remember module `#[path]`s during expansion)
 - rust-lang#130408 (Avoid re-validating UTF-8 in `FromUtf8Error::into_utf8_lossy`)
 - rust-lang#130651 (Add --enable-profiler to armhf dist)
 - rust-lang#130653 (ABI compatibility: mention Result guarantee)
 - rust-lang#130665 (Prevent Deduplication of `LongRunningWarn`)
 - rust-lang#130666 (Assert that `explicit_super_predicates_of` and `explicit_item_super_predicates` truly only contains bounds for the type itself)
 - rust-lang#130667 (compiler: Accept "improper" ctypes in extern "rust-cold" fn)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustc segmentation fault with circular module
6 participants