Run more doc tests

This executes some more doc tests that were ignored before.
This commit is contained in:
Philipp Hansch
2019-03-09 08:51:23 +01:00
parent 1cdac4a9c7
commit 9ca34e37fa
8 changed files with 103 additions and 52 deletions

View File

@@ -54,8 +54,11 @@ declare_clippy_lint! {
/// **Known problems:** None.
///
/// **Example:**
/// ```ignore
/// x == NAN
/// ```rust
/// # use core::f32::NAN;
/// # let x = 1.0;
///
/// if x == NAN { }
/// ```
pub CMP_NAN,
correctness,
@@ -75,9 +78,11 @@ declare_clippy_lint! {
/// **Known problems:** None.
///
/// **Example:**
/// ```ignore
/// y == 1.23f64
/// y != x // where both are floats
/// ```rust
/// let x = 1.2331f64;
/// let y = 1.2332f64;
/// if y == 1.23f64 { }
/// if y != x {} // where both are floats
/// ```
pub FLOAT_CMP,
correctness,
@@ -114,8 +119,9 @@ declare_clippy_lint! {
/// **Known problems:** None.
///
/// **Example:**
/// ```ignore
/// x % 1
/// ```rust
/// # let x = 1;
/// let a = x % 1;
/// ```
pub MODULO_ONE,
correctness,
@@ -131,7 +137,9 @@ declare_clippy_lint! {
/// **Known problems:** None.
///
/// **Example:**
/// ```ignore
/// ```rust
/// # let v = Some("abc");
///
/// match v {
/// Some(x) => (),
/// y @ _ => (), // easier written as `y`,
@@ -194,8 +202,8 @@ declare_clippy_lint! {
///
/// **Example:**
///
/// ```ignore
/// 0 as *const u32
/// ```rust
/// let a = 0 as *const u32;
/// ```
pub ZERO_PTR,
style,