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/runtime.md
+21-13Lines changed: 21 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,28 +13,36 @@ r[runtime.windows_subsystem]
13
13
## The `windows_subsystem` attribute
14
14
15
15
r[runtime.windows_subsystem.intro]
16
-
The *`windows_subsystem` attribute* may be applied at the crate level to set
17
-
the [subsystem] when linking on a Windows target.
16
+
The *`windows_subsystem`[attribute][attributes]* sets the [subsystem] when linking on a Windows target.
17
+
18
+
> [!EXAMPLE]
19
+
> ```rust
20
+
> #![windows_subsystem ="windows"]
21
+
> ```
18
22
19
23
r[runtime.windows_subsystem.syntax]
20
-
It uses the [MetaNameValueStr] syntax to specify the subsystem with a value of either
21
-
`console` or `windows`.
24
+
The `windows_subsystem` attributeusesthe [MetaNameValueStr] syntax.Acceptedvaluesare `"console"` and `"windows"`.
25
+
26
+
r[runtime.windows_subsystem.allowed-positions]
27
+
The `windows_subsystem` attributemayonlybeappliedtothecrateroot.
28
+
29
+
r[runtime.windows_subsystem.duplicates]
30
+
Onlythefirstuse of `windows_subsystem` is honored.
31
+
32
+
> [!NOTE]
33
+
> `rustc` currently lints against uses following the first.This may become a hard error in the future.
22
34
23
35
r[runtime.windows_subsystem.ignored]
24
-
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 non-`bin` [crate types].
25
37
26
38
r[runtime.windows_subsystem.console]
27
-
The "console" subsystem is the default. If a console process is run from an
28
-
existing console then it will be attached to that console, otherwise a new
29
-
console window will be created.
39
+
The `"console"` subsystem is the default.If a console process is run from an existing console then it will be attached to that console; otherwiseanewconsolewindowwillbecreated.
30
40
31
41
r[runtime.windows_subsystem.windows]
32
-
The "windows" subsystem is commonly used by GUI applications that do not want to
33
-
display a console window on startup. It will run detached from any existing console.
42
+
The `"windows"` subsystemwillrundetachedfromanyexistingconsole.
34
43
35
-
```rust
36
-
#![windows_subsystem ="windows"]
37
-
```
44
+
> [!NOTE]
45
+
> The `"windows"` subsystemiscommonlyusedbyGUIapplicationsthatdonotwanttodisplayaconsolewindowonstartup.
0 commit comments