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
Copy file name to clipboardExpand all lines: src/items/extern-crates.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,7 +77,10 @@ r[items.extern-crate.no_link]
77
77
## The `no_link` attribute
78
78
79
79
r[items.extern-crate.no_link.intro]
80
-
The *`no_link`[attribute][attributes]* may be specified on an `extern crate` item to prevent linking the crate into the output. This is commonly used to load a crate to access only its macros.
80
+
The *`no_link`[attribute][attributes]* may be applied to an `extern crate` item to prevent linking the crate.
81
+
82
+
> [!NOTE]
83
+
> This is helpful, e.g., when only the macros of a crate are needed.
81
84
82
85
> [!EXAMPLE]
83
86
> <!-- ignore: requires external crates -->
@@ -89,19 +92,19 @@ The *`no_link` [attribute][attributes]* may be specified on an `extern crate` it
89
92
> ```
90
93
91
94
r[items.extern-crate.no_link.syntax]
92
-
The `no_link` attribute uses the [MetaWord] syntax and thus does not take any inputs.
95
+
The `no_link` attribute uses the [MetaWord] syntax and so does not accept any arguments.
93
96
94
97
r[items.extern-crate.no_link.allowed-positions]
95
-
The `no_link` attribute may be specified on an `extern crate` declaration.
98
+
The `no_link` attribute may only be applied to an `extern crate` declaration.
96
99
97
100
> [!NOTE]
98
-
> `rustc` currently warns on some positions where it is ignored, but this may become an error in the future.
101
+
> `rustc` currently accepts and ignores the attribute in other positions but lints against it. This may become a hard error in the future.
99
102
100
103
r[items.extern-crate.no_link.duplicates]
101
104
Duplicate instances of the `no_link` attribute are ignored.
102
105
103
106
> [!NOTE]
104
-
> `rustc` currently warns about unused duplicate `no_link` attributes.
107
+
> `rustc` lints against duplicate use of this attribute.
0 commit comments