Skip to content

Commit 987ab56

Browse files
committed
Update windows_subsystem to use the attribute template
1 parent 080aa1e commit 987ab56

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/runtime.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,27 @@ r[runtime.windows_subsystem]
1313
## The `windows_subsystem` attribute
1414

1515
r[runtime.windows_subsystem.intro]
16-
The *`windows_subsystem` attribute* may be applied at the crate level to set the [subsystem] when linking on a Windows target.
16+
The *`windows_subsystem` [attribute][attributes]* sets the [subsystem] when linking on a Windows target.
1717

1818
> [!EXAMPLE]
1919
> ```rust
2020
> #![windows_subsystem = "windows"]
2121
> ```
2222
2323
r[runtime.windows_subsystem.syntax]
24-
It uses the [MetaNameValueStr] syntax to specify the subsystem with a value of either `console` or `windows`.
24+
The `windows_subsystem` attribute uses the [MetaNameValueStr] syntax to specify the subsystem with a value of either `console` or `windows`.
25+
26+
r[runtime.windows_subsystem.allowed-positions]
27+
The `windows_subsystem` attribute may only be applied to the crate root.
28+
29+
r[runtime.windows_subsystem.duplicates]
30+
Only the first instance of `windows_subsystem` on an item is honored. Subsequent `example` attributes are ignored.
31+
32+
> [!NOTE]
33+
> `rustc` currently warns on subsequent duplicate `example` attributes. This may become an error in the future.
2534
2635
r[runtime.windows_subsystem.ignored]
27-
This attribute is ignored on non-Windows targets, and for non-`bin` [crate types].
36+
The `windows_subsystem` attribute is ignored on non-Windows targets, and for non-`bin` [crate types].
2837
2938
r[runtime.windows_subsystem.console]
3039
The "console" subsystem is the default. If a console process is run from an existing console then it will be attached to that console, otherwise a new console window will be created.

0 commit comments

Comments
 (0)