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

Rollup of 4 pull requests #139460

Closed
wants to merge 12 commits into from
Closed

Conversation

Zalathar
Copy link
Contributor

@Zalathar Zalathar commented Apr 7, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Zalathar and others added 12 commits April 6, 2025 13:55
- fix errors caused by the move of `ast::Item::ident` (see rust-lang#138740)
- move the logic of getting `sig`, `vis`, and `ident` from two seperate
  `match` statements into one (less repetition especially with the
  nested `match`)
Verify that the expanded `inline` and `rustc_autodiff` macros are not
duplicated.
This can happen when invalid syntax is passed to a declarative macro. We
shouldn't be too strict about the token stream position once the parser
has rejected the invalid syntax.

Fixes rust-lang#139248 and rust-lang#139445.
…ZuseZ4

fix usage of `autodiff` macro with inner functions

This PR adds additional handling into the expansion step of the `std::autodiff` macro (in `compiler/rustc_builtin_macros/src/autodiff.rs`), which allows the macro to be applied to inner functions.

```rust
#![feature(autodiff)]
use std::autodiff::autodiff;

fn main() {
    #[autodiff(d_inner, Forward, Dual, DualOnly)]
    fn inner(x: f32) -> f32 {
        x * x
    }
}
```

Previously, the compiler didn't allow this due to only handling `Annotatable::Item` and `Annotatable::AssocItem` and missing the handling of `Annotatable::Stmt`. This resulted in the rather generic error

```
error: autodiff must be applied to function
 --> src/main.rs:6:5
  |
6 | /     fn inner(x: f32) -> f32 {
7 | |         x * x
8 | |     }
  | |_____^

error: could not compile `enzyme-test` (bin "enzyme-test") due to 1 previous error
```

This issue was originally reported [here](EnzymeAD#184).

Quick question: would it make sense to add a ui test to ensure there is no regression on this?
This is my first contribution, so I'm extra grateful for any piece of feedback!! :D

r? `@oli-obk`

Tracking issue for autodiff: rust-lang#124509
coverage: Deal with unused functions and their names in one place

When coverage codegen creates dummy instances and covfun records for unused functions, we already know that they are unused, so we might as well set up the special array of unused function names at the same time.

---

The first commit only moves code around; all significant changes are in the second commit.

There should be no change in compiler output.
…nkov

Allow for missing invisible close delim when reparsing an expression.

This can happen when invalid syntax is passed to a declarative macro. We shouldn't be too strict about the token stream position once the parser has rejected the invalid syntax.

Fixes rust-lang#139248.

r? `@petrochenkov`

---
try-job: test-various
…-new, r=lcnr

Make the UnifyKey and UnifyValue imports non-nightly

Explicitly depend on ena in rustc_type_ir and import types from there.

This is required for rust-analyzer to use the new solver.

r? types
@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. rollup A PR which is a rollup labels Apr 7, 2025
@Zalathar
Copy link
Contributor Author

Zalathar commented Apr 7, 2025

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Apr 7, 2025

📌 Commit 117c898 has been approved by Zalathar

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 Apr 7, 2025
@bors
Copy link
Collaborator

bors commented Apr 7, 2025

⌛ Testing commit 117c898 with merge a80edce...

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 7, 2025
Rollup of 4 pull requests

Successful merges:

 - rust-lang#138314 (fix usage of `autodiff` macro with inner functions)
 - rust-lang#138766 (coverage: Deal with unused functions and their names in one place)
 - rust-lang#139298 (Allow for missing invisible close delim when reparsing an expression.)
 - rust-lang#139426 (Make the UnifyKey and UnifyValue imports non-nightly)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

The job i686-msvc-1 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] rustc_resolve test:false 1.057
error: could not compile `rustc_resolve` (lib)

Caused by:
  process didn't exit successfully: `D:\a\rust\rust\build\bootstrap\debug\rustc 'D:\a\rust\rust\build\bootstrap\debug\rustc' --crate-name rustc_resolve --edition=2024 'compiler\rustc_resolve\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C debug-assertions=on --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=364d779891217a10 -C extra-filename=-4fe23227a711cbfe --out-dir 'D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps' --target i686-pc-windows-msvc -L 'dependency=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps' -L 'dependency=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\release\deps' --extern 'bitflags=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\libbitflags-5612cbab345c0eb2.rmeta' --extern 'itertools=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\libitertools-46110840d6479d16.rmeta' --extern 'pulldown_cmark=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\libpulldown_cmark-b48f29b9c1642af6.rmeta' --extern 'rustc_arena=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_arena-a7834062ec84d298.rmeta' --extern 'rustc_ast=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_ast-d752976382e91c89.rmeta' --extern 'rustc_ast_pretty=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_ast_pretty-f190f7a4862ad6f5.rmeta' --extern 'rustc_attr_parsing=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_attr_parsing-90eb645818c7ed7b.rmeta' --extern 'rustc_data_structures=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_data_structures-20453778b3354153.rmeta' --extern 'rustc_errors=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_errors-50bb70fc46173061.rmeta' --extern 'rustc_expand=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_expand-52f9d76cc922ee37.rmeta' --extern 'rustc_feature=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_feature-906aac8ddd33fb39.rmeta' --extern 'rustc_fluent_macro=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\release\deps\rustc_fluent_macro-de543ce13cf46697.dll' --extern 'rustc_hir=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_hir-ab4ff6c96d3a462e.rmeta' --extern 'rustc_index=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_index-b921b1e6d9cda3ff.rmeta' --extern 'rustc_macros=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\release\deps\rustc_macros-4cc8389b1fc10424.dll' --extern 'rustc_metadata=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_metadata-9527384464bb6ebc.rmeta' --extern 'rustc_middle=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_middle-c751622530971082.rmeta' --extern 'rustc_query_system=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_query_system-48af460e369c55f7.rmeta' --extern 'rustc_session=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_session-3dd143fd8adc19df.rmeta' --extern 'rustc_span=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_span-9573d59c58baf089.rmeta' --extern 'smallvec=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\libsmallvec-2dc292cfd782c917.rmeta' --extern 'thin_vec=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\libthin_vec-c6f1496c7b12f37d.rmeta' --extern 'tracing=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\libtracing-efb5e9badb42a75b.rmeta' --cfg=bootstrap --cfg=windows_raw_dylib -Csymbol-mangling-version=v0 -Zunstable-options '--check-cfg=cfg(bootstrap)' '--check-cfg=cfg(llvm_enzyme)' -Zmacro-backtrace -Csplit-debuginfo=packed -Ctarget-feature=+crt-static -Alinker-messages -Zon-broken-pipe=kill -Z binary-dep-depinfo -L 'native=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\atlmfc\lib\x86' -L 'native=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\build\stacker-8290d4b4240c8f07\out' -L 'native=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\atlmfc\lib\x86' -L 'native=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\build\psm-eee49a435020fb5e\out' -L 'native=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\atlmfc\lib\x86' -L 'native=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\build\blake3-28de8718a0c41167\out'` (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)
warning: build failed, waiting for other jobs to finish...
[RUSTC-TIMING] rustc_mir_transform test:false 221.262
[RUSTC-TIMING] rustc_codegen_llvm test:false 93.141
[RUSTC-TIMING] rustc_borrowck test:false 286.648
Build completed unsuccessfully in 0:29:20
make: *** [Makefile:113: ci-msvc-py] Error 1
  local time: Mon Apr  7 03:06:04 CUT 2025
  network time: Mon, 07 Apr 2025 03:06:04 GMT
##[error]Process completed with exit code 2.
Post job cleanup.
[command]"C:\Program Files\Git\bin\git.exe" version

@bors
Copy link
Collaborator

bors commented Apr 7, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 7, 2025
@jieyouxu
Copy link
Member

jieyouxu commented Apr 7, 2025

2025-04-07T03:05:23.8733518Z �[1m�[31merror�[0m�[1m:�[0m could not compile `rustc_resolve` (lib)
2025-04-07T03:05:23.8735031Z 
2025-04-07T03:05:23.8735556Z Caused by:
2025-04-07T03:05:23.8984140Z   process didn't exit successfully: `D:\a\rust\rust\build\bootstrap\debug\rustc 'D:\a\rust\rust\build\bootstrap\debug\rustc' --crate-name rustc_resolve --edition=2024 'compiler\rustc_resolve\src\lib.rs' --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C debug-assertions=on --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values())' -C metadata=364d779891217a10 -C extra-filename=-4fe23227a711cbfe --out-dir 'D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps' --target i686-pc-windows-msvc -L 'dependency=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps' -L 'dependency=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\release\deps' --extern 'bitflags=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\libbitflags-5612cbab345c0eb2.rmeta' --extern 'itertools=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\libitertools-46110840d6479d16.rmeta' --extern 'pulldown_cmark=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\libpulldown_cmark-b48f29b9c1642af6.rmeta' --extern 'rustc_arena=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_arena-a7834062ec84d298.rmeta' --extern 'rustc_ast=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_ast-d752976382e91c89.rmeta' --extern 'rustc_ast_pretty=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_ast_pretty-f190f7a4862ad6f5.rmeta' --extern 'rustc_attr_parsing=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_attr_parsing-90eb645818c7ed7b.rmeta' --extern 'rustc_data_structures=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_data_structures-20453778b3354153.rmeta' --extern 'rustc_errors=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_errors-50bb70fc46173061.rmeta' --extern 'rustc_expand=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_expand-52f9d76cc922ee37.rmeta' --extern 'rustc_feature=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_feature-906aac8ddd33fb39.rmeta' --extern 'rustc_fluent_macro=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\release\deps\rustc_fluent_macro-de543ce13cf46697.dll' --extern 'rustc_hir=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_hir-ab4ff6c96d3a462e.rmeta' --extern 'rustc_index=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_index-b921b1e6d9cda3ff.rmeta' --extern 'rustc_macros=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\release\deps\rustc_macros-4cc8389b1fc10424.dll' --extern 'rustc_metadata=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_metadata-9527384464bb6ebc.rmeta' --extern 'rustc_middle=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_middle-c751622530971082.rmeta' --extern 'rustc_query_system=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_query_system-48af460e369c55f7.rmeta' --extern 'rustc_session=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_session-3dd143fd8adc19df.rmeta' --extern 'rustc_span=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\librustc_span-9573d59c58baf089.rmeta' --extern 'smallvec=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\libsmallvec-2dc292cfd782c917.rmeta' --extern 'thin_vec=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\libthin_vec-c6f1496c7b12f37d.rmeta' --extern 'tracing=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\deps\libtracing-efb5e9badb42a75b.rmeta' --cfg=bootstrap --cfg=windows_raw_dylib -Csymbol-mangling-version=v0 -Zunstable-options '--check-cfg=cfg(bootstrap)' '--check-cfg=cfg(llvm_enzyme)' -Zmacro-backtrace -Csplit-debuginfo=packed -Ctarget-feature=+crt-static -Alinker-messages -Zon-broken-pipe=kill -Z binary-dep-depinfo -L 'native=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\atlmfc\lib\x86' -L 'native=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\build\stacker-8290d4b4240c8f07\out' -L 'native=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\atlmfc\lib\x86' -L 'native=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\build\psm-eee49a435020fb5e\out' -L 'native=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\atlmfc\lib\x86' -L 'native=D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-rustc\i686-pc-windows-msvc\release\build\blake3-28de8718a0c41167\out'` (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)

@Zalathar
Copy link
Contributor Author

Zalathar commented Apr 7, 2025

(exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)

Given this, and the fact that this failed relatively early, I'm going to retry and cross my fingers:

@bors retry

@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 Apr 7, 2025
@Zalathar
Copy link
Contributor Author

Zalathar commented Apr 7, 2025

Oh the queue already moved on to one of these PRs individually, so better to close.

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 7, 2025
@Zalathar Zalathar closed this Apr 7, 2025
@Zalathar Zalathar deleted the rollup-s3a39sh branch April 7, 2025 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

8 participants