Skip to content

Commit d4de520

Browse files
RalfJungcuviper
authored andcommitted
rustdoc: disable forbidden #[target_feature] check
(cherry picked from commit b6f2240)
1 parent eb2bae3 commit d4de520

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compiler/rustc_codegen_ssa/src/target_features.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,11 @@ pub(crate) fn provide(providers: &mut Providers) {
149149
assert_eq!(cnum, LOCAL_CRATE);
150150
let target = &tcx.sess.target;
151151
if tcx.sess.opts.actually_rustdoc {
152-
// rustdoc needs to be able to document functions that use all the features, so
153-
// whitelist them all
152+
// HACK: rustdoc would like to pretend that we have all the target features, so we
153+
// have to merge all the lists into one. The result has a "random" stability
154+
// (depending on the order in which we consider features); all places that check
155+
// target stability are expected to check `actually_rustdoc` and do nothing when
156+
// that is set.
154157
rustc_target::target_features::all_rust_features()
155158
.map(|(a, b)| (a.to_string(), b.compute_toggleability(target)))
156159
.collect()

0 commit comments

Comments
 (0)