Skip to content

Conversation

@coord-e
Copy link
Owner

@coord-e coord-e commented Dec 14, 2025

for #10

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 constant handling to support promoted constants by moving the logic from Env::operand_type() to the Analyzer struct in basic_block.rs. The implementation is decomposed into three helper methods for better maintainability and adds support for handling unevaluated constants.

  • Moves constant handling from env.rs to basic_block.rs for better access to type context
  • Adds support for promoted constants via const_eval_resolve
  • Introduces PlaceType::immut() method for creating immutable pointer types

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/refine/env.rs Removes operand_type method, unused imports, and adds new immut() helper method
src/analyze/basic_block.rs Implements three new methods (const_bytes_ty, const_value_ty, const_ty) for handling constants and refactors operand_type to use them

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

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.


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

@coord-e coord-e merged commit 37b4fed into main Dec 14, 2025
3 checks passed
@coord-e coord-e deleted the promoted-constants branch December 14, 2025 09:10
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