tree-wide: Fix all the rustdoc warnings
This commit is contained in:
parent
c78cc7ac1f
commit
23d398b184
@ -422,7 +422,7 @@ fn check_and_warn<'a>(cx: &EarlyContext<'_>, expr: &'a ast::Expr) {
|
||||
///
|
||||
/// is transformed to
|
||||
///
|
||||
/// ```ignore
|
||||
/// ```text
|
||||
/// {
|
||||
/// let x = 5;
|
||||
/// ```
|
||||
|
@ -122,7 +122,7 @@ impl LateLintPass<'_> for NeedlessForEach {
|
||||
/// 2. Detect use of `return` in `Loop` in the closure body.
|
||||
///
|
||||
/// NOTE: The functionality of this type is similar to
|
||||
/// [`crate::utilts::visitors::find_all_ret_expressions`], but we can't use
|
||||
/// [`clippy_utils::visitors::find_all_ret_expressions`], but we can't use
|
||||
/// `find_all_ret_expressions` instead of this type. The reasons are:
|
||||
/// 1. `find_all_ret_expressions` passes the argument of `ExprKind::Ret` to a callback, but what we
|
||||
/// need here is `ExprKind::Ret` itself.
|
||||
|
@ -65,7 +65,7 @@ pub fn span_lint<T: LintContext>(cx: &T, lint: &'static Lint, sp: impl Into<Mult
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// ```ignore
|
||||
/// ```text
|
||||
/// error: constant division of 0.0 with 0.0 will always result in NaN
|
||||
/// --> $DIR/zero_div_zero.rs:6:25
|
||||
/// |
|
||||
@ -103,7 +103,7 @@ pub fn span_lint_and_help<'a, T: LintContext>(
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// ```ignore
|
||||
/// ```text
|
||||
/// error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing.
|
||||
/// --> $DIR/drop_forget_ref.rs:10:5
|
||||
/// |
|
||||
@ -189,7 +189,7 @@ pub fn span_lint_hir_and_then(
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// ```ignore
|
||||
/// ```text
|
||||
/// error: This `.fold` can be more succinctly expressed as `.any`
|
||||
/// --> $DIR/methods.rs:390:13
|
||||
/// |
|
||||
|
@ -195,8 +195,8 @@ pub fn vec_macro<'e>(cx: &LateContext<'_>, expr: &'e hir::Expr<'_>) -> Option<Ve
|
||||
/// - `assert!`, `assert_eq!` and `assert_ne!`
|
||||
/// - `debug_assert!`, `debug_assert_eq!` and `debug_assert_ne!`
|
||||
/// For example:
|
||||
/// `assert!(expr)` will return Some([expr])
|
||||
/// `debug_assert_eq!(a, b)` will return Some([a, b])
|
||||
/// `assert!(expr)` will return `Some([expr])`
|
||||
/// `debug_assert_eq!(a, b)` will return `Some([a, b])`
|
||||
pub fn extract_assert_macro_args<'tcx>(e: &'tcx Expr<'tcx>) -> Option<Vec<&'tcx Expr<'tcx>>> {
|
||||
/// Try to match the AST for a pattern that contains a match, for example when two args are
|
||||
/// compared
|
||||
@ -283,7 +283,7 @@ pub struct FormatArgsExpn<'tcx> {
|
||||
|
||||
/// String literal expressions which represent the format string split by "{}"
|
||||
pub format_string_parts: &'tcx [Expr<'tcx>],
|
||||
/// Symbols corresponding to [`format_string_parts`]
|
||||
/// Symbols corresponding to [`Self::format_string_parts`]
|
||||
pub format_string_symbols: Vec<Symbol>,
|
||||
/// Expressions like `ArgumentV1::new(arg0, Debug::fmt)`
|
||||
pub args: &'tcx [Expr<'tcx>],
|
||||
|
@ -114,7 +114,7 @@ pub fn has_iter_method(cx: &LateContext<'_>, probably_ref_ty: Ty<'_>) -> Option<
|
||||
|
||||
/// Checks whether a type implements a trait.
|
||||
/// The function returns false in case the type contains an inference variable.
|
||||
/// See also [`get_trait_def_id`].
|
||||
/// See also [`get_trait_def_id`](super::get_trait_def_id).
|
||||
pub fn implements_trait<'tcx>(
|
||||
cx: &LateContext<'tcx>,
|
||||
ty: Ty<'tcx>,
|
||||
|
Loading…
x
Reference in New Issue
Block a user