Skip to content

Commit 5db778a

Browse files
committed
Auto merge of #74131 - ollie27:rustdoc_invalid_codeblock_attributes_name, r=GuillaumeGomez
rustdoc: Rename invalid_codeblock_attribute lint to be plural Lint names should be plural as per the lint naming conventions: https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md#lints r? @GuillaumeGomez
2 parents 8aa18cb + 56fb717 commit 5db778a

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

src/librustc_lint/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ use rustc_middle::ty::query::Providers;
6363
use rustc_middle::ty::TyCtxt;
6464
use rustc_session::lint::builtin::{
6565
BARE_TRAIT_OBJECTS, ELIDED_LIFETIMES_IN_PATHS, EXPLICIT_OUTLIVES_REQUIREMENTS,
66-
INTRA_DOC_LINK_RESOLUTION_FAILURE, INVALID_CODEBLOCK_ATTRIBUTE, MISSING_DOC_CODE_EXAMPLES,
66+
INTRA_DOC_LINK_RESOLUTION_FAILURE, INVALID_CODEBLOCK_ATTRIBUTES, MISSING_DOC_CODE_EXAMPLES,
6767
PRIVATE_DOC_TESTS,
6868
};
6969
use rustc_span::symbol::{Ident, Symbol};
@@ -305,7 +305,7 @@ fn register_builtins(store: &mut LintStore, no_interleave_lints: bool) {
305305
add_lint_group!(
306306
"rustdoc",
307307
INTRA_DOC_LINK_RESOLUTION_FAILURE,
308-
INVALID_CODEBLOCK_ATTRIBUTE,
308+
INVALID_CODEBLOCK_ATTRIBUTES,
309309
MISSING_DOC_CODE_EXAMPLES,
310310
PRIVATE_DOC_TESTS
311311
);

src/librustc_session/lint/builtin.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ declare_lint! {
404404
}
405405

406406
declare_lint! {
407-
pub INVALID_CODEBLOCK_ATTRIBUTE,
407+
pub INVALID_CODEBLOCK_ATTRIBUTES,
408408
Warn,
409409
"codeblock attribute looks a lot like a known one"
410410
}
@@ -602,7 +602,7 @@ declare_lint_pass! {
602602
UNSTABLE_NAME_COLLISIONS,
603603
IRREFUTABLE_LET_PATTERNS,
604604
INTRA_DOC_LINK_RESOLUTION_FAILURE,
605-
INVALID_CODEBLOCK_ATTRIBUTE,
605+
INVALID_CODEBLOCK_ATTRIBUTES,
606606
MISSING_CRATE_LEVEL_DOCS,
607607
MISSING_DOC_CODE_EXAMPLES,
608608
PRIVATE_DOC_TESTS,

src/librustdoc/core.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ pub fn new_handler(
214214

215215
/// This function is used to setup the lint initialization. By default, in rustdoc, everything
216216
/// is "allowed". Depending if we run in test mode or not, we want some of them to be at their
217-
/// default level. For example, the "INVALID_CODEBLOCK_ATTRIBUTE" lint is activated in both
217+
/// default level. For example, the "INVALID_CODEBLOCK_ATTRIBUTES" lint is activated in both
218218
/// modes.
219219
///
220220
/// 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
315315
let missing_doc_example = rustc_lint::builtin::MISSING_DOC_CODE_EXAMPLES.name;
316316
let private_doc_tests = rustc_lint::builtin::PRIVATE_DOC_TESTS.name;
317317
let no_crate_level_docs = rustc_lint::builtin::MISSING_CRATE_LEVEL_DOCS.name;
318-
let invalid_codeblock_attribute_name = rustc_lint::builtin::INVALID_CODEBLOCK_ATTRIBUTE.name;
318+
let invalid_codeblock_attribute_name = rustc_lint::builtin::INVALID_CODEBLOCK_ATTRIBUTES.name;
319319

320320
// In addition to those specific lints, we also need to whitelist those given through
321321
// command line, otherwise they'll get ignored and we don't want that.

src/librustdoc/html/markdown.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ impl<'a, 'b> ExtraInfo<'a, 'b> {
665665
(None, None) => return,
666666
};
667667
self.tcx.struct_span_lint_hir(
668-
lint::builtin::INVALID_CODEBLOCK_ATTRIBUTE,
668+
lint::builtin::INVALID_CODEBLOCK_ATTRIBUTES,
669669
hir_id,
670670
self.sp,
671671
|lint| {

src/librustdoc/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub struct TestOptions {
4646
pub fn run(options: Options) -> Result<(), String> {
4747
let input = config::Input::File(options.input.clone());
4848

49-
let invalid_codeblock_attribute_name = rustc_lint::builtin::INVALID_CODEBLOCK_ATTRIBUTE.name;
49+
let invalid_codeblock_attribute_name = rustc_lint::builtin::INVALID_CODEBLOCK_ATTRIBUTES.name;
5050

5151
// In addition to those specific lints, we also need to whitelist those given through
5252
// command line, otherwise they'll get ignored and we don't want that.

src/test/rustdoc-ui/check-attr-test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// compile-flags:--test
22

3-
#![deny(invalid_codeblock_attribute)]
3+
#![deny(invalid_codeblock_attributes)]
44

55
/// foo
66
///

src/test/rustdoc-ui/check-attr-test.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ error: unknown attribute `compile-fail`. Did you mean `compile_fail`?
1111
note: the lint level is defined here
1212
--> $DIR/check-attr-test.rs:3:9
1313
|
14-
3 | #![deny(invalid_codeblock_attribute)]
15-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
14+
3 | #![deny(invalid_codeblock_attributes)]
15+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1616
= help: the code block will either not be tested if not marked as a rust one or won't fail if it compiles successfully
1717

1818
error: unknown attribute `compilefail`. Did you mean `compile_fail`?

src/test/rustdoc-ui/check-attr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![deny(invalid_codeblock_attribute)]
1+
#![deny(invalid_codeblock_attributes)]
22

33
/// foo
44
//~^ ERROR

src/test/rustdoc-ui/check-attr.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ LL | | /// ```
1313
note: the lint level is defined here
1414
--> $DIR/check-attr.rs:1:9
1515
|
16-
LL | #![deny(invalid_codeblock_attribute)]
17-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
16+
LL | #![deny(invalid_codeblock_attributes)]
17+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1818
= help: the code block will either not be tested if not marked as a rust one or won't fail if it compiles successfully
1919

2020
error: unknown attribute `compilefail`. Did you mean `compile_fail`?

0 commit comments

Comments
 (0)