@@ -129,7 +129,7 @@ declare_clippy_lint! {
129129 /// a valid semver. Failing that, the contained information is useless.
130130 ///
131131 /// ### Example
132- /// ```rust
132+ /// ```no_run
133133 /// #[deprecated(since = "forever")]
134134 /// fn something_else() { /* ... */ }
135135 /// ```
@@ -156,14 +156,14 @@ declare_clippy_lint! {
156156 /// currently works for basic cases but is not perfect.
157157 ///
158158 /// ### Example
159- /// ```rust
159+ /// ```no_run
160160 /// #[allow(dead_code)]
161161 ///
162162 /// fn not_quite_good_code() { }
163163 /// ```
164164 ///
165165 /// Use instead:
166- /// ```rust
166+ /// ```no_run
167167 /// // Good (as inner attribute)
168168 /// #![allow(dead_code)]
169169 ///
@@ -198,25 +198,25 @@ declare_clippy_lint! {
198198 /// Does not detect empty lines after doc attributes (e.g. `#[doc = ""]`).
199199 ///
200200 /// ### Example
201- /// ```rust
201+ /// ```no_run
202202 /// /// Some doc comment with a blank line after it.
203203 ///
204204 /// fn not_quite_good_code() { }
205205 /// ```
206206 ///
207207 /// Use instead:
208- /// ```rust
208+ /// ```no_run
209209 /// /// Good (no blank line)
210210 /// fn this_is_fine() { }
211211 /// ```
212212 ///
213- /// ```rust
213+ /// ```no_run
214214 /// // Good (convert to a regular comment)
215215 ///
216216 /// fn this_is_fine_too() { }
217217 /// ```
218218 ///
219- /// ```rust
219+ /// ```no_run
220220 /// //! Good (convert to a comment on an inner attribute)
221221 ///
222222 /// fn this_is_fine_as_well() { }
@@ -236,12 +236,12 @@ declare_clippy_lint! {
236236 /// These lints should only be enabled on a lint-by-lint basis and with careful consideration.
237237 ///
238238 /// ### Example
239- /// ```rust
239+ /// ```no_run
240240 /// #![deny(clippy::restriction)]
241241 /// ```
242242 ///
243243 /// Use instead:
244- /// ```rust
244+ /// ```no_run
245245 /// #![deny(clippy::as_conversions)]
246246 /// ```
247247 #[ clippy:: version = "1.47.0" ]
@@ -265,13 +265,13 @@ declare_clippy_lint! {
265265 /// [#3123](https://github.com/rust-lang/rust-clippy/pull/3123#issuecomment-422321765)
266266 ///
267267 /// ### Example
268- /// ```rust
268+ /// ```no_run
269269 /// #[cfg_attr(rustfmt, rustfmt_skip)]
270270 /// fn main() { }
271271 /// ```
272272 ///
273273 /// Use instead:
274- /// ```rust
274+ /// ```no_run
275275 /// #[rustfmt::skip]
276276 /// fn main() { }
277277 /// ```
@@ -290,13 +290,13 @@ declare_clippy_lint! {
290290 /// by the conditional compilation engine.
291291 ///
292292 /// ### Example
293- /// ```rust
293+ /// ```no_run
294294 /// #[cfg(linux)]
295295 /// fn conditional() { }
296296 /// ```
297297 ///
298298 /// Use instead:
299- /// ```rust
299+ /// ```no_run
300300 /// # mod hidden {
301301 /// #[cfg(target_os = "linux")]
302302 /// fn conditional() { }
@@ -325,14 +325,14 @@ declare_clippy_lint! {
325325 /// ensure that others understand the reasoning
326326 ///
327327 /// ### Example
328- /// ```rust
328+ /// ```no_run
329329 /// #![feature(lint_reasons)]
330330 ///
331331 /// #![allow(clippy::some_lint)]
332332 /// ```
333333 ///
334334 /// Use instead:
335- /// ```rust
335+ /// ```no_run
336336 /// #![feature(lint_reasons)]
337337 ///
338338 /// #![allow(clippy::some_lint, reason = "False positive rust-lang/rust-clippy#1002020")]
@@ -352,7 +352,7 @@ declare_clippy_lint! {
352352 /// panicking with the expected message, and not another unrelated panic.
353353 ///
354354 /// ### Example
355- /// ```rust
355+ /// ```no_run
356356 /// fn random() -> i32 { 0 }
357357 ///
358358 /// #[should_panic]
@@ -363,7 +363,7 @@ declare_clippy_lint! {
363363 /// ```
364364 ///
365365 /// Use instead:
366- /// ```rust
366+ /// ```no_run
367367 /// fn random() -> i32 { 0 }
368368 ///
369369 /// #[should_panic = "attempt to divide by zero"]
@@ -386,13 +386,13 @@ declare_clippy_lint! {
386386 /// If there is only one condition, no need to wrap it into `any` or `all` combinators.
387387 ///
388388 /// ### Example
389- /// ```rust
389+ /// ```no_run
390390 /// #[cfg(any(unix))]
391391 /// pub struct Bar;
392392 /// ```
393393 ///
394394 /// Use instead:
395- /// ```rust
395+ /// ```no_run
396396 /// #[cfg(unix)]
397397 /// pub struct Bar;
398398 /// ```
@@ -412,13 +412,13 @@ declare_clippy_lint! {
412412 /// may cause conditional compilation not work quitely.
413413 ///
414414 /// ### Example
415- /// ```rust
415+ /// ```no_run
416416 /// #[cfg(features = "some-feature")]
417417 /// fn conditional() { }
418418 /// ```
419419 ///
420420 /// Use instead:
421- /// ```rust
421+ /// ```no_run
422422 /// #[cfg(feature = "some-feature")]
423423 /// fn conditional() { }
424424 /// ```
0 commit comments