We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ae26723 + 5ad4901 commit c9be624Copy full SHA for c9be624
src/doc/unstable-book/src/language-features/param-attrs.md
@@ -0,0 +1,27 @@
1
+# `param_attrs`
2
+
3
+The tracking issue for this feature is: [#60406]
4
5
+[#60406]: https://github.com/rust-lang/rust/issues/60406
6
7
+Allow attributes in formal function parameter position so external tools and compiler internals can
8
+take advantage of the additional information that the parameters provide.
9
10
+Enables finer conditional compilation with `#[cfg(..)]` and linting control of variables. Moreover,
11
+opens the path to richer DSLs created by users.
12
13
+------------------------
14
15
+Example:
16
17
+```rust
18
+#![feature(param_attrs)]
19
20
+fn len(
21
+ #[cfg(windows)] slice: &[u16],
22
+ #[cfg(not(windows))] slice: &[u8],
23
+) -> usize
24
+{
25
+ slice.len()
26
+}
27
+```
0 commit comments