You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generate proper function impl when cross-compiling
When cross-compiling, using cfg!() in a build script or proc macro will
not have the intended behavior: It will check the cfg against the build
host instead of the build target.
The easiest way to avoid this issue is to use CARGO_CFG_* environment
variables, but those are only present for build scripts, not for proc
macros. So to work around the issue, we fold the #[cfg] *inside* the
generated code so that it is checked when compiling the generated code.
0 commit comments