@@ -129,7 +129,7 @@ declare_clippy_lint! {
129
129
/// a valid semver. Failing that, the contained information is useless.
130
130
///
131
131
/// ### Example
132
- /// ```rust
132
+ /// ```no_run
133
133
/// #[deprecated(since = "forever")]
134
134
/// fn something_else() { /* ... */ }
135
135
/// ```
@@ -156,14 +156,14 @@ declare_clippy_lint! {
156
156
/// currently works for basic cases but is not perfect.
157
157
///
158
158
/// ### Example
159
- /// ```rust
159
+ /// ```no_run
160
160
/// #[allow(dead_code)]
161
161
///
162
162
/// fn not_quite_good_code() { }
163
163
/// ```
164
164
///
165
165
/// Use instead:
166
- /// ```rust
166
+ /// ```no_run
167
167
/// // Good (as inner attribute)
168
168
/// #![allow(dead_code)]
169
169
///
@@ -198,25 +198,25 @@ declare_clippy_lint! {
198
198
/// Does not detect empty lines after doc attributes (e.g. `#[doc = ""]`).
199
199
///
200
200
/// ### Example
201
- /// ```rust
201
+ /// ```no_run
202
202
/// /// Some doc comment with a blank line after it.
203
203
///
204
204
/// fn not_quite_good_code() { }
205
205
/// ```
206
206
///
207
207
/// Use instead:
208
- /// ```rust
208
+ /// ```no_run
209
209
/// /// Good (no blank line)
210
210
/// fn this_is_fine() { }
211
211
/// ```
212
212
///
213
- /// ```rust
213
+ /// ```no_run
214
214
/// // Good (convert to a regular comment)
215
215
///
216
216
/// fn this_is_fine_too() { }
217
217
/// ```
218
218
///
219
- /// ```rust
219
+ /// ```no_run
220
220
/// //! Good (convert to a comment on an inner attribute)
221
221
///
222
222
/// fn this_is_fine_as_well() { }
@@ -236,12 +236,12 @@ declare_clippy_lint! {
236
236
/// These lints should only be enabled on a lint-by-lint basis and with careful consideration.
237
237
///
238
238
/// ### Example
239
- /// ```rust
239
+ /// ```no_run
240
240
/// #![deny(clippy::restriction)]
241
241
/// ```
242
242
///
243
243
/// Use instead:
244
- /// ```rust
244
+ /// ```no_run
245
245
/// #![deny(clippy::as_conversions)]
246
246
/// ```
247
247
#[ clippy:: version = "1.47.0" ]
@@ -265,13 +265,13 @@ declare_clippy_lint! {
265
265
/// [#3123](https://github.com/rust-lang/rust-clippy/pull/3123#issuecomment-422321765)
266
266
///
267
267
/// ### Example
268
- /// ```rust
268
+ /// ```no_run
269
269
/// #[cfg_attr(rustfmt, rustfmt_skip)]
270
270
/// fn main() { }
271
271
/// ```
272
272
///
273
273
/// Use instead:
274
- /// ```rust
274
+ /// ```no_run
275
275
/// #[rustfmt::skip]
276
276
/// fn main() { }
277
277
/// ```
@@ -290,13 +290,13 @@ declare_clippy_lint! {
290
290
/// by the conditional compilation engine.
291
291
///
292
292
/// ### Example
293
- /// ```rust
293
+ /// ```no_run
294
294
/// #[cfg(linux)]
295
295
/// fn conditional() { }
296
296
/// ```
297
297
///
298
298
/// Use instead:
299
- /// ```rust
299
+ /// ```no_run
300
300
/// # mod hidden {
301
301
/// #[cfg(target_os = "linux")]
302
302
/// fn conditional() { }
@@ -325,14 +325,14 @@ declare_clippy_lint! {
325
325
/// ensure that others understand the reasoning
326
326
///
327
327
/// ### Example
328
- /// ```rust
328
+ /// ```no_run
329
329
/// #![feature(lint_reasons)]
330
330
///
331
331
/// #![allow(clippy::some_lint)]
332
332
/// ```
333
333
///
334
334
/// Use instead:
335
- /// ```rust
335
+ /// ```no_run
336
336
/// #![feature(lint_reasons)]
337
337
///
338
338
/// #![allow(clippy::some_lint, reason = "False positive rust-lang/rust-clippy#1002020")]
@@ -352,7 +352,7 @@ declare_clippy_lint! {
352
352
/// panicking with the expected message, and not another unrelated panic.
353
353
///
354
354
/// ### Example
355
- /// ```rust
355
+ /// ```no_run
356
356
/// fn random() -> i32 { 0 }
357
357
///
358
358
/// #[should_panic]
@@ -363,7 +363,7 @@ declare_clippy_lint! {
363
363
/// ```
364
364
///
365
365
/// Use instead:
366
- /// ```rust
366
+ /// ```no_run
367
367
/// fn random() -> i32 { 0 }
368
368
///
369
369
/// #[should_panic = "attempt to divide by zero"]
@@ -386,13 +386,13 @@ declare_clippy_lint! {
386
386
/// If there is only one condition, no need to wrap it into `any` or `all` combinators.
387
387
///
388
388
/// ### Example
389
- /// ```rust
389
+ /// ```no_run
390
390
/// #[cfg(any(unix))]
391
391
/// pub struct Bar;
392
392
/// ```
393
393
///
394
394
/// Use instead:
395
- /// ```rust
395
+ /// ```no_run
396
396
/// #[cfg(unix)]
397
397
/// pub struct Bar;
398
398
/// ```
@@ -412,13 +412,13 @@ declare_clippy_lint! {
412
412
/// may cause conditional compilation not work quitely.
413
413
///
414
414
/// ### Example
415
- /// ```rust
415
+ /// ```no_run
416
416
/// #[cfg(features = "some-feature")]
417
417
/// fn conditional() { }
418
418
/// ```
419
419
///
420
420
/// Use instead:
421
- /// ```rust
421
+ /// ```no_run
422
422
/// #[cfg(feature = "some-feature")]
423
423
/// fn conditional() { }
424
424
/// ```
0 commit comments