When -Z autodiff=Enable is used, the compiler automatically enables
fat-lto for all crates. However, proc-macro crates cannot use fat-lto
without the -Zdylib-lto flag, causing compilation errors.
This commit modifies the lto() method in Session to exclude proc-macro
crates from fat-lto when autodiff is enabled, while preserving the
existing behavior for all other crate types.
The fix ensures that:
- Non-proc-macro crates still get fat-lto when autodiff is enabled
- Proc-macro crates are excluded from fat-lto when autodiff is enabled
- Existing autodiff functionality remains unchanged for regular crates
Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>