rustdoc: Rename invalid_codeblock_attribute lint to be plural
This commit is contained in:
parent
c86039b333
commit
56fb71786a
|
@ -62,7 +62,7 @@ use rustc_middle::ty::query::Providers;
|
|||
use rustc_middle::ty::TyCtxt;
|
||||
use rustc_session::lint::builtin::{
|
||||
BARE_TRAIT_OBJECTS, ELIDED_LIFETIMES_IN_PATHS, EXPLICIT_OUTLIVES_REQUIREMENTS,
|
||||
INTRA_DOC_LINK_RESOLUTION_FAILURE, INVALID_CODEBLOCK_ATTRIBUTE, MISSING_DOC_CODE_EXAMPLES,
|
||||
INTRA_DOC_LINK_RESOLUTION_FAILURE, INVALID_CODEBLOCK_ATTRIBUTES, MISSING_DOC_CODE_EXAMPLES,
|
||||
PRIVATE_DOC_TESTS,
|
||||
};
|
||||
use rustc_span::symbol::{Ident, Symbol};
|
||||
|
@ -304,7 +304,7 @@ fn register_builtins(store: &mut LintStore, no_interleave_lints: bool) {
|
|||
add_lint_group!(
|
||||
"rustdoc",
|
||||
INTRA_DOC_LINK_RESOLUTION_FAILURE,
|
||||
INVALID_CODEBLOCK_ATTRIBUTE,
|
||||
INVALID_CODEBLOCK_ATTRIBUTES,
|
||||
MISSING_DOC_CODE_EXAMPLES,
|
||||
PRIVATE_DOC_TESTS
|
||||
);
|
||||
|
|
|
@ -404,7 +404,7 @@ declare_lint! {
|
|||
}
|
||||
|
||||
declare_lint! {
|
||||
pub INVALID_CODEBLOCK_ATTRIBUTE,
|
||||
pub INVALID_CODEBLOCK_ATTRIBUTES,
|
||||
Warn,
|
||||
"codeblock attribute looks a lot like a known one"
|
||||
}
|
||||
|
@ -602,7 +602,7 @@ declare_lint_pass! {
|
|||
UNSTABLE_NAME_COLLISIONS,
|
||||
IRREFUTABLE_LET_PATTERNS,
|
||||
INTRA_DOC_LINK_RESOLUTION_FAILURE,
|
||||
INVALID_CODEBLOCK_ATTRIBUTE,
|
||||
INVALID_CODEBLOCK_ATTRIBUTES,
|
||||
MISSING_CRATE_LEVEL_DOCS,
|
||||
MISSING_DOC_CODE_EXAMPLES,
|
||||
PRIVATE_DOC_TESTS,
|
||||
|
|
|
@ -214,7 +214,7 @@ pub fn new_handler(
|
|||
|
||||
/// This function is used to setup the lint initialization. By default, in rustdoc, everything
|
||||
/// is "allowed". Depending if we run in test mode or not, we want some of them to be at their
|
||||
/// default level. For example, the "INVALID_CODEBLOCK_ATTRIBUTE" lint is activated in both
|
||||
/// default level. For example, the "INVALID_CODEBLOCK_ATTRIBUTES" lint is activated in both
|
||||
/// modes.
|
||||
///
|
||||
/// A little detail easy to forget is that there is a way to set the lint level for all lints
|
||||
|
@ -315,7 +315,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
|
|||
let missing_doc_example = rustc_lint::builtin::MISSING_DOC_CODE_EXAMPLES.name;
|
||||
let private_doc_tests = rustc_lint::builtin::PRIVATE_DOC_TESTS.name;
|
||||
let no_crate_level_docs = rustc_lint::builtin::MISSING_CRATE_LEVEL_DOCS.name;
|
||||
let invalid_codeblock_attribute_name = rustc_lint::builtin::INVALID_CODEBLOCK_ATTRIBUTE.name;
|
||||
let invalid_codeblock_attribute_name = rustc_lint::builtin::INVALID_CODEBLOCK_ATTRIBUTES.name;
|
||||
|
||||
// In addition to those specific lints, we also need to whitelist those given through
|
||||
// command line, otherwise they'll get ignored and we don't want that.
|
||||
|
|
|
@ -665,7 +665,7 @@ impl<'a, 'b> ExtraInfo<'a, 'b> {
|
|||
(None, None) => return,
|
||||
};
|
||||
self.tcx.struct_span_lint_hir(
|
||||
lint::builtin::INVALID_CODEBLOCK_ATTRIBUTE,
|
||||
lint::builtin::INVALID_CODEBLOCK_ATTRIBUTES,
|
||||
hir_id,
|
||||
self.sp,
|
||||
|lint| {
|
||||
|
|
|
@ -46,7 +46,7 @@ pub struct TestOptions {
|
|||
pub fn run(options: Options) -> Result<(), String> {
|
||||
let input = config::Input::File(options.input.clone());
|
||||
|
||||
let invalid_codeblock_attribute_name = rustc_lint::builtin::INVALID_CODEBLOCK_ATTRIBUTE.name;
|
||||
let invalid_codeblock_attribute_name = rustc_lint::builtin::INVALID_CODEBLOCK_ATTRIBUTES.name;
|
||||
|
||||
// In addition to those specific lints, we also need to whitelist those given through
|
||||
// command line, otherwise they'll get ignored and we don't want that.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// compile-flags:--test
|
||||
|
||||
#![deny(invalid_codeblock_attribute)]
|
||||
#![deny(invalid_codeblock_attributes)]
|
||||
|
||||
/// foo
|
||||
///
|
||||
|
|
|
@ -11,8 +11,8 @@ error: unknown attribute `compile-fail`. Did you mean `compile_fail`?
|
|||
note: the lint level is defined here
|
||||
--> $DIR/check-attr-test.rs:3:9
|
||||
|
|
||||
3 | #![deny(invalid_codeblock_attribute)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
3 | #![deny(invalid_codeblock_attributes)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= help: the code block will either not be tested if not marked as a rust one or won't fail if it compiles successfully
|
||||
|
||||
error: unknown attribute `compilefail`. Did you mean `compile_fail`?
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![deny(invalid_codeblock_attribute)]
|
||||
#![deny(invalid_codeblock_attributes)]
|
||||
|
||||
/// foo
|
||||
//~^ ERROR
|
||||
|
|
|
@ -13,8 +13,8 @@ LL | | /// ```
|
|||
note: the lint level is defined here
|
||||
--> $DIR/check-attr.rs:1:9
|
||||
|
|
||||
LL | #![deny(invalid_codeblock_attribute)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | #![deny(invalid_codeblock_attributes)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= help: the code block will either not be tested if not marked as a rust one or won't fail if it compiles successfully
|
||||
|
||||
error: unknown attribute `compilefail`. Did you mean `compile_fail`?
|
||||
|
|
Loading…
Reference in New Issue