Skip to content

Remove the need for #[cfg] in #[use_c_shim_if]#293

Merged
alexcrichton merged 1 commit intorust-lang:masterfrom
alexcrichton:deduplicate-cfg
May 15, 2019
Merged

Remove the need for #[cfg] in #[use_c_shim_if]#293
alexcrichton merged 1 commit intorust-lang:masterfrom
alexcrichton:deduplicate-cfg

Conversation

@alexcrichton
Copy link
Copy Markdown
Member

This commit tweaks the implementation of the synthetic
#[use_c_shim_if] attribute, renaming it to
#[maybe_use_optimized_c_shim] in the process. This no longer requires
specifying a #[cfg] clause indicating when the optimized intrinsic
should be used, but rather this is inferred and printed from the build
script.

The build script will now print out appropriate #[cfg] directives for
rustc to indicate what intrinsics it's compiling. This should remove the
need for us to keep the build script and the source in sync, but rather
the build script can simply take care of everything.

This commit tweaks the implementation of the synthetic
`#[use_c_shim_if]` attribute, renaming it to
`#[maybe_use_optimized_c_shim]` in the process. This no longer requires
specifying a `#[cfg]` clause indicating when the optimized intrinsic
should be used, but rather this is inferred and printed from the build
script.

The build script will now print out appropriate `#[cfg]` directives for
rustc to indicate what intrinsics it's compiling. This should remove the
need for us to keep the build script and the source in sync, but rather
the build script can simply take care of everything.
@chandde
Copy link
Copy Markdown

chandde commented May 15, 2019

👍

@alexcrichton alexcrichton merged commit d967242 into rust-lang:master May 15, 2019
@alexcrichton alexcrichton deleted the deduplicate-cfg branch May 15, 2019 21:45
tgross35 pushed a commit that referenced this pull request Jan 31, 2026
Remove the need for #[cfg] in #[use_c_shim_if]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants