mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 13:13:34 +00:00
Merge pull request #2696 from nathan/patch-1
Fix rustfmt-induced missing line comments in examples
This commit is contained in:
commit
d45612e606
3 changed files with 7 additions and 7 deletions
|
@ -21,7 +21,7 @@ use url::Url;
|
||||||
/// **Examples:**
|
/// **Examples:**
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// /// Do something with the foo_bar parameter. See also
|
/// /// Do something with the foo_bar parameter. See also
|
||||||
/// that::other::module::foo.
|
/// /// that::other::module::foo.
|
||||||
/// // ^ `foo_bar` and `that::other::module::foo` should be ticked.
|
/// // ^ `foo_bar` and `that::other::module::foo` should be ticked.
|
||||||
/// fn doit(foo_bar) { .. }
|
/// fn doit(foo_bar) { .. }
|
||||||
/// ```
|
/// ```
|
||||||
|
|
|
@ -17,7 +17,7 @@ use utils::{is_copy, match_def_path, opt_def_id, paths, span_note_and_lint};
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// let mut lock_guard = mutex.lock();
|
/// let mut lock_guard = mutex.lock();
|
||||||
/// std::mem::drop(&lock_guard) // Should have been drop(lock_guard), mutex
|
/// std::mem::drop(&lock_guard) // Should have been drop(lock_guard), mutex
|
||||||
/// still locked
|
/// // still locked
|
||||||
/// operation_that_requires_mutex_to_be_unlocked();
|
/// operation_that_requires_mutex_to_be_unlocked();
|
||||||
/// ```
|
/// ```
|
||||||
declare_clippy_lint! {
|
declare_clippy_lint! {
|
||||||
|
@ -60,7 +60,7 @@ declare_clippy_lint! {
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// let x:i32 = 42; // i32 implements Copy
|
/// let x:i32 = 42; // i32 implements Copy
|
||||||
/// std::mem::drop(x) // A copy of x is passed to the function, leaving the
|
/// std::mem::drop(x) // A copy of x is passed to the function, leaving the
|
||||||
/// original unaffected
|
/// // original unaffected
|
||||||
/// ```
|
/// ```
|
||||||
declare_clippy_lint! {
|
declare_clippy_lint! {
|
||||||
pub DROP_COPY,
|
pub DROP_COPY,
|
||||||
|
@ -87,7 +87,7 @@ declare_clippy_lint! {
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// let x:i32 = 42; // i32 implements Copy
|
/// let x:i32 = 42; // i32 implements Copy
|
||||||
/// std::mem::forget(x) // A copy of x is passed to the function, leaving the
|
/// std::mem::forget(x) // A copy of x is passed to the function, leaving the
|
||||||
/// original unaffected
|
/// // original unaffected
|
||||||
/// ```
|
/// ```
|
||||||
declare_clippy_lint! {
|
declare_clippy_lint! {
|
||||||
pub FORGET_COPY,
|
pub FORGET_COPY,
|
||||||
|
|
|
@ -16,7 +16,7 @@ use utils::{opt_def_id, sugg};
|
||||||
///
|
///
|
||||||
/// **Example:**
|
/// **Example:**
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// let ptr: *const T = core::intrinsics::transmute('x')`
|
/// let ptr: *const T = core::intrinsics::transmute('x')
|
||||||
/// ```
|
/// ```
|
||||||
declare_clippy_lint! {
|
declare_clippy_lint! {
|
||||||
pub WRONG_TRANSMUTE,
|
pub WRONG_TRANSMUTE,
|
||||||
|
@ -51,8 +51,8 @@ declare_clippy_lint! {
|
||||||
///
|
///
|
||||||
/// **Example:**
|
/// **Example:**
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// core::intrinsics::transmute(t)` // where the result type is the same as
|
/// core::intrinsics::transmute(t) // where the result type is the same as
|
||||||
/// `*t` or `&t`'s
|
/// // `*t` or `&t`'s
|
||||||
/// ```
|
/// ```
|
||||||
declare_clippy_lint! {
|
declare_clippy_lint! {
|
||||||
pub CROSSPOINTER_TRANSMUTE,
|
pub CROSSPOINTER_TRANSMUTE,
|
||||||
|
|
Loading…
Reference in a new issue