Skip to content

Commit 879a3bc

Browse files
committed
fixup! -Zretpoline and -Zretpoline-external-thunk flags (target modifiers) to enable retpoline-related target features
1 parent def08a1 commit 879a3bc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/librustdoc/json/mod.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ fn target(sess: &rustc_session::Session) -> types::Target {
148148
.copied()
149149
.filter(|(_, stability, _)| {
150150
// Describe only target features which the user can toggle
151-
stability.toggle_allowed().is_ok()
151+
stability.toggle_allowed(|flag| sess.opts.target_feature_flag_enabled(flag)).is_ok()
152152
})
153153
.map(|(name, stability, implied_features)| {
154154
types::TargetFeature {
@@ -164,7 +164,13 @@ fn target(sess: &rustc_session::Session) -> types::Target {
164164
// Imply only target features which the user can toggle
165165
feature_stability
166166
.get(name)
167-
.map(|stability| stability.toggle_allowed().is_ok())
167+
.map(|stability| {
168+
stability
169+
.toggle_allowed(|flag| {
170+
sess.opts.target_feature_flag_enabled(flag)
171+
})
172+
.is_ok()
173+
})
168174
.unwrap_or(false)
169175
})
170176
.map(String::from)

0 commit comments

Comments
 (0)