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
description: An Amplification is a chance to expand or clarify the Guideline's Title. Optional as needed. Normative. Rationale should not be entered here, but below in Rationale.
126
-
placeholder: In particular, it's important to not `foo` when `bar` under typical conditions of `baz`
124
+
description: |
125
+
An Amplification is a chance to expand or clarify the Guideline's Title. Optional as needed. Normative. Rationale should not be entered here, but below in Rationale.
126
+
127
+
**Citing references:** To cite a bibliography entry, use `[CITATION-KEY]` syntax (e.g., `[RUST-REF-UNION]`). These will be automatically linked to your bibliography entries.
128
+
placeholder: |
129
+
In particular, it's important to not `foo` when `bar` under typical conditions of `baz`.
130
+
131
+
As documented in [RUST-REF-UNION], this behavior is undefined.
127
132
validations:
128
133
required: false
129
134
- type: textarea
@@ -138,39 +143,291 @@ body:
138
143
id: rationale
139
144
attributes:
140
145
label: Rationale
141
-
description: Here we explain the why of this Coding Guideline. Should be as long or as short as needed. Non-normative.
142
-
placeholder: As documented in the below reference, we see that under conditions `baz` if we `foo` when `bar`-ing we encounter suprising behavior `biz`. ...
146
+
description: |
147
+
Here we explain the why of this Coding Guideline. Should be as long or as short as needed. Non-normative.
148
+
149
+
**Citing references:** To cite a bibliography entry, use `[CITATION-KEY]` syntax (e.g., `[RUST-REF-UNION]`). These will be automatically linked to your bibliography entries.
150
+
placeholder: |
151
+
As documented in the below reference, we see that under conditions `baz` if we `foo` when `bar`-ing we encounter surprising behavior `biz`.
152
+
153
+
The Rust Reference [RUST-REF-UNION] explains this in detail.
Provide at least one non-compliant example. You may add up to 4 total.
145
167
- type: textarea
146
-
id: non-compliant-example-prose
168
+
id: non-compliant-example-prose-1
147
169
attributes:
148
-
label: Non-Compliant Example - Prose
170
+
label: Non-Compliant Example 1 - Prose
149
171
description: Here we write a textual description of why the Non-Compliant Example - Code exhibits unintended or consequential behavior. Non-normative.
150
172
placeholder: As seen below in the `non_compliant_example()` function, when `baz` and `bar` are both active and we `foo`, later during refactoring it's possible to get `biz` instead of `boz` behavior. ...
151
173
validations:
152
174
required: true
153
175
- type: textarea
154
-
id: non-compliant-example-code
176
+
id: non-compliant-example-code-1
155
177
attributes:
156
-
label: Non-Compliant Example - Code
157
-
description: Here we write a code example showcasing the unintended or consequential behavior. Non-normative.
Code example showcasing the unintended or consequential behavior. Non-normative. Please wrap your code in a fenced code block with the `rust` language specifier.
181
+
182
+
**Hidden lines:** If your code needs `use` statements, a `fn main()` wrapper, or other boilerplate to compile, but you don't want them shown in the documentation, prefix those lines with `# ` (hash + space). These lines will be compiled but hidden in the rendered docs.
183
+
184
+
Example with hidden lines:
185
+
````
186
+
```rust
187
+
# use std::mem::MaybeUninit;
188
+
# fn main() {
189
+
let x: u32 = unsafe { MaybeUninit::uninit().assume_init() }; // UB
Provide at least one compliant example. You may add up to 4 total.
288
+
- type: textarea
289
+
id: compliant-example-prose-1
290
+
attributes:
291
+
label: Compliant Example 1 - Prose
165
292
description: Here we write a textual description of why the Compliant Example - Code avoids unintended or consequential behavior by following the Coding Guideline.
166
293
placeholder: As seen below in the `compliant_example()` function, when `baz` and `bar` are both active and we avoid doing `foo`, later during refactoring we've prevented an error by construction. ...
167
294
validations:
168
295
required: true
169
296
- type: textarea
170
-
id: compliant-example-code
297
+
id: compliant-example-code-1
171
298
attributes:
172
-
label: Compliant Example - Code
173
-
description: Here we write a code example showcasing we avoid unintended or consequential behavior by following the Coding Guideline.
174
-
placeholder: fn compliant_example() { /* ... */ }
299
+
label: Compliant Example 1 - Code
300
+
description: |
301
+
Code example showcasing we avoid unintended or consequential behavior by following the Coding Guideline. Please wrap your code in a fenced code block with the `rust` language specifier.
302
+
303
+
**Hidden lines:** If your code needs `use` statements, a `fn main()` wrapper, or other boilerplate to compile, but you don't want them shown in the documentation, prefix those lines with `# ` (hash + space). These lines will be compiled but hidden in the rendered docs.
0 commit comments