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
Commit the compiler to disable the unused arguments lint
This solves a paper cut with naked functions that the compiler would mark all
arguments as unused, forcing the developer to either disable the lint or
prefix all arguments with '_'.
Copy file name to clipboardExpand all lines: text/0000-constrained-naked.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,7 @@ A naked function is identified by the `#[naked]` attribute and:
32
32
In exchange for the above constraints, the compiler commits to:
33
33
1. produce a clear error if any of the above requirements are violated.
34
34
1. produce a clear warning if any of the above suggestions are not heeded.
35
+
1. disable the unused argument lint for the function.
35
36
1. never inline the function (implicit `#[inline(never)]`).
36
37
1. emit no additional instructions to the function body before the `asm!()` statement.
37
38
@@ -119,7 +120,7 @@ All languages represented here follow the weaker definition of naked functions:
119
120
120
121
# Unresolved questions
121
122
122
-
Due to the definition of naked functions, the arguments will always be flagged as unused. Should we consider adding `#[used]` implicitly to all arguments?
0 commit comments