Skip to content

Conversation

@coeff-aij
Copy link
Collaborator

In the current implementation every function associated with a struct is treated as a top‑level function.
Consequently, annotations on methods must use the low‑level form is_double(*self, ^self) instead of the natural method syntax.

Example

  • Before
impl A {
    #[thrust::requires(true)]
    #[thrust::ensures(is_double(*self, ^self))]   // must write the receiver manually
    fn double(&mut self) {}
}
  • After
impl A {
    #[thrust::requires(true)]
    #[thrust::ensures(*self.is_double(^self))]    // natural method‑call syntax
    fn double(&mut self) {}
}

@coeff-aij
Copy link
Collaborator Author

This feature seems to be orthogonal to support for annotations on traits, so its implementation can be delayed.

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.

1 participant