Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/consteval/tests.rs')
-rw-r--r--crates/hir-ty/src/consteval/tests.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/crates/hir-ty/src/consteval/tests.rs b/crates/hir-ty/src/consteval/tests.rs
index 5a214eabcd..70a8ae766c 100644
--- a/crates/hir-ty/src/consteval/tests.rs
+++ b/crates/hir-ty/src/consteval/tests.rs
@@ -36,7 +36,7 @@ fn check_fail(
error: impl FnOnce(ConstEvalError<'_>) -> bool,
) {
let (db, file_id) = TestDB::with_single_file(ra_fixture);
- salsa::attach(&db, || match eval_goal(&db, file_id) {
+ crate::attach_db(&db, || match eval_goal(&db, file_id) {
Ok(_) => panic!("Expected fail, but it succeeded"),
Err(e) => {
assert!(error(simplify(e.clone())), "Actual error was: {}", pretty_print_err(e, &db))
@@ -79,7 +79,7 @@ fn check_answer(
check: impl FnOnce(&[u8], &MemoryMap<'_>),
) {
let (db, file_ids) = TestDB::with_many_files(ra_fixture);
- salsa::attach(&db, || {
+ crate::attach_db(&db, || {
let file_id = *file_ids.last().unwrap();
let r = match eval_goal(&db, file_id) {
Ok(t) => t,
@@ -2506,8 +2506,10 @@ fn enums() {
const GOAL: E = E::A;
"#,
);
- let r = eval_goal(&db, file_id).unwrap();
- assert_eq!(try_const_usize(&db, &r), Some(1));
+ crate::attach_db(&db, || {
+ let r = eval_goal(&db, file_id).unwrap();
+ assert_eq!(try_const_usize(&db, &r), Some(1));
+ })
}
#[test]