Skip to content

Commit 5231f4b

Browse files
bors[bot]jyn514
andauthored
Merge #7341
7341: Fix warnings when running `cargo doc --document-private-items` r=Veykril a=jyn514 These were the warnings previously: <details> ``` warning: could not parse code block as Rust code --> crates/stdx/src/lib.rs:137:9 | 137 | /// ∀ x in slice[..idx]: pred(x) | _________^ 138 | | /// && ∀ x in slice[idx..]: !pred(x) | |____^ | = note: error from rustc: unknown start of token: \u{2200} warning: 1 warning emitted warning: unresolved link to `package` --> crates/base_db/src/input.rs:181:15 | 181 | /// it's [package].name, can be different for other project types or even | ^^^^^^^ no item named `package` in scope | = note: `#[warn(broken_intra_doc_links)]` on by default = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `package` --> crates/base_db/src/input.rs:181:15 | 181 | /// it's [package].name, can be different for other project types or even | ^^^^^^^ no item named `package` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: 2 warnings emitted warning: unresolved link to `package` --> crates/base_db/src/input.rs:181:15 | 181 | /// it's [package].name, can be different for other project types or even | ^^^^^^^ no item named `package` in scope | = note: `#[warn(broken_intra_doc_links)]` on by default = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: unresolved link to `package` --> crates/base_db/src/input.rs:181:15 | 181 | /// it's [package].name, can be different for other project types or even | ^^^^^^^ no item named `package` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` warning: 2 warnings emitted ``` </details> This does *not* fix the following warning, because it is actually rust code and rustdoc is being over eager: ``` warning: Rust code block is empty --> crates/parser/src/grammar.rs:16:5 | 16 | //! ``` | _____^ 17 | | //! // test function_with_zero_parameters 18 | | //! // fn foo() {} 19 | | //! ``` | |_______^ | help: mark blocks that do not contain Rust code as text | 16 | //! ```text | ^^^^^^^ ``` rust-lang/rust#79816 should make this configurable so the warning can be `allow`ed. Co-authored-by: Joshua Nelson <[email protected]>
2 parents bf889bc + e7d1f30 commit 5231f4b

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

crates/base_db/src/input.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ pub struct CrateData {
178178
pub root_file_id: FileId,
179179
pub edition: Edition,
180180
/// A name used in the package's project declaration: for Cargo projects,
181-
/// it's [package].name, can be different for other project types or even
181+
/// its `[package].name` can be different for other project types or even
182182
/// absent (a dummy crate for the code snippet, for example).
183183
///
184184
/// For purposes of analysis, crates are anonymous (only names in

crates/parser/src/event.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,16 @@ pub(crate) enum Event {
3838
///
3939
/// The events for it would look like this:
4040
///
41-
///
41+
/// ```text
4242
/// START(PATH) IDENT('foo') FINISH START(PATH) T![::] IDENT('bar') FINISH
4343
/// | /\
4444
/// | |
4545
/// +------forward-parent------+
46+
/// ```
4647
///
4748
/// And the tree would look like this
4849
///
50+
/// ```text
4951
/// +--PATH---------+
5052
/// | | |
5153
/// | | |
@@ -54,6 +56,7 @@ pub(crate) enum Event {
5456
/// PATH
5557
/// |
5658
/// 'foo'
59+
/// ```
5760
///
5861
/// See also `CompletedMarker::precede`.
5962
Start {

crates/stdx/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,10 @@ impl<'a> Iterator for LinesWithEnds<'a> {
134134

135135
/// Returns `idx` such that:
136136
///
137+
/// ```text
137138
/// ∀ x in slice[..idx]: pred(x)
138139
/// && ∀ x in slice[idx..]: !pred(x)
140+
/// ```
139141
///
140142
/// https://github.com/rust-lang/rust/issues/73831
141143
pub fn partition_point<T, P>(slice: &[T], mut pred: P) -> usize

0 commit comments

Comments
 (0)