Skip to content

Commit 952fe7f

Browse files
committed
Rustdoc lints on duplicate, unused, and stable features
1 parent 8a66058 commit 952fe7f

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

src/librustdoc/core.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,9 @@ pub(crate) fn create_config(
232232
rustc_lint::builtin::RENAMED_AND_REMOVED_LINTS.name.to_string(),
233233
rustc_lint::builtin::UNKNOWN_LINTS.name.to_string(),
234234
rustc_lint::builtin::UNEXPECTED_CFGS.name.to_string(),
235+
rustc_lint::builtin::DUPLICATE_FEATURES.name.to_string(),
236+
rustc_lint::builtin::UNUSED_FEATURES.name.to_string(),
237+
rustc_lint::builtin::STABLE_FEATURES.name.to_string(),
235238
// this lint is needed to support `#[expect]` attributes
236239
rustc_lint::builtin::UNFULFILLED_LINT_EXPECTATIONS.name.to_string(),
237240
];

tests/rustdoc-html/assoc/assoc-type-bindings-20646.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
// https://github.com/rust-lang/rust/issues/20646
55
#![crate_name="issue_20646"]
6-
#![feature(associated_types)]
76

87
extern crate issue_20646;
98

tests/rustdoc-html/doc-cfg/doc-cfg.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(doc_cfg)]
2-
#![feature(target_feature, cfg_target_feature)]
32

43
//@ has doc_cfg/struct.Portable.html
54
//@ !has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' ''
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
//@ only-64bit
22

3-
#![feature(const_transmute)]
4-
53
pub const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
64
//~^ ERROR transmuting from 8-byte type to 16-byte type

tests/rustdoc-ui/issues/issue-79494.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0080]: transmuting from 8-byte type to 16-byte type: `usize` -> `&[u8]`
2-
--> $DIR/issue-79494.rs:5:33
2+
--> $DIR/issue-79494.rs:3:33
33
|
44
LL | pub const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `ZST` failed here
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#![feature(rustdoc_internals)]
2-
#![feature(rustdoc_internals)] //~ ERROR
2+
#![feature(rustdoc_internals)] //~ DENY duplicate
33

44
pub fn foo() {}

tests/rustdoc-ui/rustc-check-passes.stderr

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
error[E0636]: the feature `rustdoc_internals` has already been enabled
1+
error: the feature `rustdoc_internals` has already been enabled
22
--> $DIR/rustc-check-passes.rs:2:12
33
|
44
LL | #![feature(rustdoc_internals)]
55
| ^^^^^^^^^^^^^^^^^
6+
|
7+
= note: `#[deny(duplicate_features)]` on by default
68

79
error: aborting due to 1 previous error
810

9-
For more information about this error, try `rustc --explain E0636`.

0 commit comments

Comments
 (0)