Lines Matching +full:check +full:- +full:api +full:- +full:version
17 println!("cargo:rustc-check-cfg=cfg(fuzzing)"); in main()
18 println!("cargo:rustc-check-cfg=cfg(no_is_available)"); in main()
19 println!("cargo:rustc-check-cfg=cfg(no_literal_byte_character)"); in main()
20 println!("cargo:rustc-check-cfg=cfg(no_literal_c_string)"); in main()
21 println!("cargo:rustc-check-cfg=cfg(no_source_text)"); in main()
22 println!("cargo:rustc-check-cfg=cfg(proc_macro_span)"); in main()
23 println!("cargo:rustc-check-cfg=cfg(procmacro2_backtrace)"); in main()
24 println!("cargo:rustc-check-cfg=cfg(procmacro2_nightly_testing)"); in main()
25 println!("cargo:rustc-check-cfg=cfg(procmacro2_semver_exempt)"); in main()
26 println!("cargo:rustc-check-cfg=cfg(randomize_layout)"); in main()
27 println!("cargo:rustc-check-cfg=cfg(span_locations)"); in main()
28 println!("cargo:rustc-check-cfg=cfg(super_unstable)"); in main()
29 println!("cargo:rustc-check-cfg=cfg(wrap_proc_macro)"); in main()
35 // https://github.com/dtolnay/proc-macro2/issues/147 in main()
36 println!("cargo:rustc-cfg=procmacro2_semver_exempt"); in main()
39 if semver_exempt || cfg!(feature = "span-locations") { in main()
43 println!("cargo:rustc-cfg=span_locations"); in main()
48 // macro API is available vs needs to be polyfilled. Instead, use the in main()
49 // proc macro API unconditionally and catch the panic that occurs if it in main()
51 println!("cargo:rustc-cfg=no_is_available"); in main()
56 println!("cargo:rustc-cfg=no_source_text"); in main()
62 println!("cargo:rustc-cfg=no_literal_byte_character"); in main()
63 println!("cargo:rustc-cfg=no_literal_c_string"); in main()
66 if !cfg!(feature = "proc-macro") { in main()
67 println!("cargo:rerun-if-changed=build.rs"); in main()
71 println!("cargo:rerun-if-changed=build/probe.rs"); in main()
89 // This compiler does not support the proc macro Span API in the in main()
90 // form that proc-macro2 expects. No need to pay attention to in main()
102 // macro Span API in the form that proc-macro2 expects, but try again if in main()
109 // Wrap types from libproc_macro rather than polyfilling the whole API. in main()
111 // can't emulate the unstable API without emulating everything else. in main()
114 // nightly-only proc_macro API. in main()
115 println!("cargo:rustc-cfg=wrap_proc_macro"); in main()
119 // Enable non-dummy behavior of Span::start and Span::end methods which in main()
121 // nightly, unless `-Z allow-feature` in RUSTFLAGS disallows unstable in main()
123 println!("cargo:rustc-cfg=proc_macro_span"); in main()
127 // Implement the semver exempt API in terms of the nightly-only in main()
128 // proc_macro API. in main()
129 println!("cargo:rustc-cfg=super_unstable"); in main()
133 println!("cargo:rerun-if-env-changed=RUSTC_BOOTSTRAP"); in main()
137 fn compile_probe(rustc_bootstrap: bool) -> bool { in compile_probe()
139 // We are running inside rustc bootstrap. This is a highly non-standard in compile_probe()
142 // https://github.com/rust-lang/cargo/issues/11138 in compile_probe()
143 // https://github.com/rust-lang/rust/issues/114839 in compile_probe()
176 .arg("--edition=2021") in compile_probe()
177 .arg("--crate-name=proc_macro2") in compile_probe()
178 .arg("--crate-type=lib") in compile_probe()
179 .arg("--cap-lints=allow") in compile_probe()
180 .arg("--emit=dep-info,metadata") in compile_probe()
181 .arg("--out-dir") in compile_probe()
186 cmd.arg("--target").arg(target); in compile_probe()
203 // Clean up to avoid leaving nondeterministic absolute paths in the dep-info in compile_probe()
216 fn rustc_minor_version() -> Option<u32> { in rustc_minor_version()
218 let output = Command::new(rustc).arg("--version").output().ok()?; in rustc_minor_version()
219 let version = str::from_utf8(&output.stdout).ok()?; in rustc_minor_version() localVariable
220 let mut pieces = version.split('.'); in rustc_minor_version()
227 fn cargo_env_var(key: &str) -> OsString { in cargo_env_var()