Rustdoc lints on duplicate, unused, and stable features

This commit is contained in:
Jynn Nelson
2026-02-24 22:13:04 -05:00
parent 505d07da28
commit 84442006ab
7 changed files with 8 additions and 8 deletions
+3
View File
@@ -232,6 +232,9 @@ pub(crate) fn create_config(
rustc_lint::builtin::RENAMED_AND_REMOVED_LINTS.name.to_string(),
rustc_lint::builtin::UNKNOWN_LINTS.name.to_string(),
rustc_lint::builtin::UNEXPECTED_CFGS.name.to_string(),
rustc_lint::builtin::DUPLICATE_FEATURES.name.to_string(),
rustc_lint::builtin::UNUSED_FEATURES.name.to_string(),
rustc_lint::builtin::STABLE_FEATURES.name.to_string(),
// this lint is needed to support `#[expect]` attributes
rustc_lint::builtin::UNFULFILLED_LINT_EXPECTATIONS.name.to_string(),
];
@@ -3,7 +3,6 @@
// https://github.com/rust-lang/rust/issues/20646
#![crate_name="issue_20646"]
#![feature(associated_types)]
extern crate issue_20646;
-1
View File
@@ -1,5 +1,4 @@
#![feature(doc_cfg)]
#![feature(target_feature, cfg_target_feature)]
//@ has doc_cfg/struct.Portable.html
//@ !has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' ''
-2
View File
@@ -1,6 +1,4 @@
//@ only-64bit
#![feature(const_transmute)]
pub const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
//~^ ERROR transmuting from 8-byte type to 16-byte type
+1 -1
View File
@@ -1,5 +1,5 @@
error[E0080]: transmuting from 8-byte type to 16-byte type: `usize` -> `&[u8]`
--> $DIR/issue-79494.rs:5:33
--> $DIR/issue-79494.rs:3:33
|
LL | pub const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `ZST` failed here
+1 -1
View File
@@ -1,4 +1,4 @@
#![feature(rustdoc_internals)]
#![feature(rustdoc_internals)] //~ ERROR
#![feature(rustdoc_internals)] //~ ERROR duplicate
pub fn foo() {}
+3 -2
View File
@@ -1,9 +1,10 @@
error[E0636]: the feature `rustdoc_internals` has already been enabled
error: the feature `rustdoc_internals` has already been enabled
--> $DIR/rustc-check-passes.rs:2:12
|
LL | #![feature(rustdoc_internals)]
| ^^^^^^^^^^^^^^^^^
|
= note: `#[deny(duplicate_features)]` on by default
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0636`.