File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434// macro API and catching a panic if it isn't available. Enabled on Rust
3535// 1.57+.
3636
37+ #![ allow( unknown_lints) ]
38+ #![ allow( unexpected_cfgs) ]
39+
3740use std:: env;
3841use std:: ffi:: OsString ;
3942use std:: iter;
@@ -44,6 +47,23 @@ use std::str;
4447fn main ( ) {
4548 let rustc = rustc_minor_version ( ) . unwrap_or ( u32:: MAX ) ;
4649
50+ if rustc >= 80 {
51+ println ! ( "cargo:rustc-check-cfg=cfg(doc_cfg)" ) ;
52+ println ! ( "cargo:rustc-check-cfg=cfg(fuzzing)" ) ;
53+ println ! ( "cargo:rustc-check-cfg=cfg(nightly)" ) ;
54+ println ! ( "cargo:rustc-check-cfg=cfg(no_is_available)" ) ;
55+ println ! ( "cargo:rustc-check-cfg=cfg(no_literal_byte_character)" ) ;
56+ println ! ( "cargo:rustc-check-cfg=cfg(no_literal_c_string)" ) ;
57+ println ! ( "cargo:rustc-check-cfg=cfg(no_source_text)" ) ;
58+ println ! ( "cargo:rustc-check-cfg=cfg(proc_macro_span)" ) ;
59+ println ! ( "cargo:rustc-check-cfg=cfg(procmacro2_backtrace)" ) ;
60+ println ! ( "cargo:rustc-check-cfg=cfg(procmacro2_nightly_testing)" ) ;
61+ println ! ( "cargo:rustc-check-cfg=cfg(procmacro2_semver_exempt)" ) ;
62+ println ! ( "cargo:rustc-check-cfg=cfg(span_locations)" ) ;
63+ println ! ( "cargo:rustc-check-cfg=cfg(super_unstable)" ) ;
64+ println ! ( "cargo:rustc-check-cfg=cfg(wrap_proc_macro)" ) ;
65+ }
66+
4767 let docs_rs = env:: var_os ( "DOCS_RS" ) . is_some ( ) ;
4868 let semver_exempt = cfg ! ( procmacro2_semver_exempt) || docs_rs;
4969 if semver_exempt {
You can’t perform that action at this time.
0 commit comments