Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use multiple #[stub_verified(..)] attributes to a single harness #3804

Closed
ShoyuVanilla opened this issue Jan 1, 2025 · 0 comments · Fixed by #3808
Closed

Cannot use multiple #[stub_verified(..)] attributes to a single harness #3804

ShoyuVanilla opened this issue Jan 1, 2025 · 0 comments · Fixed by #3808
Labels
[C] Bug This is a bug. Something isn't working.

Comments

@ShoyuVanilla
Copy link
Contributor

The docs says

/// You may use multiple `stub_verified` attributes on a single harness.
///
/// This is part of the function contract API, for more general information see
/// the [module-level documentation](../kani/contracts/index.html).
#[proc_macro_attribute]
pub fn stub_verified(attr: TokenStream, item: TokenStream) -> TokenStream {
attr_impl::stub_verified(attr, item)
}

but actually, we can't because

KaniAttributeKind::StubVerified => {
expect_single(self.tcx, kind, &attrs);
}

I'd like to fix this but I wonder which way it was originally intended for.

@ShoyuVanilla ShoyuVanilla added the [C] Bug This is a bug. Something isn't working. label Jan 1, 2025
github-merge-queue bot pushed a commit that referenced this issue Jan 28, 2025
Resolves #3804.

Enables multiple `stub_verified(TARGET)` annotations on a harness, but
still detect and report duplicate targets.

Adds positive and negative tests.

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.

---------

Co-authored-by: Remi Delmas <[email protected]>
Co-authored-by: Celina G. Val <[email protected]>
Co-authored-by: Felipe R. Monteiro <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C] Bug This is a bug. Something isn't working.
Projects
None yet
1 participant