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

Merged
merged 2 commits into from
Sep 22, 2024

Conversation

dianne
Copy link
Contributor

@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
@bors
Copy link
Contributor

bors commented Sep 22, 2024

⌛ Testing commit a187d0a with merge 6ce3767...

@bors
Copy link
Contributor

bors commented Sep 22, 2024

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing 6ce3767 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 22, 2024
@bors bors merged commit 6ce3767 into rust-lang:master Sep 22, 2024
7 checks passed
@rustbot rustbot added this to the 1.83.0 milestone Sep 22, 2024
@dianne dianne deleted the issue-97589-fix branch September 22, 2024 05:43
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (6ce3767): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary 3.0%, secondary 0.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.0% [3.0%, 3.0%] 1
Regressions ❌
(secondary)
3.6% [3.6%, 3.6%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.4% [-3.4%, -3.4%] 1
All ❌✅ (primary) 3.0% [3.0%, 3.0%] 1

Cycles

Results (primary -1.1%, secondary 4.0%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.0% [4.0%, 4.0%] 1
Improvements ✅
(primary)
-1.1% [-1.1%, -1.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.1% [-1.1%, -1.1%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 769.437s -> 769.289s (-0.02%)
Artifact size: 341.48 MiB -> 341.54 MiB (0.02%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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
7 participants