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

allow #[verifier(external_body)] again on consts #1323

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions source/rust_verify/src/external.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ impl<'a> GeneralItem<'a> {
ItemKind::Struct(..) => true,
ItemKind::Enum(..) => true,
ItemKind::Union(..) => true,
ItemKind::Const(..) => true,
_ => false,
},
GeneralItem::ForeignItem(_) => false,
Expand Down
15 changes: 15 additions & 0 deletions source/rust_verify_test/tests/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,3 +341,18 @@ test_verify_one_file! {
}
} => Err(err) => assert_one_fails(err)
}

test_verify_one_file! {
#[test] allow_external_body_const_regression_1322_1 verus_code! {
#[verifier(external_body)]
const A: usize = unimplemented!();
} => Ok(())
}

test_verify_one_file! {
// TODO un-ignore once fixed
#[ignore] #[test] allow_external_body_const_regression_1322_2 verus_code! {
#[verifier(external_body)]
const A: usize ensures 32 <= A <= 52 { unimplemented!() }
} => Ok(())
}