File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ Attributes may be applied to many things in the language:
49
49
* [ Match expression arms] [ match expressions ] accept outer attributes.
50
50
* [ Generic lifetime or type parameter] [ generics ] accept outer attributes.
51
51
52
- An example of attributes:
52
+ Some examples of attributes:
53
53
54
54
``` rust
55
55
// General metadata applied to the enclosing module or crate.
@@ -70,6 +70,15 @@ mod bar {
70
70
// A lint attribute used to suppress a warning/error
71
71
#[allow(non_camel_case_types)]
72
72
type int8_t = i8 ;
73
+
74
+ // Outer attribute applies to the entire function.
75
+ fn some_unused_variables () {
76
+ #![allow(unused_variables)]
77
+
78
+ let x = ();
79
+ let y = ();
80
+ let z = ();
81
+ }
73
82
```
74
83
75
84
The rest of this page describes or links to descriptions of which attribute
You can’t perform that action at this time.
0 commit comments