Skip to content

Conversation

@coord-e
Copy link
Owner

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

No description provided.

@coord-e coord-e mentioned this pull request Dec 31, 2025
@coord-e coord-e changed the title Std specs Inject extern spec of std functions Dec 31, 2025
@coord-e coord-e marked this pull request as ready for review December 31, 2025 07:47
@coord-e coord-e requested a review from Copilot December 31, 2025 07:47
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 introduces automatic injection of extern specifications for standard library functions in Thrust, a verification tool for Rust. Instead of hardcoding specifications for specific functions like Box::new and std::mem::swap, the PR adds a comprehensive std.rs file containing specifications for common std library functions (Option, Result, Box, mem operations, and i32 methods) that gets automatically injected into the user's code during compilation.

Key changes:

  • New std.rs file with extern specifications for Option, Result, Box, mem, and i32 methods
  • Code injection mechanism in main.rs to parse and inject std.rs into the AST
  • Type parameter substitution infrastructure in rty.rs to handle generic specifications correctly

Reviewed changes

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

Show a summary per file
File Description
std.rs New file containing extern specifications for standard library functions (Option, Result, Box, mem, i32)
src/main.rs Adds after_crate_root_parsing callback to inject std.rs into the parsed AST
src/rty.rs Implements type parameter substitution in sorts, formulas, terms, and atoms to support generic extern specs
src/analyze/basic_block.rs Removes hardcoded handling of Box::new and mem::swap, now handled via injected specs
src/refine/template.rs Adjusts template building logic for parameter refinements
src/analyze/local_def.rs Filters extern spec target extraction to only Fn and AssocFn def kinds
src/analyze.rs Inlines datatype symbol name construction for enum variants
src/chc.rs Adds args_mut() accessor to DatatypeSort

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

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