Replace thrust:: with thrust_macros:: for requires/ensures in UI tests#85
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Updates Thrust UI tests to use the newer thrust_macros-based annotation flow (and corresponding formula syntax), in line with the work to retire the old annotation parser (#70).
Changes:
- Switched UI tests from
#[thrust::requires/ensures]to#[thrust_macros::requires/ensures]. - Updated annotation syntax in tests to the newer model conventions (e.g.,
^x→!x,<v>→thrust_models::model::Box::new(v)), and added missingthrust_models::Modelimpls for some ADTs. - Refactored the injected
std.rsmodel for integer types via anint_model!macro and added additional operator/compare impls to ease mixing primitives withmodel::Int.
Reviewed changes
Copilot reviewed 52 out of 52 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| thrust-macros/src/lib.rs | Adjusts turbofish generation for expanded helpers (but currently introduces a syntax issue for lifetime-only generics). |
| std.rs | Introduces int_model! to consolidate integer model impls and adds ops/compare impls with model::Int. |
| tests/ui/pass/take_max.rs | Uses thrust_macros::requires/ensures for UI pass coverage. |
| tests/ui/pass/take_max_annot.rs | Updates requires/ensures path and post-state syntax (^ → !). |
| tests/ui/pass/split.rs | Uses thrust_macros::requires/ensures for UI pass coverage. |
| tests/ui/pass/recursive.rs | Uses thrust_macros::requires/ensures for UI pass coverage. |
| tests/ui/pass/mut_recursive.rs | Uses thrust_macros::requires/ensures for UI pass coverage. |
| tests/ui/pass/loop.rs | Uses thrust_macros::requires/ensures for UI pass coverage. |
| tests/ui/pass/just_rec.rs | Uses thrust_macros::requires/ensures for UI pass coverage (multiple functions). |
| tests/ui/pass/fn_ptr.rs | Uses thrust_macros::requires/ensures for UI pass coverage. |
| tests/ui/pass/fn_poly_annot.rs | Uses thrust_macros::requires/ensures for polymorphic annotation UI coverage. |
| tests/ui/pass/fn_poly_annot_stronger.rs | Uses thrust_macros::requires/ensures for polymorphic annotation UI coverage. |
| tests/ui/pass/fn_poly_annot_ref.rs | Uses thrust_macros::requires/ensures for polymorphic annotation UI coverage. |
| tests/ui/pass/fn_poly_annot_recursive.rs | Uses thrust_macros::requires/ensures for polymorphic annotation UI coverage. |
| tests/ui/pass/fn_poly_annot_nested.rs | Uses thrust_macros::requires/ensures for polymorphic annotation UI coverage. |
| tests/ui/pass/fn_poly_annot_multi_inst.rs | Uses thrust_macros::requires/ensures for polymorphic annotation UI coverage. |
| tests/ui/pass/fn_poly_annot_complex.rs | Uses thrust_macros::requires/ensures for polymorphic annotation UI coverage. |
| tests/ui/pass/extern_spec_take.rs | Switches to thrust_macros and updates post-state syntax in ensures. |
| tests/ui/pass/enum_ref_drop.rs | Uses thrust_macros::requires/ensures for UI pass coverage. |
| tests/ui/pass/annot.rs | Uses thrust_macros::requires/ensures for basic annotation UI coverage. |
| tests/ui/pass/annot_raw_command.rs | Uses thrust_macros::requires/ensures in raw SMT command scenario. |
| tests/ui/pass/annot_raw_command_multi.rs | Uses thrust_macros::requires/ensures in multi-command raw SMT scenario. |
| tests/ui/pass/annot_box_term.rs | Updates box-term syntax to thrust_models::model::Box::new(...). |
| tests/ui/pass/adt.rs | Adds Model impl for enum and switches to thrust_macros::requires/ensures. |
| tests/ui/pass/adt_poly_fn_poly.rs | Adds Model impl for generic enum and switches to thrust_macros::requires/ensures. |
| tests/ui/pass/adt_poly_fn_mono.rs | Adds Model impl for generic enum and switches to thrust_macros::requires/ensures. |
| tests/ui/pass/adt_mut.rs | Switches to thrust_macros::requires/ensures. |
| tests/ui/pass/annot_preds_raw_command.rs | Removes UI test that used thrust::raw_command + predicate-style ensures. |
| tests/ui/pass/annot_preds_raw_command_multi.rs | Removes UI test that used multiple thrust::raw_command + predicate-style ensures. |
| tests/ui/fail/take_max.rs | Uses thrust_macros::requires/ensures for UI fail coverage. |
| tests/ui/fail/take_max_annot.rs | Updates requires/ensures path and post-state syntax (^ → !). |
| tests/ui/fail/split.rs | Uses thrust_macros::requires/ensures for UI fail coverage. |
| tests/ui/fail/recursive.rs | Uses thrust_macros::requires/ensures for UI fail coverage. |
| tests/ui/fail/mut_recursive.rs | Uses thrust_macros::requires/ensures for UI fail coverage. |
| tests/ui/fail/loop.rs | Uses thrust_macros::requires/ensures for UI fail coverage. |
| tests/ui/fail/just_rec.rs | Uses thrust_macros::requires/ensures for UI fail coverage (multiple functions). |
| tests/ui/fail/fn_ptr.rs | Uses thrust_macros::requires/ensures for UI fail coverage. |
| tests/ui/fail/fn_poly_annot.rs | Uses thrust_macros::requires/ensures for polymorphic annotation UI fail coverage. |
| tests/ui/fail/fn_poly_annot_stronger.rs | Uses thrust_macros::requires/ensures for polymorphic annotation UI fail coverage. |
| tests/ui/fail/fn_poly_annot_ref.rs | Uses thrust_macros::requires/ensures for polymorphic annotation UI fail coverage. |
| tests/ui/fail/fn_poly_annot_recursive.rs | Uses thrust_macros::requires/ensures for polymorphic annotation UI fail coverage. |
| tests/ui/fail/fn_poly_annot_nested.rs | Uses thrust_macros::requires/ensures for polymorphic annotation UI fail coverage. |
| tests/ui/fail/fn_poly_annot_multi_inst.rs | Uses thrust_macros::requires/ensures for polymorphic annotation UI fail coverage. |
| tests/ui/fail/fn_poly_annot_complex.rs | Uses thrust_macros::requires/ensures for polymorphic annotation UI fail coverage. |
| tests/ui/fail/extern_spec_take.rs | Switches to thrust_macros and updates post-state syntax in ensures. |
| tests/ui/fail/enum_ref_drop.rs | Uses thrust_macros::requires/ensures for UI fail coverage. |
| tests/ui/fail/annot.rs | Uses thrust_macros::requires/ensures for basic annotation UI fail coverage. |
| tests/ui/fail/annot_box_term.rs | Updates box-term syntax to thrust_models::model::Box::new(...). |
| tests/ui/fail/adt.rs | Adds Model impl for enum and switches to thrust_macros::requires/ensures. |
| tests/ui/fail/adt_poly_fn_poly.rs | Adds Model impl for generic enum and switches to thrust_macros::requires/ensures. |
| tests/ui/fail/adt_poly_fn_mono.rs | Adds Model impl for generic enum and switches to thrust_macros::requires/ensures. |
| tests/ui/fail/adt_mut.rs | Switches to thrust_macros::requires/ensures. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
> error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
Migrate all #[thrust::requires] and #[thrust::ensures] annotations in UI tests to use #[thrust_macros::requires] and #[thrust_macros::ensures]. Syntax differences addressed: - Before-value operator: ^ → ! (e.g. ^dest → !dest) - Box model constructor: <v> → thrust_models::model::Box::new(v) - Add impl thrust_models::Model for custom ADT types that require it Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
25308ba to
18bb816
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#70