You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a81098a
Browse filesBrowse the repository at this point in the historyBrowse files
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)
error[E0658]: attributes on expressions are experimental
2
+
--> $DIR/offload_kernel_illegal.rs:9:5
3
+
|
4
+
LL | #[core::offload::offload_kernel]
5
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
+
|
7
+
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
8
+
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
9
+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
10
+
11
+
error[E0658]: macro attributes on statements are unstable
12
+
--> $DIR/offload_kernel_illegal.rs:4:5
13
+
|
14
+
LL | #[core::offload::offload_kernel]
15
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16
+
|
17
+
= note: see issue #54727 <https://github.com/rust-lang/rust/issues/54727> for more information
18
+
= help: add `#![feature(proc_macro_hygiene)]` to the crate attributes to enable
19
+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
20
+
21
+
error: offload_kernel must be applied to function
22
+
--> $DIR/offload_kernel_illegal.rs:6:5
23
+
|
24
+
LL | let mut x = 5;
25
+
| ^^^^^^^^^^^^^^
26
+
27
+
error[E0658]: macro attributes on expressions are unstable
28
+
--> $DIR/offload_kernel_illegal.rs:9:5
29
+
|
30
+
LL | #[core::offload::offload_kernel]
31
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32
+
|
33
+
= note: see issue #54727 <https://github.com/rust-lang/rust/issues/54727> for more information
34
+
= help: add `#![feature(proc_macro_hygiene)]` to the crate attributes to enable
35
+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
36
+
37
+
error: offload_kernel must be applied to function
38
+
--> $DIR/offload_kernel_illegal.rs:10:5
39
+
|
40
+
LL | x = x + 3;
41
+
| ^
42
+
43
+
error[E0658]: macro attributes on statements are unstable
44
+
--> $DIR/offload_kernel_illegal.rs:15:5
45
+
|
46
+
LL | #[core::offload::offload_kernel]
47
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48
+
|
49
+
= note: see issue #54727 <https://github.com/rust-lang/rust/issues/54727> for more information
50
+
= help: add `#![feature(proc_macro_hygiene)]` to the crate attributes to enable
51
+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
52
+
53
+
error: offload_kernel must be applied to function
54
+
--> $DIR/offload_kernel_illegal.rs:17:5
55
+
|
56
+
LL | let add_one_v2 = |x: u32| -> u32 { x + 1 };
57
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
58
+
59
+
error: aborting due to 7 previous errors
60
+
61
+
For more information about this error, try `rustc --explain E0658`.
0 commit comments