Auto merge of #17418 - Wilfred:rustdoc_warnings, r=Veykril

internal: Fix rustdoc warnings

`cargo doc` generates a bunch of warnings on rust-analyzer. Fix all the bare URL and empty code block warnings.
This commit is contained in:
bors 2024-06-14 06:07:18 +00:00
commit f8305b51ec
15 changed files with 33 additions and 32 deletions

View file

@ -503,11 +503,11 @@ impl BindingAnnotation {
#[derive(Debug, Clone, Eq, PartialEq)] #[derive(Debug, Clone, Eq, PartialEq)]
pub enum BindingProblems { pub enum BindingProblems {
/// https://doc.rust-lang.org/stable/error_codes/E0416.html /// <https://doc.rust-lang.org/stable/error_codes/E0416.html>
BoundMoreThanOnce, BoundMoreThanOnce,
/// https://doc.rust-lang.org/stable/error_codes/E0409.html /// <https://doc.rust-lang.org/stable/error_codes/E0409.html>
BoundInconsistently, BoundInconsistently,
/// https://doc.rust-lang.org/stable/error_codes/E0408.html /// <https://doc.rust-lang.org/stable/error_codes/E0408.html>
NotBoundAcrossAll, NotBoundAcrossAll,
} }

View file

@ -16,8 +16,8 @@
//! //!
//! This happens in the `raw` module, which parses a single source file into a //! This happens in the `raw` module, which parses a single source file into a
//! set of top-level items. Nested imports are desugared to flat imports in this //! set of top-level items. Nested imports are desugared to flat imports in this
//! phase. Macro calls are represented as a triple of (Path, Option<Name>, //! phase. Macro calls are represented as a triple of `(Path, Option<Name>,
//! TokenTree). //! TokenTree)`.
//! //!
//! ## Collecting Modules //! ## Collecting Modules
//! //!

View file

@ -4,7 +4,7 @@
//! Expansion, and Definition Contexts,” *Journal of Functional Programming* 22, no. 2 //! Expansion, and Definition Contexts,” *Journal of Functional Programming* 22, no. 2
//! (March 1, 2012): 181216, <https://doi.org/10.1017/S0956796812000093>. //! (March 1, 2012): 181216, <https://doi.org/10.1017/S0956796812000093>.
//! //!
//! Also see https://rustc-dev-guide.rust-lang.org/macro-expansion.html#hygiene-and-hierarchies //! Also see <https://rustc-dev-guide.rust-lang.org/macro-expansion.html#hygiene-and-hierarchies>
//! //!
//! # The Expansion Order Hierarchy //! # The Expansion Order Hierarchy
//! //!

View file

@ -26,7 +26,7 @@ pub trait HasSource {
/// ///
/// The current some implementations can return `InFile` instead of `Option<InFile>`. /// The current some implementations can return `InFile` instead of `Option<InFile>`.
/// But we made this method `Option` to support rlib in the future /// But we made this method `Option` to support rlib in the future
/// by https://github.com/rust-lang/rust-analyzer/issues/6913 /// by <https://github.com/rust-lang/rust-analyzer/issues/6913>
fn source(self, db: &dyn HirDatabase) -> Option<InFile<Self::Ast>>; fn source(self, db: &dyn HirDatabase) -> Option<InFile<Self::Ast>>;
} }

View file

@ -26,19 +26,19 @@
//! //!
//! The actual algorithm to resolve syntax to def is curious in two aspects: //! The actual algorithm to resolve syntax to def is curious in two aspects:
//! //!
//! * It is recursive //! * It is recursive
//! * It uses the inverse algorithm (what is the syntax for this def?) //! * It uses the inverse algorithm (what is the syntax for this def?)
//! //!
//! Specifically, the algorithm goes like this: //! Specifically, the algorithm goes like this:
//! //!
//! 1. Find the syntactic container for the syntax. For example, field's //! 1. Find the syntactic container for the syntax. For example, field's
//! container is the struct, and structs container is a module. //! container is the struct, and structs container is a module.
//! 2. Recursively get the def corresponding to container. //! 2. Recursively get the def corresponding to container.
//! 3. Ask the container def for all child defs. These child defs contain //! 3. Ask the container def for all child defs. These child defs contain
//! the answer and answer's siblings. //! the answer and answer's siblings.
//! 4. For each child def, ask for it's source. //! 4. For each child def, ask for it's source.
//! 5. The child def whose source is the syntax node we've started with //! 5. The child def whose source is the syntax node we've started with
//! is the answer. //! is the answer.
//! //!
//! It's interesting that both Roslyn and Kotlin contain very similar code //! It's interesting that both Roslyn and Kotlin contain very similar code
//! shape. //! shape.

View file

@ -1,4 +1,5 @@
//! Completes environment variables defined by Cargo (https://doc.rust-lang.org/cargo/reference/environment-variables.html) //! Completes environment variables defined by Cargo
//! (<https://doc.rust-lang.org/cargo/reference/environment-variables.html>)
use hir::MacroFileIdExt; use hir::MacroFileIdExt;
use ide_db::syntax_helpers::node_ext::macro_call_for_string_token; use ide_db::syntax_helpers::node_ext::macro_call_for_string_token;
use syntax::{ use syntax::{

View file

@ -15,7 +15,7 @@ use crate::RootDatabase;
/// you'd want to include minicore (see `test_utils::MiniCore`) declaration at /// you'd want to include minicore (see `test_utils::MiniCore`) declaration at
/// the start of your tests: /// the start of your tests:
/// ///
/// ``` /// ```text
/// //- minicore: iterator, ord, derive /// //- minicore: iterator, ord, derive
/// ``` /// ```
pub struct FamousDefs<'a, 'b>(pub &'a Semantics<'b, RootDatabase>, pub Crate); pub struct FamousDefs<'a, 'b>(pub &'a Semantics<'b, RootDatabase>, pub Crate);

View file

@ -13,7 +13,7 @@
//! Code in this module also contains inline tests, which start with //! Code in this module also contains inline tests, which start with
//! `// test name-of-the-test` comment and look like this: //! `// test name-of-the-test` comment and look like this:
//! //!
//! ``` //! ```text
//! // test function_with_zero_parameters //! // test function_with_zero_parameters
//! // fn foo() {} //! // fn foo() {}
//! ``` //! ```

View file

@ -1,8 +1,8 @@
//! Consumer of `tracing` data, which prints a hierarchical profile. //! Consumer of `tracing` data, which prints a hierarchical profile.
//! //!
//! Based on https://github.com/davidbarsky/tracing-tree, but does less, while //! Based on <https://github.com/davidbarsky/tracing-tree>, but does less, while
//! actually printing timings for spans by default. The code here is vendored from //! actually printing timings for spans by default. The code here is vendored from
//! https://github.com/matklad/tracing-span-tree. //! <https://github.com/matklad/tracing-span-tree>.
//! //!
//! Usage: //! Usage:
//! //!

View file

@ -284,7 +284,7 @@ pub trait ParallelDatabase: Database + Send {
/// series of queries in parallel and arranging the results. Using /// series of queries in parallel and arranging the results. Using
/// this method for that purpose ensures that those queries will /// this method for that purpose ensures that those queries will
/// see a consistent view of the database (it is also advisable /// see a consistent view of the database (it is also advisable
/// for those queries to use the [`Runtime::unwind_if_cancelled`] /// for those queries to use the [`Database::unwind_if_cancelled`]
/// method to check for cancellation). /// method to check for cancellation).
/// ///
/// # Panics /// # Panics

View file

@ -4,7 +4,7 @@
//! Expansion, and Definition Contexts,” *Journal of Functional Programming* 22, no. 2 //! Expansion, and Definition Contexts,” *Journal of Functional Programming* 22, no. 2
//! (March 1, 2012): 181216, <https://doi.org/10.1017/S0956796812000093>. //! (March 1, 2012): 181216, <https://doi.org/10.1017/S0956796812000093>.
//! //!
//! Also see https://rustc-dev-guide.rust-lang.org/macro-expansion.html#hygiene-and-hierarchies //! Also see <https://rustc-dev-guide.rust-lang.org/macro-expansion.html#hygiene-and-hierarchies>
//! //!
//! # The Expansion Order Hierarchy //! # The Expansion Order Hierarchy
//! //!

View file

@ -1,6 +1,6 @@
//! This file is a port of only the necessary features from https://github.com/chris-morgan/anymap version 1.0.0-beta.2 for use within rust-analyzer. //! This file is a port of only the necessary features from <https://github.com/chris-morgan/anymap> version 1.0.0-beta.2 for use within rust-analyzer.
//! Copyright © 20142022 Chris Morgan. //! Copyright © 20142022 Chris Morgan.
//! COPYING: https://github.com/chris-morgan/anymap/blob/master/COPYING //! COPYING: <https://github.com/chris-morgan/anymap/blob/master/COPYING>
//! Note that the license is changed from Blue Oak Model 1.0.0 or MIT or Apache-2.0 to MIT OR Apache-2.0 //! Note that the license is changed from Blue Oak Model 1.0.0 or MIT or Apache-2.0 to MIT OR Apache-2.0
//! //!
//! This implementation provides a safe and convenient store for one value of each type. //! This implementation provides a safe and convenient store for one value of each type.

View file

@ -143,14 +143,14 @@ pub struct FixtureWithProjectMeta {
/// Specifies LLVM data layout to be used. /// Specifies LLVM data layout to be used.
/// ///
/// You probably don't want to manually specify this. See LLVM manual for the /// You probably don't want to manually specify this. See LLVM manual for the
/// syntax, if you must: https://llvm.org/docs/LangRef.html#data-layout /// syntax, if you must: <https://llvm.org/docs/LangRef.html#data-layout>
pub target_data_layout: String, pub target_data_layout: String,
} }
impl FixtureWithProjectMeta { impl FixtureWithProjectMeta {
/// Parses text which looks like this: /// Parses text which looks like this:
/// ///
/// ```not_rust /// ```text
/// //- some meta /// //- some meta
/// line 1 /// line 1
/// line 2 /// line 2
@ -159,7 +159,7 @@ impl FixtureWithProjectMeta {
/// ///
/// Fixture can also start with a proc_macros and minicore declaration (in that order): /// Fixture can also start with a proc_macros and minicore declaration (in that order):
/// ///
/// ``` /// ```text
/// //- toolchain: nightly /// //- toolchain: nightly
/// //- proc_macros: identity /// //- proc_macros: identity
/// //- minicore: sized /// //- minicore: sized

View file

@ -224,7 +224,7 @@ pub fn add_cursor(text: &str, offset: TextSize) -> String {
/// Annotations point to the last line that actually was long enough for the /// Annotations point to the last line that actually was long enough for the
/// range, not counting annotations themselves. So overlapping annotations are /// range, not counting annotations themselves. So overlapping annotations are
/// possible: /// possible:
/// ```no_run /// ```text
/// // stuff other stuff /// // stuff other stuff
/// // ^^ 'st' /// // ^^ 'st'
/// // ^^^^^ 'stuff' /// // ^^^^^ 'stuff'

View file

@ -23,7 +23,7 @@ impl Tool {
/// ///
/// The current implementation checks three places for an executable to use: /// The current implementation checks three places for an executable to use:
/// 1) `$CARGO_HOME/bin/<executable_name>` /// 1) `$CARGO_HOME/bin/<executable_name>`
/// where $CARGO_HOME defaults to ~/.cargo (see https://doc.rust-lang.org/cargo/guide/cargo-home.html) /// where $CARGO_HOME defaults to ~/.cargo (see <https://doc.rust-lang.org/cargo/guide/cargo-home.html>)
/// example: for cargo, this tries $CARGO_HOME/bin/cargo, or ~/.cargo/bin/cargo if $CARGO_HOME is unset. /// example: for cargo, this tries $CARGO_HOME/bin/cargo, or ~/.cargo/bin/cargo if $CARGO_HOME is unset.
/// It seems that this is a reasonable place to try for cargo, rustc, and rustup /// It seems that this is a reasonable place to try for cargo, rustc, and rustup
/// 2) Appropriate environment variable (erroring if this is set but not a usable executable) /// 2) Appropriate environment variable (erroring if this is set but not a usable executable)
@ -45,7 +45,7 @@ impl Tool {
/// example: for cargo, this tries all paths in $PATH with appended `cargo`, returning the /// example: for cargo, this tries all paths in $PATH with appended `cargo`, returning the
/// first that exists /// first that exists
/// 3) `$CARGO_HOME/bin/<executable_name>` /// 3) `$CARGO_HOME/bin/<executable_name>`
/// where $CARGO_HOME defaults to ~/.cargo (see https://doc.rust-lang.org/cargo/guide/cargo-home.html) /// where $CARGO_HOME defaults to ~/.cargo (see <https://doc.rust-lang.org/cargo/guide/cargo-home.html>)
/// example: for cargo, this tries $CARGO_HOME/bin/cargo, or ~/.cargo/bin/cargo if $CARGO_HOME is unset. /// example: for cargo, this tries $CARGO_HOME/bin/cargo, or ~/.cargo/bin/cargo if $CARGO_HOME is unset.
/// It seems that this is a reasonable place to try for cargo, rustc, and rustup /// It seems that this is a reasonable place to try for cargo, rustc, and rustup
/// 4) If all else fails, we just try to use the executable name directly /// 4) If all else fails, we just try to use the executable name directly