Skip to content

Commit

Permalink
rustdoc: Rename invalid_codeblock_attribute lint to be plural
Browse files Browse the repository at this point in the history
  • Loading branch information
ollie27 committed Jul 7, 2020
1 parent c86039b commit 56fb717
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/librustc_lint/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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
);
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_session/lint/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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| {
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/check-attr-test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// compile-flags:--test

#![deny(invalid_codeblock_attribute)]
#![deny(invalid_codeblock_attributes)]

/// foo
///
Expand Down
4 changes: 2 additions & 2 deletions src/test/rustdoc-ui/check-attr-test.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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`?
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/check-attr.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(invalid_codeblock_attribute)]
#![deny(invalid_codeblock_attributes)]

/// foo
//~^ ERROR
Expand Down
4 changes: 2 additions & 2 deletions src/test/rustdoc-ui/check-attr.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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`?
Expand Down

0 comments on commit 56fb717

Please sign in to comment.