aboutsummaryrefslogtreecommitdiff
path: root/crates/stdx
diff options
context:
space:
mode:
authorJoshua Nelson <[email protected]>2021-01-18 21:44:40 +0000
committerJoshua Nelson <[email protected]>2021-01-18 21:44:40 +0000
commite7d1f30cb3c8486a8f00407b314688b7461de9fa (patch)
treef493a72cf7bdadad95b12f30ecd2de316850d566 /crates/stdx
parent39282ec419046d84ad5972d5b02b1af9885e1282 (diff)
Fix warnings when running `cargo doc --document-private-items`
These were the warnings previously: ``` 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 ``` 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 | ^^^^^^^ ``` https://github.com/rust-lang/rust/pull/79816 should make this configurable so the warning can be `allow`ed.
Diffstat (limited to 'crates/stdx')
-rw-r--r--crates/stdx/src/lib.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/stdx/src/lib.rs b/crates/stdx/src/lib.rs
index 1ff2559bb..73b121f8a 100644
--- a/crates/stdx/src/lib.rs
+++ b/crates/stdx/src/lib.rs
@@ -134,8 +134,10 @@ impl<'a> Iterator for LinesWithEnds<'a> {
134 134
135/// Returns `idx` such that: 135/// Returns `idx` such that:
136/// 136///
137/// ```text
137/// ∀ x in slice[..idx]: pred(x) 138/// ∀ x in slice[..idx]: pred(x)
138/// && ∀ x in slice[idx..]: !pred(x) 139/// && ∀ x in slice[idx..]: !pred(x)
140/// ```
139/// 141///
140/// https://github.com/rust-lang/rust/issues/73831 142/// https://github.com/rust-lang/rust/issues/73831
141pub fn partition_point<T, P>(slice: &[T], mut pred: P) -> usize 143pub fn partition_point<T, P>(slice: &[T], mut pred: P) -> usize