Skip to content

Conversation

@coord-e
Copy link
Owner

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

No description provided.

@coord-e coord-e marked this pull request as ready for review December 30, 2025 05:54
@coord-e coord-e requested a review from Copilot December 30, 2025 05:54
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 implements the #[thrust::extern_spec_fn] attribute, which enables developers to specify contracts for external functions by wrapping them with annotated specification functions. This allows applying Thrust's verification capabilities to standard library functions and other external code that cannot be directly annotated.

Key changes:

  • Added new extern_spec_fn attribute path and detection mechanism
  • Implemented DefId extraction to map specification functions to their target external functions
  • Integrated extern_spec_fn functions into the trusted function set with proper type registration

Reviewed changes

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

Show a summary per file
File Description
tests/ui/pass/extern_spec_take.rs Passing test demonstrating correct usage of extern_spec_fn with std::mem::take
tests/ui/fail/extern_spec_take.rs Failing test verifying that incorrect assertions are caught when using extern_spec_fn
src/analyze/annot.rs Adds the extern_spec_fn_path() function to define the attribute path
src/analyze/local_def.rs Implements detection and target DefId extraction for extern_spec_fn annotated functions
src/analyze/crate_.rs Integrates extern_spec_fn into the analysis pipeline, treating them as trusted and registering their types

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

@coord-e coord-e merged commit 0216270 into main Dec 30, 2025
3 checks passed
@coord-e coord-e deleted the extern-spec branch December 30, 2025 06:20
coeff-aij pushed a commit to coeff-aij/thrust that referenced this pull request Jan 12, 2026
Implement #[thrust::extern_spec_fn]
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