mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-04 19:29:07 +00:00
Fix some rustdoc error capitalization
This commit is contained in:
parent
f11759d38c
commit
e5816a75cc
@ -344,7 +344,7 @@ pub fn look_for_tests<'tcx>(
|
|||||||
lint::builtin::MISSING_DOC_CODE_EXAMPLES,
|
lint::builtin::MISSING_DOC_CODE_EXAMPLES,
|
||||||
hir_id,
|
hir_id,
|
||||||
sp,
|
sp,
|
||||||
"Missing code example in this documentation");
|
"missing code example in this documentation");
|
||||||
diag.emit();
|
diag.emit();
|
||||||
} else if check_missing_code == false &&
|
} else if check_missing_code == false &&
|
||||||
tests.found_tests > 0 &&
|
tests.found_tests > 0 &&
|
||||||
@ -353,7 +353,7 @@ pub fn look_for_tests<'tcx>(
|
|||||||
lint::builtin::PRIVATE_DOC_TESTS,
|
lint::builtin::PRIVATE_DOC_TESTS,
|
||||||
hir_id,
|
hir_id,
|
||||||
span_of_attrs(&item.attrs).unwrap_or(item.source.span()),
|
span_of_attrs(&item.attrs).unwrap_or(item.source.span()),
|
||||||
"Documentation test in private item");
|
"documentation test in private item");
|
||||||
diag.emit();
|
diag.emit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -367,7 +367,7 @@ crate fn span_of_attrs(attrs: &clean::Attributes) -> Option<Span> {
|
|||||||
if start == DUMMY_SP {
|
if start == DUMMY_SP {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
let end = attrs.doc_strings.last().expect("No doc strings provided").span();
|
let end = attrs.doc_strings.last().expect("no doc strings provided").span();
|
||||||
Some(start.to(end))
|
Some(start.to(end))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
#![deny(missing_doc_code_examples)] //~ ERROR Missing code example in this documentation
|
#![deny(missing_doc_code_examples)] //~ ERROR missing code example in this documentation
|
||||||
|
|
||||||
/// Some docs.
|
/// Some docs.
|
||||||
//~^ ERROR Missing code example in this documentation
|
//~^ ERROR missing code example in this documentation
|
||||||
pub struct Foo;
|
pub struct Foo;
|
||||||
|
|
||||||
/// And then, the princess died.
|
/// And then, the princess died.
|
||||||
//~^ ERROR Missing code example in this documentation
|
//~^ ERROR missing code example in this documentation
|
||||||
pub mod foo {
|
pub mod foo {
|
||||||
/// Or maybe not because she saved herself!
|
/// Or maybe not because she saved herself!
|
||||||
//~^ ERROR Missing code example in this documentation
|
//~^ ERROR missing code example in this documentation
|
||||||
pub fn bar() {}
|
pub fn bar() {}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
error: Missing code example in this documentation
|
error: missing code example in this documentation
|
||||||
--> $DIR/doc-without-codeblock.rs:1:1
|
--> $DIR/doc-without-codeblock.rs:1:1
|
||||||
|
|
|
|
||||||
LL | / #![deny(missing_doc_code_examples)]
|
LL | / #![deny(missing_doc_code_examples)]
|
||||||
@ -16,19 +16,19 @@ note: lint level defined here
|
|||||||
LL | #![deny(missing_doc_code_examples)]
|
LL | #![deny(missing_doc_code_examples)]
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: Missing code example in this documentation
|
error: missing code example in this documentation
|
||||||
--> $DIR/doc-without-codeblock.rs:3:1
|
--> $DIR/doc-without-codeblock.rs:3:1
|
||||||
|
|
|
|
||||||
LL | /// Some docs.
|
LL | /// Some docs.
|
||||||
| ^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: Missing code example in this documentation
|
error: missing code example in this documentation
|
||||||
--> $DIR/doc-without-codeblock.rs:7:1
|
--> $DIR/doc-without-codeblock.rs:7:1
|
||||||
|
|
|
|
||||||
LL | /// And then, the princess died.
|
LL | /// And then, the princess died.
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: Missing code example in this documentation
|
error: missing code example in this documentation
|
||||||
--> $DIR/doc-without-codeblock.rs:10:5
|
--> $DIR/doc-without-codeblock.rs:10:5
|
||||||
|
|
|
|
||||||
LL | /// Or maybe not because she saved herself!
|
LL | /// Or maybe not because she saved herself!
|
||||||
|
@ -14,11 +14,11 @@
|
|||||||
pub fn link_error() {} //~^^^^^ ERROR cannot be resolved, ignoring it
|
pub fn link_error() {} //~^^^^^ ERROR cannot be resolved, ignoring it
|
||||||
|
|
||||||
/// wait, this doesn't have a doctest?
|
/// wait, this doesn't have a doctest?
|
||||||
pub fn no_doctest() {} //~^ ERROR Missing code example in this documentation
|
pub fn no_doctest() {} //~^ ERROR missing code example in this documentation
|
||||||
|
|
||||||
/// wait, this *does* have a doctest?
|
/// wait, this *does* have a doctest?
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// println!("sup");
|
/// println!("sup");
|
||||||
/// ```
|
/// ```
|
||||||
fn private_doctest() {} //~^^^^^ ERROR Documentation test in private item
|
fn private_doctest() {} //~^^^^^ ERROR documentation test in private item
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
error: Documentation test in private item
|
error: documentation test in private item
|
||||||
--> $DIR/lint-group.rs:19:1
|
--> $DIR/lint-group.rs:19:1
|
||||||
|
|
|
|
||||||
LL | / /// wait, this *does* have a doctest?
|
LL | / /// wait, this *does* have a doctest?
|
||||||
@ -29,7 +29,7 @@ LL | #![deny(rustdoc)]
|
|||||||
= note: `#[deny(intra_doc_link_resolution_failure)]` implied by `#[deny(rustdoc)]`
|
= note: `#[deny(intra_doc_link_resolution_failure)]` implied by `#[deny(rustdoc)]`
|
||||||
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
|
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`
|
||||||
|
|
||||||
error: Missing code example in this documentation
|
error: missing code example in this documentation
|
||||||
--> $DIR/lint-group.rs:16:1
|
--> $DIR/lint-group.rs:16:1
|
||||||
|
|
|
|
||||||
LL | /// wait, this doesn't have a doctest?
|
LL | /// wait, this doesn't have a doctest?
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
error: Missing code example in this documentation
|
error: missing code example in this documentation
|
||||||
--> $DIR/lint-missing-doc-code-example.rs:19:1
|
--> $DIR/lint-missing-doc-code-example.rs:19:1
|
||||||
|
|
|
|
||||||
LL | / mod module1 {
|
LL | / mod module1 {
|
||||||
@ -11,7 +11,7 @@ note: lint level defined here
|
|||||||
LL | #![deny(missing_doc_code_examples)]
|
LL | #![deny(missing_doc_code_examples)]
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
error: Missing code example in this documentation
|
error: missing code example in this documentation
|
||||||
--> $DIR/lint-missing-doc-code-example.rs:37:3
|
--> $DIR/lint-missing-doc-code-example.rs:37:3
|
||||||
|
|
|
|
||||||
LL | /// doc
|
LL | /// doc
|
||||||
|
@ -6,6 +6,6 @@ mod foo {
|
|||||||
/// ```
|
/// ```
|
||||||
/// assert!(false);
|
/// assert!(false);
|
||||||
/// ```
|
/// ```
|
||||||
//~^^^^^ ERROR Documentation test in private item
|
//~^^^^^ ERROR documentation test in private item
|
||||||
fn bar() {}
|
fn bar() {}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
error: Documentation test in private item
|
error: documentation test in private item
|
||||||
--> $DIR/private-item-doc-test.rs:4:5
|
--> $DIR/private-item-doc-test.rs:4:5
|
||||||
|
|
|
|
||||||
LL | / /// private doc test
|
LL | / /// private doc test
|
||||||
|
Loading…
Reference in New Issue
Block a user