Skip to content

Refactor TargetInfo#397

Merged
messense merged 1 commit intomainfrom
more-targets
Jan 27, 2026
Merged

Refactor TargetInfo#397
messense merged 1 commit intomainfrom
more-targets

Conversation

@messense
Copy link
Member

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the TargetInfo struct to use lazy evaluation via methods instead of eager evaluation via precomputed boolean fields. The refactor improves code maintainability and adds several enhancements for platform and architecture detection.

Changes:

  • Refactored TargetInfo from storing 11 boolean fields to computing target properties on-demand through methods
  • Added support for new architectures (aarch64, aarch64_be, riscv32) and Apple platforms (iOS, tvOS, watchOS, visionOS)
  • Introduced apple_cpu() method to return platform-appropriate Apple CPU types instead of hardcoded "apple_m1"
  • Wrapped env::set_var calls in unsafe blocks (required for Rust 1.80+)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@messense messense merged commit e1319cd into main Jan 27, 2026
71 of 74 checks passed
@messense messense deleted the more-targets branch January 27, 2026 02:56
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