Skip to content

Commit e3a67cc

Browse files
committed
tree-wide: fix rustdoc warnings, add some links
1 parent 8a84311 commit e3a67cc

File tree

7 files changed

+23
-20
lines changed

7 files changed

+23
-20
lines changed

crates/hir/src/semantics/source_to_def.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
//! The `GetDeclaredType` takes `Syntax` as input, and returns `Symbol` as
5252
//! output. First, it retrieves a `Symbol` for parent `Syntax`:
5353
//!
54-
//! * https://sourceroslyn.io/#Microsoft.CodeAnalysis.CSharp/Compilation/SyntaxTreeSemanticModel.cs,1423
54+
//! * <https://sourceroslyn.io/#Microsoft.CodeAnalysis.CSharp/Compilation/SyntaxTreeSemanticModel.cs,1423>
5555
//!
5656
//! Then, it iterates parent symbol's children, looking for one which has the
5757
//! same text span as the original node:

crates/hir_ty/src/diagnostics/match_check/deconstruct_pat.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
//!
4040
//! Splitting is implemented in the [`Constructor::split`] function. We don't do splitting for
4141
//! or-patterns; instead we just try the alternatives one-by-one. For details on splitting
42-
//! wildcards, see [`SplitWildcard`]; for integer ranges, see [`SplitIntRange`]; for slices, see
43-
//! [`SplitVarLenSlice`].
42+
//! wildcards, see [`SplitWildcard`]; for integer ranges, see [`SplitIntRange`].
4443
4544
use std::{
4645
cmp::{max, min},

crates/ide_db/src/helpers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ pub fn visit_file_defs(
120120
///
121121
/// Note that, by default, rust-analyzer tests **do not** include core or std
122122
/// libraries. If you are writing tests for functionality using [`FamousDefs`],
123-
/// you'd want to include [minicore](test_utils::MiniCore) declaration at the
124-
/// start of your tests:
123+
/// you'd want to include minicore (see `test_utils::MiniCore`) declaration at
124+
/// the start of your tests:
125125
///
126126
/// ```
127127
/// //- minicore: iterator, ord, derive

crates/parser/src/grammar.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
//! each submodule starts with `use super::*` import and exports
77
//! "public" productions via `pub(super)`.
88
//!
9-
//! See docs for `Parser` to learn about API, available to the grammar,
10-
//! and see docs for `Event` to learn how this actually manages to
11-
//! produce parse trees.
9+
//! See docs for [`Parser`](super::parser::Parser) to learn about API,
10+
//! available to the grammar, and see docs for [`Event`](super::event::Event)
11+
//! to learn how this actually manages to produce parse trees.
1212
//!
1313
//! Code in this module also contains inline tests, which start with
1414
//! `// test name-of-the-test` comment and look like this:

crates/parser/src/lib.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
//! The Rust parser.
22
//!
33
//! The parser doesn't know about concrete representation of tokens and syntax
4-
//! trees. Abstract `TokenSource` and `TreeSink` traits are used instead. As a
5-
//! consequence, this crates does not contain a lexer.
4+
//! trees. Abstract [`TokenSource`] and [`TreeSink`] traits are used instead.
5+
//! As a consequence, this crate does not contain a lexer.
66
//!
7-
//! The `Parser` struct from the `parser` module is a cursor into the sequence
8-
//! of tokens. Parsing routines use `Parser` to inspect current state and
9-
//! advance the parsing.
7+
//! The [`Parser`] struct from the [`parser`] module is a cursor into the
8+
//! sequence of tokens. Parsing routines use [`Parser`] to inspect current
9+
//! state and advance the parsing.
1010
//!
11-
//! The actual parsing happens in the `grammar` module.
11+
//! The actual parsing happens in the [`grammar`] module.
1212
//!
13-
//! Tests for this crate live in `syntax` crate.
13+
//! Tests for this crate live in the `syntax` crate.
14+
//!
15+
//! [`Parser`]: crate::parser::Parser
1416
17+
#![allow(rustdoc::private_intra_doc_links)]
1518
#[macro_use]
1619
mod token_set;
1720
#[macro_use]

crates/parser/src/parser.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::{
1414
/// `Parser` struct provides the low-level API for
1515
/// navigating through the stream of tokens and
1616
/// constructing the parse tree. The actual parsing
17-
/// happens in the `grammar` module.
17+
/// happens in the [`grammar`](super::grammar) module.
1818
///
1919
/// However, the result of this `Parser` is not a real
2020
/// tree, but rather a flat stream of events of the form
@@ -262,7 +262,7 @@ impl<'t> Parser<'t> {
262262
}
263263
}
264264

265-
/// See `Parser::start`.
265+
/// See [`Parser::start`].
266266
pub(crate) struct Marker {
267267
pos: u32,
268268
bomb: DropBomb,
@@ -320,7 +320,8 @@ impl CompletedMarker {
320320
/// node `A`, then complete it, and then after parsing the
321321
/// whole `A`, decide that it should have started some node
322322
/// `B` before starting `A`. `precede` allows to do exactly
323-
/// that. See also docs about `forward_parent` in `Event::Start`.
323+
/// that. See also docs about
324+
/// [`Event::Start::forward_parent`](crate::event::Event::Start::forward_parent).
324325
///
325326
/// Given completed events `[START, FINISH]` and its corresponding
326327
/// `CompletedMarker(pos: 0, _)`.

crates/syntax/src/ast/node_ext.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,12 @@ pub enum AttrKind {
197197
}
198198

199199
impl AttrKind {
200-
/// Returns `true` if the attr_kind is [`Inner`].
200+
/// Returns `true` if the attr_kind is [`Inner`](Self::Inner).
201201
pub fn is_inner(&self) -> bool {
202202
matches!(self, Self::Inner)
203203
}
204204

205-
/// Returns `true` if the attr_kind is [`Outer`].
205+
/// Returns `true` if the attr_kind is [`Outer`](Self::Outer).
206206
pub fn is_outer(&self) -> bool {
207207
matches!(self, Self::Outer)
208208
}

0 commit comments

Comments
 (0)