Skip to content

Commit 7db4d8b

Browse files
folkertdevtgross35
authored andcommitted
use #[cfg(bootstrap)] for rustc sync
1 parent 9a58412 commit 7db4d8b

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

compiler-builtins/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,6 @@ rustc-dep-of-std = ['compiler-builtins', 'core']
7070
# This makes certain traits and function specializations public that
7171
# are not normally public but are required by the `testcrate`
7272
public-test-deps = []
73+
74+
[lints.rust]
75+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(bootstrap)'] }

compiler-builtins/src/macros.rs

+11
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,17 @@ macro_rules! intrinsics {
433433
) => (
434434
// `#[naked]` definitions are referenced by other places, so we can't use `cfg` like the others
435435
pub mod $name {
436+
// FIXME: when bootstrap supports `#[unsafe(naked)]` this duplication can be removed
437+
#[cfg(bootstrap)]
438+
#[naked]
439+
$(#[$($attr)*])*
440+
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
441+
#[cfg_attr(not(any(all(windows, target_env = "gnu"), target_os = "cygwin")), linkage = "weak")]
442+
pub unsafe extern $abi fn $name( $($argname: $ty),* ) $(-> $ret)? {
443+
$($body)*
444+
}
445+
446+
#[cfg(not(bootstrap))]
436447
#[unsafe(naked)]
437448
$(#[$($attr)*])*
438449
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]

0 commit comments

Comments
 (0)