How does rustc determine the target triple?

If I'm not passing the --target from the command line nor set the CFG_COMPILER_HOST_TRIPLE environment variable , the compiler should panic according to this ,but it does not, why? What I've missed ?Many thanks!

the option_env! macro is evaluated at compile time rather than at runtime so the code you refer to is not dependent on the Environment variable at runtime, but rather the value it had when the compiler was being build.

2 Likes