Skip to content

Commit 13da8ab

Browse files
ollie27Mark-Simulacrum
authored andcommitted
rustdoc: Rename invalid_codeblock_attribute lint to be plural
1 parent cbde61c commit 13da8ab

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

src/librustc_lint/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ use rustc_middle::ty::query::Providers;
6161
use rustc_middle::ty::TyCtxt;
6262
use rustc_session::lint::builtin::{
6363
BARE_TRAIT_OBJECTS, ELIDED_LIFETIMES_IN_PATHS, EXPLICIT_OUTLIVES_REQUIREMENTS,
64-
INTRA_DOC_LINK_RESOLUTION_FAILURE, INVALID_CODEBLOCK_ATTRIBUTE, MISSING_DOC_CODE_EXAMPLES,
64+
INTRA_DOC_LINK_RESOLUTION_FAILURE, INVALID_CODEBLOCK_ATTRIBUTES, MISSING_DOC_CODE_EXAMPLES,
6565
PRIVATE_DOC_TESTS,
6666
};
6767
use rustc_span::symbol::{Ident, Symbol};
@@ -301,7 +301,7 @@ fn register_builtins(store: &mut LintStore, no_interleave_lints: bool) {
301301
add_lint_group!(
302302
"rustdoc",
303303
INTRA_DOC_LINK_RESOLUTION_FAILURE,
304-
INVALID_CODEBLOCK_ATTRIBUTE,
304+
INVALID_CODEBLOCK_ATTRIBUTES,
305305
MISSING_DOC_CODE_EXAMPLES,
306306
PRIVATE_DOC_TESTS
307307
);

src/librustc_session/lint/builtin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ declare_lint! {
399399
}
400400

401401
declare_lint! {
402-
pub INVALID_CODEBLOCK_ATTRIBUTE,
402+
pub INVALID_CODEBLOCK_ATTRIBUTES,
403403
Warn,
404404
"codeblock attribute looks a lot like a known one"
405405
}
@@ -585,7 +585,7 @@ declare_lint_pass! {
585585
UNSTABLE_NAME_COLLISIONS,
586586
IRREFUTABLE_LET_PATTERNS,
587587
INTRA_DOC_LINK_RESOLUTION_FAILURE,
588-
INVALID_CODEBLOCK_ATTRIBUTE,
588+
INVALID_CODEBLOCK_ATTRIBUTES,
589589
MISSING_CRATE_LEVEL_DOCS,
590590
MISSING_DOC_CODE_EXAMPLES,
591591
PRIVATE_DOC_TESTS,

src/librustdoc/core.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ pub fn new_handler(
205205

206206
/// This function is used to setup the lint initialization. By default, in rustdoc, everything
207207
/// is "allowed". Depending if we run in test mode or not, we want some of them to be at their
208-
/// default level. For example, the "INVALID_CODEBLOCK_ATTRIBUTE" lint is activated in both
208+
/// default level. For example, the "INVALID_CODEBLOCK_ATTRIBUTES" lint is activated in both
209209
/// modes.
210210
///
211211
/// A little detail easy to forget is that there is a way to set the lint level for all lints
@@ -311,7 +311,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
311311
let missing_doc_example = rustc_lint::builtin::MISSING_DOC_CODE_EXAMPLES.name;
312312
let private_doc_tests = rustc_lint::builtin::PRIVATE_DOC_TESTS.name;
313313
let no_crate_level_docs = rustc_lint::builtin::MISSING_CRATE_LEVEL_DOCS.name;
314-
let invalid_codeblock_attribute_name = rustc_lint::builtin::INVALID_CODEBLOCK_ATTRIBUTE.name;
314+
let invalid_codeblock_attribute_name = rustc_lint::builtin::INVALID_CODEBLOCK_ATTRIBUTES.name;
315315

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

src/librustdoc/html/markdown.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ impl<'a, 'b> ExtraInfo<'a, 'b> {
657657
(None, None) => return,
658658
};
659659
self.tcx.struct_span_lint_hir(
660-
lint::builtin::INVALID_CODEBLOCK_ATTRIBUTE,
660+
lint::builtin::INVALID_CODEBLOCK_ATTRIBUTES,
661661
hir_id,
662662
self.sp,
663663
|lint| {

src/librustdoc/test.rs

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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)