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)]
pub enum BindingProblems {
/// https://doc.rust-lang.org/stable/error_codes/E0416.html
/// <https://doc.rust-lang.org/stable/error_codes/E0416.html>
BoundMoreThanOnce,
/// https://doc.rust-lang.org/stable/error_codes/E0409.html
/// <https://doc.rust-lang.org/stable/error_codes/E0409.html>
BoundInconsistently,
/// https://doc.rust-lang.org/stable/error_codes/E0408.html
/// <https://doc.rust-lang.org/stable/error_codes/E0408.html>
NotBoundAcrossAll,
}

View file

@ -16,8 +16,8 @@
//!
//! 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
//! phase. Macro calls are represented as a triple of (Path, Option<Name>,
//! TokenTree).
//! phase. Macro calls are represented as a triple of `(Path, Option<Name>,
//! TokenTree)`.
//!
//! ## Collecting Modules
//!

View file

@ -4,7 +4,7 @@
//! Expansion, and Definition Contexts,” *Journal of Functional Programming* 22, no. 2
//! (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
//!

View file

@ -26,7 +26,7 @@ pub trait HasSource {
///
/// The current some implementations can return `InFile` instead of `Option<InFile>`.
/// 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>>;
}

View file

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

View file

@ -15,7 +15,7 @@ use crate::RootDatabase;
/// you'd want to include minicore (see `test_utils::MiniCore`) declaration at
/// the start of your tests:
///
/// ```
/// ```text
/// //- minicore: iterator, ord, derive
/// ```
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
//! `// test name-of-the-test` comment and look like this:
//!
//! ```
//! ```text
//! // test function_with_zero_parameters
//! // fn foo() {}
//! ```

View file

@ -1,8 +1,8 @@
//! 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
//! https://github.com/matklad/tracing-span-tree.
//! <https://github.com/matklad/tracing-span-tree>.
//!
//! Usage:
//!

View file

@ -284,7 +284,7 @@ pub trait ParallelDatabase: Database + Send {
/// series of queries in parallel and arranging the results. Using
/// this method for that purpose ensures that those queries will
/// 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).
///
/// # Panics

View file

@ -4,7 +4,7 @@
//! Expansion, and Definition Contexts,” *Journal of Functional Programming* 22, no. 2
//! (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
//!

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.
//! 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
//!
//! 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.
///
/// 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,
}
impl FixtureWithProjectMeta {
/// Parses text which looks like this:
///
/// ```not_rust
/// ```text
/// //- some meta
/// line 1
/// line 2
@ -159,7 +159,7 @@ impl FixtureWithProjectMeta {
///
/// Fixture can also start with a proc_macros and minicore declaration (in that order):
///
/// ```
/// ```text
/// //- toolchain: nightly
/// //- proc_macros: identity
/// //- 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
/// range, not counting annotations themselves. So overlapping annotations are
/// possible:
/// ```no_run
/// ```text
/// // stuff other stuff
/// // ^^ 'st'
/// // ^^^^^ 'stuff'

View file

@ -23,7 +23,7 @@ impl Tool {
///
/// The current implementation checks three places for an executable to use:
/// 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.
/// 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)
@ -45,7 +45,7 @@ impl Tool {
/// example: for cargo, this tries all paths in $PATH with appended `cargo`, returning the
/// first that exists
/// 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.
/// 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