Skip to content

feat: support nested functions with #[offload_kernel] - #163077

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
xkevio:patch-1
Nov 12, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
xkevio:patch-1

Conversation

@xkevio

@xkevio xkevio commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

View all comments

Related to #131513.

Allows annotating nested functions with #[offload_kernel], similar to autodiff.

Also fixes the error message when #[offload_kernel] is used on anything other than functions.

r? @ZuseZ4

(@Sa4dUs, ping)

@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 20, 2026
@rustbot

This comment has been minimized.

@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 20, 2026
@rustbot

rustbot commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

Error: Failed to set assignee to Sa4dUs: invalid assignee

Note: Only org members with at least the repository "read" role, users with write permissions, or people who have commented on the PR may be assigned.

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #triagebot on Zulip.

@xkevio
xkevio marked this pull request as draft September 20, 2026 17:03
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 20, 2026
@xkevio
xkevio marked this pull request as ready for review September 20, 2026 17:28
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. has-merge-commits PR has merge commits, merge with caution. labels Sep 20, 2026
@rust-bors

This comment has been minimized.

@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@xkevio

xkevio commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor Author

I think the test runner just took too long? In any case, I finally had a bit more time for thorough testing and can confirm that it works without issues.

My main goal was to actually enable nested offload functions in main but I only realized after implementing that due to conditional compilation via cfg(target_os), that that might not work as I had hoped ^^

@ZuseZ4

ZuseZ4 commented Oct 24, 2026

Copy link
Copy Markdown
Member

Our CI timeout is after 6hrs iirc, some of our runners regulary take over 3hrs. Just force-push to trigger a rerun, this might be a spurious failure. github CI is often a bit flaky.

@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot

rustbot commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rust-log-analyzer

This comment has been minimized.

@xkevio

xkevio commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

PR is rebased, checks are green and the new unimplemented! expansion is reflected in the tests!

@ZuseZ4

ZuseZ4 commented Nov 6, 2026

Copy link
Copy Markdown
Member

lgtm, minor some code feedback. Can you squash it to one or two commits terwards so the wip/fix comments are gone? There's also a bors command for it if you want.

@xkevio

xkevio commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

@bors squash message="feat: support nested functions with offload_kernel"

@rust-bors

This comment has been minimized.

@rust-bors

rust-bors Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

🔨 9 commits were squashed into c9d7ee0.

Co-authored-by: xkevio <xkeviota@gmail.com>

style: use ecx stmt item method
@ZuseZ4

ZuseZ4 commented Nov 11, 2026

Copy link
Copy Markdown
Member

@bors try jobs=test-various

rust-bors Bot pushed a commit that referenced this pull request Nov 11, 2026
feat: support nested functions with `#[offload_kernel]`


try-job: test-various
@rust-bors

This comment has been minimized.

@rust-bors

rust-bors Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: fdcf720 (fdcf720aeff7feb765efb1f40bf96dc5cfdf822e)
Base parent: 9f5e966 (9f5e966d58e5cdf21160ba12907661b0720e8c69)

@ZuseZ4

ZuseZ4 commented Nov 11, 2026

Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors

rust-bors Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

📌 Commit a6a7cca has been approved by ZuseZ4

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Nov 11, 2026
Zalathar added a commit to Zalathar/rust that referenced this pull request Nov 12, 2026
feat: support nested functions with `#[offload_kernel]`

Related to rust-lang#131513.

Allows annotating nested functions with `#[offload_kernel]`, similar to autodiff.

Also fixes the error message when `#[offload_kernel]` is used on anything other than functions.

r? @ZuseZ4

(@Sa4dUs, ping)
rust-bors Bot pushed a commit that referenced this pull request Nov 12, 2026
Rollup of 6 pull requests

Successful merges:

 - #165778 (Bump stage0 to 1.101.0-beta.1)
 - #163077 (feat: support nested functions with `#[offload_kernel]`)
 - #165578 (Avoid `Hash::hash` when stable-hashing various types)
 - #165729 (tests: Add regression test for infinite recursive dereference)
 - #165819 (Avoid redundant scans when extracting stage0 archives)
 - #165822 (Remove unused compiler modules and types)
Zalathar added a commit to Zalathar/rust that referenced this pull request Nov 12, 2026
feat: support nested functions with `#[offload_kernel]`

Related to rust-lang#131513.

Allows annotating nested functions with `#[offload_kernel]`, similar to autodiff.

Also fixes the error message when `#[offload_kernel]` is used on anything other than functions.

r? @ZuseZ4

(@Sa4dUs, ping)
rust-bors Bot pushed a commit that referenced this pull request Nov 12, 2026
Rollup of 12 pull requests

Successful merges:

 - #165804 (cg_llvm: Use an invariant lifetime brand for LLVM values)
 - #165778 (Bump stage0 to 1.101.0-beta.1)
 - #165412 (Implement `core::ops::FnAddr`)
 - #165487 (Migrate built-in macros `pattern_type` & `view_type` to macros 2.0 that expand to internal syntax)
 - #165818 (do not lint `redundant_lifetimes` on items from external macros)
 - #163077 (feat: support nested functions with `#[offload_kernel]`)
 - #164795 (Extend support of lint `explicit_outlives_requirements` to checked type aliases)
 - #165578 (Avoid `Hash::hash` when stable-hashing various types)
 - #165729 (tests: Add regression test for infinite recursive dereference)
 - #165819 (Avoid redundant scans when extracting stage0 archives)
 - #165822 (Remove unused compiler modules and types)
 - #165824 (Add regression test for HRTB projection bound with TryFrom error)
rust-bors Bot pushed a commit that referenced this pull request Nov 12, 2026
Rollup of 11 pull requests

Successful merges:

 - #165804 (cg_llvm: Use an invariant lifetime brand for LLVM values)
 - #165778 (Bump stage0 to 1.101.0-beta.1)
 - #165412 (Implement `core::ops::FnAddr`)
 - #165487 (Migrate built-in macros `pattern_type` & `view_type` to macros 2.0 that expand to internal syntax)
 - #165818 (do not lint `redundant_lifetimes` on items from external macros)
 - #163077 (feat: support nested functions with `#[offload_kernel]`)
 - #164795 (Extend support of lint `explicit_outlives_requirements` to checked type aliases)
 - #165578 (Avoid `Hash::hash` when stable-hashing various types)
 - #165729 (tests: Add regression test for infinite recursive dereference)
 - #165822 (Remove unused compiler modules and types)
 - #165824 (Add regression test for HRTB projection bound with TryFrom error)
@rust-bors
rust-bors Bot merged commit a81098a into rust-lang:main Nov 12, 2026
15 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 12, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 12, 2026
Rollup merge of #163077 - xkevio:patch-1, r=ZuseZ4

feat: support nested functions with `#[offload_kernel]`

Related to #131513.

Allows annotating nested functions with `#[offload_kernel]`, similar to autodiff.

Also fixes the error message when `#[offload_kernel]` is used on anything other than functions.

r? @ZuseZ4

(@Sa4dUs, ping)
bjorn3 pushed a commit to rust-lang/rustc_codegen_cranelift that referenced this pull request Nov 13, 2026
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#165804 (cg_llvm: Use an invariant lifetime brand for LLVM values)
 - rust-lang/rust#165778 (Bump stage0 to 1.101.0-beta.1)
 - rust-lang/rust#165412 (Implement `core::ops::FnAddr`)
 - rust-lang/rust#165487 (Migrate built-in macros `pattern_type` & `view_type` to macros 2.0 that expand to internal syntax)
 - rust-lang/rust#165818 (do not lint `redundant_lifetimes` on items from external macros)
 - rust-lang/rust#163077 (feat: support nested functions with `#[offload_kernel]`)
 - rust-lang/rust#164795 (Extend support of lint `explicit_outlives_requirements` to checked type aliases)
 - rust-lang/rust#165578 (Avoid `Hash::hash` when stable-hashing various types)
 - rust-lang/rust#165729 (tests: Add regression test for infinite recursive dereference)
 - rust-lang/rust#165822 (Remove unused compiler modules and types)
 - rust-lang/rust#165824 (Add regression test for HRTB projection bound with TryFrom error)
mehmettoplu-rs pushed a commit to mehmettoplu-rs/miri that referenced this pull request Nov 13, 2026
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#165804 (cg_llvm: Use an invariant lifetime brand for LLVM values)
 - rust-lang/rust#165778 (Bump stage0 to 1.101.0-beta.1)
 - rust-lang/rust#165412 (Implement `core::ops::FnAddr`)
 - rust-lang/rust#165487 (Migrate built-in macros `pattern_type` & `view_type` to macros 2.0 that expand to internal syntax)
 - rust-lang/rust#165818 (do not lint `redundant_lifetimes` on items from external macros)
 - rust-lang/rust#163077 (feat: support nested functions with `#[offload_kernel]`)
 - rust-lang/rust#164795 (Extend support of lint `explicit_outlives_requirements` to checked type aliases)
 - rust-lang/rust#165578 (Avoid `Hash::hash` when stable-hashing various types)
 - rust-lang/rust#165729 (tests: Add regression test for infinite recursive dereference)
 - rust-lang/rust#165822 (Remove unused compiler modules and types)
 - rust-lang/rust#165824 (Add regression test for HRTB projection bound with TryFrom error)
folkertdev pushed a commit to folkertdev/stdarch that referenced this pull request Nov 16, 2026
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#165804 (cg_llvm: Use an invariant lifetime brand for LLVM values)
 - rust-lang/rust#165778 (Bump stage0 to 1.101.0-beta.1)
 - rust-lang/rust#165412 (Implement `core::ops::FnAddr`)
 - rust-lang/rust#165487 (Migrate built-in macros `pattern_type` & `view_type` to macros 2.0 that expand to internal syntax)
 - rust-lang/rust#165818 (do not lint `redundant_lifetimes` on items from external macros)
 - rust-lang/rust#163077 (feat: support nested functions with `#[offload_kernel]`)
 - rust-lang/rust#164795 (Extend support of lint `explicit_outlives_requirements` to checked type aliases)
 - rust-lang/rust#165578 (Avoid `Hash::hash` when stable-hashing various types)
 - rust-lang/rust#165729 (tests: Add regression test for infinite recursive dereference)
 - rust-lang/rust#165822 (Remove unused compiler modules and types)
 - rust-lang/rust#165824 (Add regression test for HRTB projection bound with TryFrom error)
mehmettoplu-rs pushed a commit to mehmettoplu-rs/rustc_codegen_gcc that referenced this pull request Nov 22, 2026
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#165804 (cg_llvm: Use an invariant lifetime brand for LLVM values)
 - rust-lang/rust#165778 (Bump stage0 to 1.101.0-beta.1)
 - rust-lang/rust#165412 (Implement `core::ops::FnAddr`)
 - rust-lang/rust#165487 (Migrate built-in macros `pattern_type` & `view_type` to macros 2.0 that expand to internal syntax)
 - rust-lang/rust#165818 (do not lint `redundant_lifetimes` on items from external macros)
 - rust-lang/rust#163077 (feat: support nested functions with `#[offload_kernel]`)
 - rust-lang/rust#164795 (Extend support of lint `explicit_outlives_requirements` to checked type aliases)
 - rust-lang/rust#165578 (Avoid `Hash::hash` when stable-hashing various types)
 - rust-lang/rust#165729 (tests: Add regression test for infinite recursive dereference)
 - rust-lang/rust#165822 (Remove unused compiler modules and types)
 - rust-lang/rust#165824 (Add regression test for HRTB projection bound with TryFrom error)
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.

4 participants