Skip to content

Commit 5ca4b3d

Browse files
committed
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.
2 parents 85e87fb + 501cef9 commit 5ca4b3d

File tree

15 files changed

+33
-32
lines changed

15 files changed

+33
-32
lines changed

src/tools/rust-analyzer/crates/hir-def/src/hir.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,11 +503,11 @@ impl BindingAnnotation {
503503

504504
#[derive(Debug, Clone, Eq, PartialEq)]
505505
pub enum BindingProblems {
506-
/// https://doc.rust-lang.org/stable/error_codes/E0416.html
506+
/// <https://doc.rust-lang.org/stable/error_codes/E0416.html>
507507
BoundMoreThanOnce,
508-
/// https://doc.rust-lang.org/stable/error_codes/E0409.html
508+
/// <https://doc.rust-lang.org/stable/error_codes/E0409.html>
509509
BoundInconsistently,
510-
/// https://doc.rust-lang.org/stable/error_codes/E0408.html
510+
/// <https://doc.rust-lang.org/stable/error_codes/E0408.html>
511511
NotBoundAcrossAll,
512512
}
513513

src/tools/rust-analyzer/crates/hir-def/src/nameres.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
//!
1717
//! This happens in the `raw` module, which parses a single source file into a
1818
//! set of top-level items. Nested imports are desugared to flat imports in this
19-
//! phase. Macro calls are represented as a triple of (Path, Option<Name>,
20-
//! TokenTree).
19+
//! phase. Macro calls are represented as a triple of `(Path, Option<Name>,
20+
//! TokenTree)`.
2121
//!
2222
//! ## Collecting Modules
2323
//!

src/tools/rust-analyzer/crates/hir-expand/src/hygiene.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! Expansion, and Definition Contexts,” *Journal of Functional Programming* 22, no. 2
55
//! (March 1, 2012): 181–216, <https://doi.org/10.1017/S0956796812000093>.
66
//!
7-
//! Also see https://rustc-dev-guide.rust-lang.org/macro-expansion.html#hygiene-and-hierarchies
7+
//! Also see <https://rustc-dev-guide.rust-lang.org/macro-expansion.html#hygiene-and-hierarchies>
88
//!
99
//! # The Expansion Order Hierarchy
1010
//!

src/tools/rust-analyzer/crates/hir/src/has_source.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub trait HasSource {
2626
///
2727
/// The current some implementations can return `InFile` instead of `Option<InFile>`.
2828
/// But we made this method `Option` to support rlib in the future
29-
/// by https://github.com/rust-lang/rust-analyzer/issues/6913
29+
/// by <https://github.com/rust-lang/rust-analyzer/issues/6913>
3030
fn source(self, db: &dyn HirDatabase) -> Option<InFile<Self::Ast>>;
3131
}
3232

src/tools/rust-analyzer/crates/hir/src/semantics/source_to_def.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@
2626
//!
2727
//! The actual algorithm to resolve syntax to def is curious in two aspects:
2828
//!
29-
//! * It is recursive
30-
//! * It uses the inverse algorithm (what is the syntax for this def?)
29+
//! * It is recursive
30+
//! * It uses the inverse algorithm (what is the syntax for this def?)
3131
//!
3232
//! Specifically, the algorithm goes like this:
3333
//!
34-
//! 1. Find the syntactic container for the syntax. For example, field's
35-
//! container is the struct, and structs container is a module.
36-
//! 2. Recursively get the def corresponding to container.
37-
//! 3. Ask the container def for all child defs. These child defs contain
38-
//! the answer and answer's siblings.
39-
//! 4. For each child def, ask for it's source.
40-
//! 5. The child def whose source is the syntax node we've started with
41-
//! is the answer.
34+
//! 1. Find the syntactic container for the syntax. For example, field's
35+
//! container is the struct, and structs container is a module.
36+
//! 2. Recursively get the def corresponding to container.
37+
//! 3. Ask the container def for all child defs. These child defs contain
38+
//! the answer and answer's siblings.
39+
//! 4. For each child def, ask for it's source.
40+
//! 5. The child def whose source is the syntax node we've started with
41+
//! is the answer.
4242
//!
4343
//! It's interesting that both Roslyn and Kotlin contain very similar code
4444
//! shape.

src/tools/rust-analyzer/crates/ide-completion/src/completions/env_vars.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
//! Completes environment variables defined by Cargo (https://doc.rust-lang.org/cargo/reference/environment-variables.html)
1+
//! Completes environment variables defined by Cargo
2+
//! (<https://doc.rust-lang.org/cargo/reference/environment-variables.html>)
23
use hir::MacroFileIdExt;
34
use ide_db::syntax_helpers::node_ext::macro_call_for_string_token;
45
use syntax::{

src/tools/rust-analyzer/crates/ide-db/src/famous_defs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::RootDatabase;
1515
/// you'd want to include minicore (see `test_utils::MiniCore`) declaration at
1616
/// the start of your tests:
1717
///
18-
/// ```
18+
/// ```text
1919
/// //- minicore: iterator, ord, derive
2020
/// ```
2121
pub struct FamousDefs<'a, 'b>(pub &'a Semantics<'b, RootDatabase>, pub Crate);

src/tools/rust-analyzer/crates/parser/src/grammar.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//! Code in this module also contains inline tests, which start with
1414
//! `// test name-of-the-test` comment and look like this:
1515
//!
16-
//! ```
16+
//! ```text
1717
//! // test function_with_zero_parameters
1818
//! // fn foo() {}
1919
//! ```

src/tools/rust-analyzer/crates/rust-analyzer/src/tracing/hprof.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! Consumer of `tracing` data, which prints a hierarchical profile.
22
//!
3-
//! Based on https://github.com/davidbarsky/tracing-tree, but does less, while
3+
//! Based on <https://github.com/davidbarsky/tracing-tree>, but does less, while
44
//! actually printing timings for spans by default. The code here is vendored from
5-
//! https://github.com/matklad/tracing-span-tree.
5+
//! <https://github.com/matklad/tracing-span-tree>.
66
//!
77
//! Usage:
88
//!

src/tools/rust-analyzer/crates/salsa/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ pub trait ParallelDatabase: Database + Send {
284284
/// series of queries in parallel and arranging the results. Using
285285
/// this method for that purpose ensures that those queries will
286286
/// see a consistent view of the database (it is also advisable
287-
/// for those queries to use the [`Runtime::unwind_if_cancelled`]
287+
/// for those queries to use the [`Database::unwind_if_cancelled`]
288288
/// method to check for cancellation).
289289
///
290290
/// # Panics

0 commit comments

Comments
 (0)