@@ -19,7 +19,7 @@ use rustc_macros::{Decodable, Encodable, HashStable_Generic};
1919use rustc_span:: edition:: { Edition , DEFAULT_EDITION , EDITION_NAME_LIST , LATEST_STABLE_EDITION } ;
2020use rustc_span:: source_map:: FilePathMapping ;
2121use rustc_span:: { FileName , FileNameDisplayPreference , RealFileName , SourceFileHashAlgorithm } ;
22- use rustc_target:: spec:: { LinkSelfContainedComponents , LinkerFeatures } ;
22+ use rustc_target:: spec:: { FramePointer , LinkSelfContainedComponents , LinkerFeatures } ;
2323use rustc_target:: spec:: { SplitDebuginfo , Target , TargetTriple } ;
2424use std:: collections:: btree_map:: {
2525 Iter as BTreeMapIter , Keys as BTreeMapKeysIter , Values as BTreeMapValuesIter ,
@@ -2524,6 +2524,15 @@ pub fn build_session_options(early_dcx: &mut EarlyDiagCtxt, matches: &getopts::M
25242524 }
25252525 }
25262526
2527+ if !nightly_options:: is_unstable_enabled ( matches)
2528+ && cg. force_frame_pointers == FramePointer :: NonLeaf
2529+ {
2530+ early_dcx. early_fatal (
2531+ "`-Cforce-frame-pointers=non-leaf` also requires `-Zunstable-options` \
2532+ and a nightly compiler",
2533+ )
2534+ }
2535+
25272536 // For testing purposes, until we have more feedback about these options: ensure `-Z
25282537 // unstable-options` is required when using the unstable `-C link-self-contained` and `-C
25292538 // linker-flavor` options.
0 commit comments