about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/tools/miri/Cargo.lock81
-rw-r--r--src/tools/miri/Cargo.toml2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.init.stderr6
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.static_initializer.stderr6
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.rs4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_main_terminate.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_few_args.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_many_args.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_detached.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_detached.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_joined.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_joined.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_main.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_main.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_multiple.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_multiple.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_self.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_self.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_NULL_deadlock.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_NULL_deadlock.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.stderr6
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_default_deadlock.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_default_deadlock.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_destroy_locked.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_destroy_locked.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.init.stderr6
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.static_initializer.stderr6
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_deadlock.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_deadlock.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_unlock_unlocked.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_unlock_unlocked.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_read_locked.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_read_locked.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_write_locked.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_write_locked.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_unlock_unlocked.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_unlock_unlocked.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.stderr6
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.stderr6
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libx_pthread_rwlock_moved.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/libx_pthread_rwlock_moved.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/windows_join_detached.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/windows_join_detached.stderr2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/windows_join_main.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/windows_join_main.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/windows_join_self.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/concurrency/windows_join_self.stderr6
-rw-r--r--src/tools/miri/tests/fail-dep/libc/affinity.rs4
-rw-r--r--src/tools/miri/tests/fail-dep/libc/affinity.stderr6
-rw-r--r--src/tools/miri/tests/fail-dep/libc/aligned_alloc_size_zero_leak.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/libc/aligned_alloc_size_zero_leak.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/libc/env-set_var-data-race.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/libc/env-set_var-data-race.stderr6
-rw-r--r--src/tools/miri/tests/fail-dep/libc/fs/close_stdout.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/libc/fs/close_stdout.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/libc/fs/isolated_stdin.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/libc/fs/isolated_stdin.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/libc/fs/mkstemp_immutable_arg.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/libc/fs/mkstemp_immutable_arg.stderr6
-rw-r--r--src/tools/miri/tests/fail-dep/libc/fs/read_from_stdout.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/libc/fs/read_from_stdout.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/libc/fs/unix_open_missing_required_mode.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/libc/fs/unix_open_missing_required_mode.stderr6
-rw-r--r--src/tools/miri/tests/fail-dep/libc/fs/write_to_stdin.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/libc/fs/write_to_stdin.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/libc/libc-read-and-uninit-premature-eof.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/libc/libc-read-and-uninit-premature-eof.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/libc/libc_epoll_unsupported_fd.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/libc/libc_epoll_unsupported_fd.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/libc/libc_eventfd_read_block.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/libc/libc_eventfd_read_block.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/libc/libc_eventfd_write_block.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/libc/libc_eventfd_write_block.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/libc/malloc_zero_double_free.stderr8
-rw-r--r--src/tools/miri/tests/fail-dep/libc/malloc_zero_memory_leak.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/libc/memchr_null.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/libc/memcmp_null.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/libc/memcmp_zero.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/libc/memcpy_zero.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/libc/memrchr_null.rs4
-rw-r--r--src/tools/miri/tests/fail-dep/libc/memrchr_null.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/libc/mmap_invalid_dealloc.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/libc/mmap_invalid_dealloc.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/libc/mmap_use_after_munmap.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/libc/mmap_use_after_munmap.stderr8
-rw-r--r--src/tools/miri/tests/fail-dep/libc/munmap_partial.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/libc/munmap_partial.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_double_free.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_double_free.stderr8
-rw-r--r--src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_leak.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_leak.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/libc/realloc-zero.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/libc/socketpair_read_blocking.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/libc/socketpair_read_blocking.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/libc/socketpair_write_blocking.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/libc/socketpair_write_blocking.stderr4
-rw-r--r--src/tools/miri/tests/fail-dep/libc/unsupported_incomplete_function.rs2
-rw-r--r--src/tools/miri/tests/fail-dep/libc/unsupported_incomplete_function.stderr4
-rw-r--r--src/tools/miri/tests/fail/alloc/alloc_error_handler.stderr2
-rw-r--r--src/tools/miri/tests/fail/alloc/alloc_error_handler_custom.stderr8
-rw-r--r--src/tools/miri/tests/fail/alloc/alloc_error_handler_no_std.stderr6
-rw-r--r--src/tools/miri/tests/fail/alloc/deallocate-bad-alignment.stderr4
-rw-r--r--src/tools/miri/tests/fail/alloc/deallocate-bad-size.stderr4
-rw-r--r--src/tools/miri/tests/fail/alloc/deallocate-twice.stderr8
-rw-r--r--src/tools/miri/tests/fail/alloc/global_system_mixup.stderr2
-rw-r--r--src/tools/miri/tests/fail/alloc/no_global_allocator.stderr4
-rw-r--r--src/tools/miri/tests/fail/alloc/reallocate-bad-size.stderr4
-rw-r--r--src/tools/miri/tests/fail/alloc/reallocate-change-alloc.stderr8
-rw-r--r--src/tools/miri/tests/fail/alloc/reallocate-dangling.stderr8
-rw-r--r--src/tools/miri/tests/fail/alloc/stack_free.stderr2
-rw-r--r--src/tools/miri/tests/fail/alloc/too_large.stderr4
-rw-r--r--src/tools/miri/tests/fail/alloc/unsupported_big_alignment.stderr4
-rw-r--r--src/tools/miri/tests/fail/alloc/unsupported_non_power_two_alignment.stderr4
-rw-r--r--src/tools/miri/tests/fail/both_borrows/alias_through_mutation.stack.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/alias_through_mutation.tree.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/aliasing_mut1.stack.stderr10
-rw-r--r--src/tools/miri/tests/fail/both_borrows/aliasing_mut1.tree.stderr10
-rw-r--r--src/tools/miri/tests/fail/both_borrows/aliasing_mut2.stack.stderr10
-rw-r--r--src/tools/miri/tests/fail/both_borrows/aliasing_mut2.tree.stderr10
-rw-r--r--src/tools/miri/tests/fail/both_borrows/aliasing_mut3.stack.stderr10
-rw-r--r--src/tools/miri/tests/fail/both_borrows/aliasing_mut3.tree.stderr10
-rw-r--r--src/tools/miri/tests/fail/both_borrows/aliasing_mut4.stack.stderr10
-rw-r--r--src/tools/miri/tests/fail/both_borrows/aliasing_mut4.tree.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.stack.stderr12
-rw-r--r--src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.tree.stderr12
-rw-r--r--src/tools/miri/tests/fail/both_borrows/box_noalias_violation.stack.stderr10
-rw-r--r--src/tools/miri/tests/fail/both_borrows/box_noalias_violation.tree.stderr12
-rw-r--r--src/tools/miri/tests/fail/both_borrows/buggy_as_mut_slice.stack.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/buggy_as_mut_slice.tree.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/buggy_split_at_mut.stack.stderr10
-rw-r--r--src/tools/miri/tests/fail/both_borrows/buggy_split_at_mut.tree.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/illegal_write1.stack.stderr6
-rw-r--r--src/tools/miri/tests/fail/both_borrows/illegal_write1.tree.stderr6
-rw-r--r--src/tools/miri/tests/fail/both_borrows/illegal_write5.stack.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/illegal_write5.tree.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/illegal_write6.stack.stderr10
-rw-r--r--src/tools/miri/tests/fail/both_borrows/illegal_write6.tree.stderr12
-rw-r--r--src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.stack.stderr10
-rw-r--r--src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.tree.stderr10
-rw-r--r--src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.stack.stderr10
-rw-r--r--src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.tree.stderr10
-rw-r--r--src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.stack.stderr4
-rw-r--r--src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.tree.stderr4
-rw-r--r--src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.stack.stderr2
-rw-r--r--src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.tree.stderr2
-rw-r--r--src/tools/miri/tests/fail/both_borrows/load_invalid_shr.stack.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/load_invalid_shr.tree.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.stack.stderr12
-rw-r--r--src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.tree.stderr12
-rw-r--r--src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation2.stack.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation2.tree.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.stack.stderr12
-rw-r--r--src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.tree.stderr14
-rw-r--r--src/tools/miri/tests/fail/both_borrows/newtype_retagging.stack.stderr12
-rw-r--r--src/tools/miri/tests/fail/both_borrows/newtype_retagging.tree.stderr14
-rw-r--r--src/tools/miri/tests/fail/both_borrows/outdated_local.stack.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/outdated_local.tree.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/pass_invalid_shr.stack.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/pass_invalid_shr.tree.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_option.stack.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_option.tree.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_tuple.stack.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_tuple.tree.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/retag_data_race_write.stack.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/retag_data_race_write.tree.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/return_invalid_shr.stack.stderr10
-rw-r--r--src/tools/miri/tests/fail/both_borrows/return_invalid_shr.tree.stderr10
-rw-r--r--src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.stack.stderr10
-rw-r--r--src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.tree.stderr10
-rw-r--r--src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.stack.stderr10
-rw-r--r--src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.tree.stderr10
-rw-r--r--src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.stack.stderr10
-rw-r--r--src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.tree.stderr10
-rw-r--r--src/tools/miri/tests/fail/both_borrows/shr_frozen_violation2.stack.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/shr_frozen_violation2.tree.stderr8
-rw-r--r--src/tools/miri/tests/fail/both_borrows/zero-sized-protected.stack.stderr4
-rw-r--r--src/tools/miri/tests/fail/both_borrows/zero-sized-protected.tree.stderr10
-rw-r--r--src/tools/miri/tests/fail/box-cell-alias.stderr10
-rw-r--r--src/tools/miri/tests/fail/branchless-select-i128-pointer.stderr4
-rw-r--r--src/tools/miri/tests/fail/breakpoint.stderr4
-rw-r--r--src/tools/miri/tests/fail/concurrency/read_only_atomic_cmpxchg.stderr4
-rw-r--r--src/tools/miri/tests/fail/concurrency/read_only_atomic_load_acquire.stderr4
-rw-r--r--src/tools/miri/tests/fail/concurrency/read_only_atomic_load_large.rs2
-rw-r--r--src/tools/miri/tests/fail/concurrency/read_only_atomic_load_large.stderr4
-rw-r--r--src/tools/miri/tests/fail/const-ub-checks.stderr6
-rw-r--r--src/tools/miri/tests/fail/coroutine-pinned-moved.stderr16
-rw-r--r--src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_deref.stderr8
-rw-r--r--src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_deref_match_never.stderr4
-rw-r--r--src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_offset.stderr8
-rw-r--r--src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_let.stderr8
-rw-r--r--src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_let_type_annotation.stderr8
-rw-r--r--src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_match.stderr8
-rw-r--r--src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.stderr6
-rw-r--r--src/tools/miri/tests/fail/dangling_pointers/dangling_primitive.stderr6
-rw-r--r--src/tools/miri/tests/fail/dangling_pointers/deref-invalid-ptr.stderr4
-rw-r--r--src/tools/miri/tests/fail/dangling_pointers/deref_dangling_box.stderr2
-rw-r--r--src/tools/miri/tests/fail/dangling_pointers/deref_dangling_ref.stderr2
-rw-r--r--src/tools/miri/tests/fail/dangling_pointers/dyn_size.stderr4
-rw-r--r--src/tools/miri/tests/fail/dangling_pointers/null_pointer_deref.stderr4
-rw-r--r--src/tools/miri/tests/fail/dangling_pointers/null_pointer_write.stderr4
-rw-r--r--src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_project.stderr4
-rw-r--r--src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_read.stderr6
-rw-r--r--src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_write.stderr6
-rw-r--r--src/tools/miri/tests/fail/dangling_pointers/stack_temporary.stderr8
-rw-r--r--src/tools/miri/tests/fail/dangling_pointers/storage_dead_dangling.stderr6
-rw-r--r--src/tools/miri/tests/fail/dangling_pointers/wild_pointer_deref.stderr4
-rw-r--r--src/tools/miri/tests/fail/data_race/alloc_read_race.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/alloc_write_race.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/atomic_read_na_write_race1.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/atomic_read_na_write_race2.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/atomic_write_na_read_race1.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/atomic_write_na_read_race2.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/atomic_write_na_write_race1.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/atomic_write_na_write_race2.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/dangling_thread_async_race.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/dangling_thread_race.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/dealloc_read_race1.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/dealloc_read_race2.stderr8
-rw-r--r--src/tools/miri/tests/fail/data_race/dealloc_read_race_stack.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/dealloc_write_race1.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/dealloc_write_race2.stderr8
-rw-r--r--src/tools/miri/tests/fail/data_race/dealloc_write_race_stack.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/enable_after_join_to_main.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/fence_after_load.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/local_variable_alloc_race.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/local_variable_read_race.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/local_variable_write_race.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/mixed_size_read.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/mixed_size_write.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/read_read_race1.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/read_read_race2.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/read_write_race.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/read_write_race_stack.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/relax_acquire_race.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/release_seq_race.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/release_seq_race_same_thread.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/rmw_race.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/stack_pop_race.stderr8
-rw-r--r--src/tools/miri/tests/fail/data_race/write_write_race.stderr6
-rw-r--r--src/tools/miri/tests/fail/data_race/write_write_race_stack.stderr6
-rw-r--r--src/tools/miri/tests/fail/deny_lint.stderr4
-rw-r--r--src/tools/miri/tests/fail/dyn-call-trait-mismatch.stderr4
-rw-r--r--src/tools/miri/tests/fail/dyn-upcast-nop-wrong-trait.stderr4
-rw-r--r--src/tools/miri/tests/fail/dyn-upcast-trait-mismatch.stderr4
-rw-r--r--src/tools/miri/tests/fail/enum-set-discriminant-niche-variant-wrong.stderr6
-rw-r--r--src/tools/miri/tests/fail/environ-gets-deallocated.rs2
-rw-r--r--src/tools/miri/tests/fail/environ-gets-deallocated.stderr4
-rw-r--r--src/tools/miri/tests/fail/erroneous_const.stderr6
-rw-r--r--src/tools/miri/tests/fail/erroneous_const2.stderr8
-rw-r--r--src/tools/miri/tests/fail/extern-type-field-offset.stderr8
-rw-r--r--src/tools/miri/tests/fail/extern_static.stderr4
-rw-r--r--src/tools/miri/tests/fail/extern_static_in_const.stderr4
-rw-r--r--src/tools/miri/tests/fail/extern_static_wrong_size.rs2
-rw-r--r--src/tools/miri/tests/fail/extern_static_wrong_size.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.stack.stderr10
-rw-r--r--src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.tree.stderr12
-rw-r--r--src/tools/miri/tests/fail/function_calls/arg_inplace_observe_after.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.none.stderr6
-rw-r--r--src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.stack.stderr10
-rw-r--r--src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr12
-rw-r--r--src/tools/miri/tests/fail/function_calls/check_arg_abi.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_calls/check_arg_count_abort.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_calls/check_arg_count_too_few_args.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_calls/check_arg_count_too_many_args.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_calls/check_callback_abi.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.cache.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.fn_ptr.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.no_cache.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr6
-rw-r--r--src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr6
-rw-r--r--src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr6
-rw-r--r--src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr6
-rw-r--r--src/tools/miri/tests/fail/function_calls/exported_symbol_clashing.stderr8
-rw-r--r--src/tools/miri/tests/fail/function_calls/exported_symbol_shim_clashing.stderr6
-rw-r--r--src/tools/miri/tests/fail/function_calls/exported_symbol_wrong_arguments.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_calls/exported_symbol_wrong_type.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.none.stderr6
-rw-r--r--src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.stack.stderr10
-rw-r--r--src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.tree.stderr12
-rw-r--r--src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.stack.stderr10
-rw-r--r--src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.tree.stderr12
-rw-r--r--src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.stack.stderr10
-rw-r--r--src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.tree.stderr12
-rw-r--r--src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_calls/simd_feature_flag_difference.rs2
-rw-r--r--src/tools/miri/tests/fail/function_calls/simd_feature_flag_difference.stderr6
-rw-r--r--src/tools/miri/tests/fail/function_calls/target_feature.rs4
-rw-r--r--src/tools/miri/tests/fail/function_calls/target_feature.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_calls/target_feature_wasm.rs2
-rw-r--r--src/tools/miri/tests/fail/function_calls/target_feature_wasm.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_pointers/abi_mismatch_array_vs_struct.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_pointers/abi_mismatch_int_vs_float.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_pointers/abi_mismatch_raw_pointer.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_pointers/abi_mismatch_repr_C.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_pointers/abi_mismatch_return_type.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_pointers/abi_mismatch_simple.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_pointers/abi_mismatch_too_few_args.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_pointers/abi_mismatch_too_many_args.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_pointers/abi_mismatch_vector.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_pointers/cast_box_int_to_fn_ptr.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_pointers/cast_int_to_fn_ptr.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_pointers/deref_fn_ptr.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_pointers/execute_memory.stderr4
-rw-r--r--src/tools/miri/tests/fail/function_pointers/fn_ptr_offset.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsic_fallback_is_spec.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/assume.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/copy_overflow.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/copy_overlapping.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/copy_unaligned.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/ctlz_nonzero.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/cttz_nonzero.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/div-by-zero.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/exact_div1.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/exact_div2.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/exact_div3.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/exact_div4.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/fast_math_both.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/fast_math_first.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/fast_math_result.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/fast_math_second.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/float_to_int_32_inf1.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/float_to_int_32_infneg1.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/float_to_int_32_nan.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/float_to_int_32_nanneg.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/float_to_int_32_neg.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_big1.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_big2.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_small1.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/float_to_int_64_inf1.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/float_to_int_64_infneg1.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/float_to_int_64_infneg2.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/float_to_int_64_nan.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/float_to_int_64_neg.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big1.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big2.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big3.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big4.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big5.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big6.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big7.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small1.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small2.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small3.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/intrinsic_target_feature.rs7
-rw-r--r--src/tools/miri/tests/fail/intrinsics/intrinsic_target_feature.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_data.stderr6
-rw-r--r--src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_len.stderr10
-rw-r--r--src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_thin.stderr6
-rw-r--r--src/tools/miri/tests/fail/intrinsics/ptr_offset_from_different_ints.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/ptr_offset_from_unsigned_neg.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/ptr_offset_int_plus_int.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/ptr_offset_int_plus_ptr.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/ptr_offset_out_of_bounds.stderr6
-rw-r--r--src/tools/miri/tests/fail/intrinsics/ptr_offset_out_of_bounds_neg.stderr6
-rw-r--r--src/tools/miri/tests/fail/intrinsics/ptr_offset_overflow.stderr6
-rw-r--r--src/tools/miri/tests/fail/intrinsics/ptr_offset_unsigned_overflow.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/rem-by-zero.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/simd-div-by-zero.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/simd-div-overflow.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/simd-extract.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/simd-float-to-int.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/simd-gather.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/simd-reduce-invalid-bool.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/simd-rem-by-zero.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/simd-scatter.stderr6
-rw-r--r--src/tools/miri/tests/fail/intrinsics/simd-select-bitmask-invalid.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/simd-select-invalid-bool.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/simd-shl-too-far.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/simd-shr-too-far.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-array.stderr6
-rw-r--r--src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-scalar.stderr6
-rw-r--r--src/tools/miri/tests/fail/intrinsics/unchecked_add1.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/unchecked_add2.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/unchecked_div1.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/unchecked_mul1.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/unchecked_mul2.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/unchecked_shl.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/unchecked_shl2.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/unchecked_shr.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/unchecked_sub1.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/unchecked_sub2.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.stderr2
-rw-r--r--src/tools/miri/tests/fail/intrinsics/write_bytes_overflow.stderr4
-rw-r--r--src/tools/miri/tests/fail/intrinsics/zero_fn_ptr.stderr2
-rw-r--r--src/tools/miri/tests/fail/issue-miri-1112.stderr6
-rw-r--r--src/tools/miri/tests/fail/issue-miri-3288-ice-symbolic-alignment-extern-static.stderr4
-rw-r--r--src/tools/miri/tests/fail/layout_cycle.stderr4
-rw-r--r--src/tools/miri/tests/fail/memleak.stderr4
-rw-r--r--src/tools/miri/tests/fail/memleak_rc.stderr2
-rw-r--r--src/tools/miri/tests/fail/miri_start_wrong_sig.stderr2
-rw-r--r--src/tools/miri/tests/fail/modifying_constants.stderr4
-rw-r--r--src/tools/miri/tests/fail/never_match_never.stderr4
-rw-r--r--src/tools/miri/tests/fail/never_say_never.stderr4
-rw-r--r--src/tools/miri/tests/fail/never_transmute_humans.stderr4
-rw-r--r--src/tools/miri/tests/fail/never_transmute_void.stderr6
-rw-r--r--src/tools/miri/tests/fail/overlapping_assignment.stderr6
-rw-r--r--src/tools/miri/tests/fail/panic/bad_unwind.stderr14
-rw-r--r--src/tools/miri/tests/fail/panic/double_panic.stderr6
-rw-r--r--src/tools/miri/tests/fail/panic/no_std.stderr8
-rw-r--r--src/tools/miri/tests/fail/panic/panic_abort1.stderr4
-rw-r--r--src/tools/miri/tests/fail/panic/panic_abort2.stderr4
-rw-r--r--src/tools/miri/tests/fail/panic/panic_abort3.stderr4
-rw-r--r--src/tools/miri/tests/fail/panic/panic_abort4.stderr4
-rw-r--r--src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr2
-rw-r--r--src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr2
-rw-r--r--src/tools/miri/tests/fail/panic/unwind_panic_abort.stderr4
-rw-r--r--src/tools/miri/tests/fail/provenance/int_copy_looses_provenance0.stderr4
-rw-r--r--src/tools/miri/tests/fail/provenance/int_copy_looses_provenance1.stderr4
-rw-r--r--src/tools/miri/tests/fail/provenance/int_copy_looses_provenance2.stderr4
-rw-r--r--src/tools/miri/tests/fail/provenance/int_copy_looses_provenance3.stderr4
-rw-r--r--src/tools/miri/tests/fail/provenance/pointer_partial_overwrite.stderr4
-rw-r--r--src/tools/miri/tests/fail/provenance/provenance_transmute.stderr6
-rw-r--r--src/tools/miri/tests/fail/provenance/ptr_copy_loses_partial_provenance0.stderr4
-rw-r--r--src/tools/miri/tests/fail/provenance/ptr_copy_loses_partial_provenance1.stderr4
-rw-r--r--src/tools/miri/tests/fail/provenance/ptr_int_unexposed.stderr4
-rw-r--r--src/tools/miri/tests/fail/provenance/ptr_invalid.stderr4
-rw-r--r--src/tools/miri/tests/fail/provenance/ptr_invalid_offset.stderr4
-rw-r--r--src/tools/miri/tests/fail/provenance/strict_provenance_cast.stderr4
-rw-r--r--src/tools/miri/tests/fail/rc_as_ptr.stderr6
-rw-r--r--src/tools/miri/tests/fail/reading_half_a_pointer.stderr4
-rw-r--r--src/tools/miri/tests/fail/rustc-error.stderr2
-rw-r--r--src/tools/miri/tests/fail/rustc-error2.stderr2
-rw-r--r--src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-decl.stderr4
-rw-r--r--src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-flags.stderr4
-rw-r--r--src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-ptr.stderr4
-rw-r--r--src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-resolve-flags.stderr4
-rw-r--r--src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-resolve-names-flags.stderr4
-rw-r--r--src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-size-flags.stderr4
-rw-r--r--src/tools/miri/tests/fail/shims/fs/isolated_file.rs2
-rw-r--r--src/tools/miri/tests/fail/shims/fs/isolated_file.stderr2
-rw-r--r--src/tools/miri/tests/fail/shims/shim_arg_size.stderr4
-rw-r--r--src/tools/miri/tests/fail/should-pass/cpp20_rwc_syncs.stderr6
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/deallocate_against_protector1.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/disable_mut_does_not_merge_srw.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/drop_in_place_protector.stderr10
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/drop_in_place_retag.stderr4
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/exposed_only_ro.stderr4
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/fnentry_invalidation.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/fnentry_invalidation2.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/illegal_dealloc1.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/illegal_read1.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/illegal_read2.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/illegal_read3.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/illegal_read4.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/illegal_read5.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/illegal_read6.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/illegal_read7.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/illegal_read8.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/illegal_read_despite_exposed1.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/illegal_read_despite_exposed2.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/illegal_write2.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/illegal_write3.stderr6
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/illegal_write4.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/illegal_write_despite_exposed1.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/interior_mut1.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/interior_mut2.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/invalidate_against_protector1.stderr10
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/load_invalid_mut.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/pass_invalid_mut.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/pointer_smuggling.stderr10
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/raw_tracking.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/retag_data_race_protected_read.stderr6
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/retag_data_race_read.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut.stderr10
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_option.stderr10
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_tuple.stderr10
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/static_memory_modification.stderr4
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/track_caller.stderr8
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/transmute-is-no-escape.stderr6
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/unescaped_local.stderr4
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/unescaped_static.stderr6
-rw-r--r--src/tools/miri/tests/fail/stacked_borrows/zst_slice.stderr4
-rw-r--r--src/tools/miri/tests/fail/static_memory_modification1.stderr4
-rw-r--r--src/tools/miri/tests/fail/static_memory_modification2.stderr4
-rw-r--r--src/tools/miri/tests/fail/static_memory_modification3.stderr4
-rw-r--r--src/tools/miri/tests/fail/storage-live-dead-var.stderr4
-rw-r--r--src/tools/miri/tests/fail/storage-live-resets-var.stderr4
-rw-r--r--src/tools/miri/tests/fail/tail_calls/signature-mismatch-arg.stderr4
-rw-r--r--src/tools/miri/tests/fail/terminate-terminator.stderr8
-rw-r--r--src/tools/miri/tests/fail/tls/tls_static_dealloc.stderr4
-rw-r--r--src/tools/miri/tests/fail/tls_macro_leak.stderr10
-rw-r--r--src/tools/miri/tests/fail/tls_static_leak.stderr4
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/alternate-read-write.rs3
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/alternate-read-write.stderr10
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/children-can-alias.default.stderr4
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/children-can-alias.uniq.stderr10
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/error-range.stderr8
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/fnentry_invalidation.stderr10
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/outside-range.stderr10
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/parent_read_freezes_raw_mut.stderr10
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/pass_invalid_mut.stderr14
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/protector-write-lazy.stderr8
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.stderr10
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/reserved/cell-protected-write.stderr10
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/reserved/int-protected-write.stderr10
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.with.stderr8
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.without.stderr8
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/return_invalid_mut.stderr12
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/spurious_read.stderr10
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/strongly-protected.stderr12
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/unique.default.stderr10
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/unique.uniq.stderr12
-rw-r--r--src/tools/miri/tests/fail/tree_borrows/write-during-2phase.stderr10
-rw-r--r--src/tools/miri/tests/fail/type-too-large.rs2
-rw-r--r--src/tools/miri/tests/fail/type-too-large.stderr4
-rw-r--r--src/tools/miri/tests/fail/unaligned_pointers/alignment.stderr4
-rw-r--r--src/tools/miri/tests/fail/unaligned_pointers/atomic_unaligned.stderr4
-rw-r--r--src/tools/miri/tests/fail/unaligned_pointers/drop_in_place.stderr2
-rw-r--r--src/tools/miri/tests/fail/unaligned_pointers/dyn_alignment.stderr4
-rw-r--r--src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment.stderr6
-rw-r--r--src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment2.stderr6
-rw-r--r--src/tools/miri/tests/fail/unaligned_pointers/intptrcast_alignment_check.stderr4
-rw-r--r--src/tools/miri/tests/fail/unaligned_pointers/promise_alignment.call_unaligned_ptr.stderr4
-rw-r--r--src/tools/miri/tests/fail/unaligned_pointers/promise_alignment.read_unaligned_ptr.stderr4
-rw-r--r--src/tools/miri/tests/fail/unaligned_pointers/promise_alignment_zero.stderr4
-rw-r--r--src/tools/miri/tests/fail/unaligned_pointers/reference_to_packed.stderr6
-rw-r--r--src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr1.stderr4
-rw-r--r--src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr2.stderr4
-rw-r--r--src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr3.stderr4
-rw-r--r--src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr4.stderr4
-rw-r--r--src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr_zst.stderr4
-rw-r--r--src/tools/miri/tests/fail/unaligned_pointers/unaligned_ref_addr_of.stderr4
-rw-r--r--src/tools/miri/tests/fail/uninit/padding-enum.stderr4
-rw-r--r--src/tools/miri/tests/fail/uninit/padding-pair.stderr4
-rw-r--r--src/tools/miri/tests/fail/uninit/padding-struct-in-union.stderr4
-rw-r--r--src/tools/miri/tests/fail/uninit/padding-struct.stderr4
-rw-r--r--src/tools/miri/tests/fail/uninit/padding-union.stderr4
-rw-r--r--src/tools/miri/tests/fail/uninit/padding-wide-ptr.stderr4
-rw-r--r--src/tools/miri/tests/fail/uninit/transmute-pair-uninit.stderr4
-rw-r--r--src/tools/miri/tests/fail/uninit/uninit-after-aggregate-assign.stderr4
-rw-r--r--src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic.stderr2
-rw-r--r--src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic_with_provenance.stderr2
-rw-r--r--src/tools/miri/tests/fail/uninit/uninit_byte_read.stderr4
-rw-r--r--src/tools/miri/tests/fail/unreachable.stderr4
-rw-r--r--src/tools/miri/tests/fail/unsized-local.stderr4
-rw-r--r--src/tools/miri/tests/fail/unsupported_foreign_function.stderr4
-rw-r--r--src/tools/miri/tests/fail/unwind-action-terminate.stderr6
-rw-r--r--src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_callee_arg.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_callee_ret.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_arg.stderr6
-rw-r--r--src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_ret.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/dangling_ref1.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/dangling_ref2.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/dangling_ref3.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/invalid_bool.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/invalid_bool_op.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/invalid_bool_uninit.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/invalid_char.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/invalid_char_cast.stderr6
-rw-r--r--src/tools/miri/tests/fail/validity/invalid_char_match.stderr6
-rw-r--r--src/tools/miri/tests/fail/validity/invalid_char_op.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/invalid_char_uninit.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/invalid_enum_cast.stderr6
-rw-r--r--src/tools/miri/tests/fail/validity/invalid_enum_op.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/invalid_enum_tag.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/invalid_fnptr_null.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/invalid_fnptr_uninit.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/invalid_int_op.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/invalid_wide_raw.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/match_binder_checks_validity1.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/match_binder_checks_validity2.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/nonzero.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/recursive-validity-ref-bool.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/ref_to_uninhabited1.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/ref_to_uninhabited2.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/too-big-slice.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/too-big-unsized.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/transmute_through_ptr.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/uninit_float.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/uninit_integer.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/uninit_raw_ptr.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/wrong-dyn-trait-generic.stderr4
-rw-r--r--src/tools/miri/tests/fail/validity/wrong-dyn-trait.stderr4
-rw-r--r--src/tools/miri/tests/fail/weak_memory/racing_mixed_size.stderr6
-rw-r--r--src/tools/miri/tests/fail/weak_memory/racing_mixed_size_read.stderr6
-rw-r--r--src/tools/miri/tests/fail/weak_memory/weak_uninit.stderr4
-rw-r--r--src/tools/miri/tests/fail/zst_local_oob.stderr4
-rw-r--r--src/tools/miri/tests/native-lib/fail/function_not_in_so.rs3
-rw-r--r--src/tools/miri/tests/native-lib/fail/function_not_in_so.stderr4
-rw-r--r--src/tools/miri/tests/native-lib/fail/private_function.rs3
-rw-r--r--src/tools/miri/tests/native-lib/fail/private_function.stderr4
-rw-r--r--src/tools/miri/tests/native-lib/pass/ptr_read_access.rs3
-rw-r--r--src/tools/miri/tests/native-lib/pass/scalar_arguments.rs3
-rw-r--r--src/tools/miri/tests/panic/alloc_error_handler_hook.stderr2
-rw-r--r--src/tools/miri/tests/panic/div-by-zero-2.stderr2
-rw-r--r--src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr6
-rw-r--r--src/tools/miri/tests/panic/mir-validation.rs2
-rw-r--r--src/tools/miri/tests/panic/oob_subslice.stderr2
-rw-r--r--src/tools/miri/tests/panic/overflowing-lsh-neg.stderr2
-rw-r--r--src/tools/miri/tests/panic/overflowing-rsh-1.stderr2
-rw-r--r--src/tools/miri/tests/panic/overflowing-rsh-2.stderr2
-rw-r--r--src/tools/miri/tests/panic/panic1.stderr4
-rw-r--r--src/tools/miri/tests/panic/panic2.stderr2
-rw-r--r--src/tools/miri/tests/panic/panic3.stderr2
-rw-r--r--src/tools/miri/tests/panic/panic4.stderr2
-rw-r--r--src/tools/miri/tests/panic/transmute_fat2.stderr2
-rw-r--r--src/tools/miri/tests/panic/unsupported_foreign_function.stderr2
-rw-r--r--src/tools/miri/tests/panic/unsupported_syscall.rs4
-rw-r--r--src/tools/miri/tests/panic/unsupported_syscall.stderr2
-rw-r--r--src/tools/miri/tests/pass-dep/concurrency/apple-os-unfair-lock.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/concurrency/env-cleanup-data-race.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/concurrency/linux-futex.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/concurrency/tls_pthread_drop_order.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/concurrency/windows_detach_terminated.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/concurrency/windows_init_once.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/concurrency/windows_join_multiple.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/extra_fn_ptr_gc.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/libc/fcntl_f-fullfsync_apple.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/libc/gettid.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/libc/libc-affinity.rs4
-rw-r--r--src/tools/miri/tests/pass-dep/libc/libc-epoll-blocking.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/libc/libc-epoll-no-blocking.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/libc/libc-eventfd.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/libc/libc-fs-flock.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/libc/libc-fs-symlink.rs4
-rw-r--r--src/tools/miri/tests/pass-dep/libc/libc-fs-with-isolation.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/libc/libc-fs.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/libc/libc-misc.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/libc/libc-pipe.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/libc/libc-random.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/libc/libc-socketpair.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/libc/libc-time.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/libc/libc_pthread_cond_timedwait.rs4
-rw-r--r--src/tools/miri/tests/pass-dep/libc/libc_pthread_cond_timedwait_isolated.rs4
-rw-r--r--src/tools/miri/tests/pass-dep/libc/mmap.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/libc/pthread-sync.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/libc/pthread-threadname.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/tempfile.rs4
-rw-r--r--src/tools/miri/tests/pass-dep/tokio/file-io.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/tokio/mpsc-await.rs2
-rw-r--r--src/tools/miri/tests/pass-dep/tokio/sleep.rs2
-rw-r--r--src/tools/miri/tests/pass/alloc-access-tracking.rs2
-rw-r--r--src/tools/miri/tests/pass/alloc-access-tracking.stderr14
-rw-r--r--src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stderr10
-rw-r--r--src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stdout10
-rw-r--r--src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stderr10
-rw-r--r--src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stdout10
-rw-r--r--src/tools/miri/tests/pass/backtrace/backtrace-global-alloc.stderr2
-rw-r--r--src/tools/miri/tests/pass/backtrace/backtrace-std.stderr10
-rw-r--r--src/tools/miri/tests/pass/concurrency/thread_park_isolated.rs2
-rw-r--r--src/tools/miri/tests/pass/extern_types.stack.stderr4
-rw-r--r--src/tools/miri/tests/pass/function_calls/target_feature.rs2
-rw-r--r--src/tools/miri/tests/pass/issues/issue-miri-3680.rs2
-rw-r--r--src/tools/miri/tests/pass/miri-alloc.rs2
-rw-r--r--src/tools/miri/tests/pass/panic/catch_panic.stderr20
-rw-r--r--src/tools/miri/tests/pass/panic/concurrent-panic.stderr4
-rw-r--r--src/tools/miri/tests/pass/panic/nested_panic_caught.stderr4
-rw-r--r--src/tools/miri/tests/pass/panic/thread_panic.stderr4
-rw-r--r--src/tools/miri/tests/pass/panic/unwind_dwarf.rs2
-rw-r--r--src/tools/miri/tests/pass/ptr_int_casts.tree.stderr36
-rw-r--r--src/tools/miri/tests/pass/ptr_int_from_exposed.tree.stderr6
-rw-r--r--src/tools/miri/tests/pass/shims/fs-symlink.rs4
-rw-r--r--src/tools/miri/tests/pass/shims/fs-with-isolation.rs2
-rw-r--r--src/tools/miri/tests/pass/shims/fs.rs2
-rw-r--r--src/tools/miri/tests/pass/shims/windows-rand.rs2
-rw-r--r--src/tools/miri/tests/pass/shims/windows-threadname.rs2
-rw-r--r--src/tools/miri/tests/pass/shims/x86/intrinsics-sha.rs11
-rw-r--r--src/tools/miri/tests/pass/shims/x86/intrinsics-x86-adx.rs11
-rw-r--r--src/tools/miri/tests/pass/shims/x86/intrinsics-x86-aes-vaes.rs11
-rw-r--r--src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx.rs11
-rw-r--r--src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx2.rs11
-rw-r--r--src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx512.rs11
-rw-r--r--src/tools/miri/tests/pass/shims/x86/intrinsics-x86-bmi.rs11
-rw-r--r--src/tools/miri/tests/pass/shims/x86/intrinsics-x86-pause-without-sse2.rs11
-rw-r--r--src/tools/miri/tests/pass/shims/x86/intrinsics-x86-pclmulqdq.rs11
-rw-r--r--src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse3-ssse3.rs11
-rw-r--r--src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse41.rs11
-rw-r--r--src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse42.rs11
-rw-r--r--src/tools/miri/tests/pass/stacked-borrows/issue-miri-2389.stderr4
-rw-r--r--src/tools/miri/tests/pass/tls/macos_tlv_atexit.rs2
-rw-r--r--src/tools/miri/tests/pass/tls/win_tls_callback.rs2
-rw-r--r--src/tools/miri/tests/pass/wtf8.rs2
-rw-r--r--src/tools/miri/tests/ui.rs120
709 files changed, 1884 insertions, 1991 deletions
diff --git a/src/tools/miri/Cargo.lock b/src/tools/miri/Cargo.lock
index e4bfd9bd122..002c44b0cc5 100644
--- a/src/tools/miri/Cargo.lock
+++ b/src/tools/miri/Cargo.lock
@@ -39,22 +39,19 @@ dependencies = [
 
 [[package]]
 name = "annotate-snippets"
-version = "0.9.2"
+version = "0.11.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ccaf7e9dfbb6ab22c82e473cd1a8a7bd313c19a5b7e40970f3d89ef5a5c9e81e"
+checksum = "24e35ed54e5ea7997c14ed4c70ba043478db1112e98263b3b035907aa197d991"
 dependencies = [
+ "anstyle",
  "unicode-width",
- "yansi-term",
 ]
 
 [[package]]
-name = "ansi_term"
-version = "0.12.1"
+name = "anstyle"
+version = "1.0.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
-dependencies = [
- "winapi",
-]
+checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1"
 
 [[package]]
 name = "anyhow"
@@ -126,9 +123,9 @@ dependencies = [
 
 [[package]]
 name = "cargo_metadata"
-version = "0.15.4"
+version = "0.18.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a"
+checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037"
 dependencies = [
  "camino",
  "cargo-platform",
@@ -737,11 +734,11 @@ dependencies = [
 
 [[package]]
 name = "prettydiff"
-version = "0.6.4"
+version = "0.7.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ff1fec61082821f8236cf6c0c14e8172b62ce8a72a0eedc30d3b247bb68dc11"
+checksum = "abec3fb083c10660b3854367697da94c674e9e82aa7511014dc958beeb7215e9"
 dependencies = [
- "ansi_term",
+ "owo-colors",
  "pad",
 ]
 
@@ -865,14 +862,14 @@ dependencies = [
 
 [[package]]
 name = "rustfix"
-version = "0.6.1"
+version = "0.8.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ecd2853d9e26988467753bd9912c3a126f642d05d229a4b53f5752ee36c56481"
+checksum = "70f5b7fc8060f4f8373f9381a630304b42e1183535d9beb1d3f596b236c9106a"
 dependencies = [
- "anyhow",
- "log",
  "serde",
  "serde_json",
+ "thiserror",
+ "tracing",
 ]
 
 [[package]]
@@ -963,6 +960,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
 
 [[package]]
+name = "spanned"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "86af297923fbcfd107c20a189a6e9c872160df71a7190ae4a7a6c5dce4b2feb6"
+dependencies = [
+ "bstr",
+ "color-eyre",
+]
+
+[[package]]
 name = "syn"
 version = "2.0.72"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1065,9 +1072,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
 
 [[package]]
 name = "ui_test"
-version = "0.21.2"
+version = "0.26.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aaf4bf7c184b8dfc7a4d3b90df789b1eb992ee42811cd115f32a7a1eb781058d"
+checksum = "32ee4c40e5a5f9fa6864ff976473e5d6a6e9884b6ce68b40690d9f87e1994c83"
 dependencies = [
  "annotate-snippets",
  "anyhow",
@@ -1079,7 +1086,6 @@ dependencies = [
  "comma",
  "crossbeam-channel",
  "indicatif",
- "lazy_static",
  "levenshtein",
  "prettydiff",
  "regex",
@@ -1087,7 +1093,7 @@ dependencies = [
  "rustfix",
  "serde",
  "serde_json",
- "tempfile",
+ "spanned",
 ]
 
 [[package]]
@@ -1121,28 +1127,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
 
 [[package]]
-name = "winapi"
-version = "0.3.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
-dependencies = [
- "winapi-i686-pc-windows-gnu",
- "winapi-x86_64-pc-windows-gnu",
-]
-
-[[package]]
-name = "winapi-i686-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
-
-[[package]]
-name = "winapi-x86_64-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
-
-[[package]]
 name = "windows-sys"
 version = "0.48.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1282,15 +1266,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
 
 [[package]]
-name = "yansi-term"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe5c30ade05e61656247b2e334a031dfd0cc466fadef865bdcdea8d537951bf1"
-dependencies = [
- "winapi",
-]
-
-[[package]]
 name = "zerocopy"
 version = "0.7.35"
 source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/src/tools/miri/Cargo.toml b/src/tools/miri/Cargo.toml
index d8cfa5b886d..30cea9da373 100644
--- a/src/tools/miri/Cargo.toml
+++ b/src/tools/miri/Cargo.toml
@@ -49,7 +49,7 @@ windows-sys = { version = "0.52", features = [
 
 [dev-dependencies]
 colored = "2"
-ui_test = "0.21.1"
+ui_test = "0.26.5"
 rustc_version = "0.4"
 regex = "1.5.5"
 tempfile = "3"
diff --git a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.rs b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.rs
index d6604f37139..546909a13ea 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.rs
@@ -1,4 +1,4 @@
-//@ only-target-darwin
+//@only-target: darwin
 
 use std::cell::UnsafeCell;
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.stderr b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.stderr
index 7e890681c43..3fd02d38aae 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.stderr
@@ -1,11 +1,11 @@
 error: abnormal termination: called os_unfair_lock_assert_not_owner on an os_unfair_lock owned by the current thread
-  --> $DIR/apple_os_unfair_lock_assert_not_owner.rs:LL:CC
+  --> tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.rs:LL:CC
    |
 LL |         libc::os_unfair_lock_assert_not_owner(lock.get());
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ called os_unfair_lock_assert_not_owner on an os_unfair_lock owned by the current thread
    |
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/apple_os_unfair_lock_assert_not_owner.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/concurrency/apple_os_unfair_lock_assert_not_owner.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.rs b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.rs
index ddd8b572eaf..4cbd34329f8 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.rs
@@ -1,4 +1,4 @@
-//@ only-target-darwin
+//@only-target: darwin
 
 use std::cell::UnsafeCell;
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.stderr b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.stderr
index 3724f7996fb..0b5dfe4ba61 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.stderr
@@ -1,11 +1,11 @@
 error: abnormal termination: called os_unfair_lock_assert_owner on an os_unfair_lock not owned by the current thread
-  --> $DIR/apple_os_unfair_lock_assert_owner.rs:LL:CC
+  --> tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.rs:LL:CC
    |
 LL |         libc::os_unfair_lock_assert_owner(lock.get());
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ called os_unfair_lock_assert_owner on an os_unfair_lock not owned by the current thread
    |
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/apple_os_unfair_lock_assert_owner.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/concurrency/apple_os_unfair_lock_assert_owner.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.rs b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.rs
index eb98adeba07..a13e8573395 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.rs
@@ -1,4 +1,4 @@
-//@ only-target-darwin
+//@only-target: darwin
 
 use std::cell::UnsafeCell;
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.stderr b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.stderr
index 644462a1b05..3b02936b1f2 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.stderr
@@ -1,11 +1,11 @@
 error: abnormal termination: attempted to lock an os_unfair_lock that is already locked by the current thread
-  --> $DIR/apple_os_unfair_lock_reentrant.rs:LL:CC
+  --> tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.rs:LL:CC
    |
 LL |         libc::os_unfair_lock_lock(lock.get());
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempted to lock an os_unfair_lock that is already locked by the current thread
    |
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/apple_os_unfair_lock_reentrant.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/concurrency/apple_os_unfair_lock_reentrant.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.rs b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.rs
index aed467552ab..2bef8bcca4d 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.rs
@@ -1,4 +1,4 @@
-//@ only-target-darwin
+//@only-target: darwin
 
 use std::cell::UnsafeCell;
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.stderr b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.stderr
index 6a8d12fa807..192e1cdc475 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.stderr
@@ -1,11 +1,11 @@
 error: abnormal termination: attempted to unlock an os_unfair_lock not owned by the current thread
-  --> $DIR/apple_os_unfair_lock_unowned.rs:LL:CC
+  --> tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.rs:LL:CC
    |
 LL |         libc::os_unfair_lock_unlock(lock.get());
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempted to unlock an os_unfair_lock not owned by the current thread
    |
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/apple_os_unfair_lock_unowned.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/concurrency/apple_os_unfair_lock_unowned.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.rs
index f22f17be0df..047fe07df14 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 
 /// Test that destroying a pthread_cond twice fails, even without a check for number validity
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.stderr
index 899c217efbf..4cf1b4af12a 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
-  --> $DIR/libc_pthread_cond_double_destroy.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.rs:LL:CC
    |
 LL |         libc::pthread_cond_destroy(cond.as_mut_ptr());
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
@@ -7,7 +7,7 @@ LL |         libc::pthread_cond_destroy(cond.as_mut_ptr());
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/libc_pthread_cond_double_destroy.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_cond_double_destroy.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.init.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.init.stderr
index a15451cb319..6e90c490a23 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.init.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.init.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: pthread_cond_t can't be moved after first use
-  --> $DIR/libc_pthread_cond_move.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC
    |
 LL |         libc::pthread_cond_destroy(cond2.as_mut_ptr());
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pthread_cond_t can't be moved after first use
@@ -7,9 +7,9 @@ LL |         libc::pthread_cond_destroy(cond2.as_mut_ptr());
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `check` at $DIR/libc_pthread_cond_move.rs:LL:CC
+   = note: inside `check` at tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC
 note: inside `main`
-  --> $DIR/libc_pthread_cond_move.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC
    |
 LL |     check()
    |     ^^^^^^^
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.rs
index e4e84eb9fd0..8fd0caac751 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.rs
@@ -1,5 +1,5 @@
 //@revisions: static_initializer init
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 
 /// Test that moving a pthread_cond between uses fails.
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.static_initializer.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.static_initializer.stderr
index 4e4188e2a12..ba726ac7f38 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.static_initializer.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_cond_move.static_initializer.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: pthread_cond_t can't be moved after first use
-  --> $DIR/libc_pthread_cond_move.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC
    |
 LL |         libc::pthread_cond_destroy(&mut cond2 as *mut _);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pthread_cond_t can't be moved after first use
@@ -7,9 +7,9 @@ LL |         libc::pthread_cond_destroy(&mut cond2 as *mut _);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `check` at $DIR/libc_pthread_cond_move.rs:LL:CC
+   = note: inside `check` at tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC
 note: inside `main`
-  --> $DIR/libc_pthread_cond_move.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_cond_move.rs:LL:CC
    |
 LL |     check()
    |     ^^^^^^^
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.rs
index d0ccab4de5b..90e33d58673 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.rs
@@ -1,5 +1,5 @@
-//@ignore-target-windows: No pthreads on Windows
-//@ignore-target-apple: Our macOS condattr don't have any fields so we do not notice this.
+//@ignore-target: windows # No pthreads on Windows
+//@ignore-target: apple # Our macOS condattr don't have any fields so we do not notice this.
 
 /// Test that destroying a pthread_condattr twice fails, even without a check for number validity
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.stderr
index ef75b03162d..f2ddf9ae92e 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
-  --> $DIR/libc_pthread_condattr_double_destroy.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.rs:LL:CC
    |
 LL |         libc::pthread_condattr_destroy(attr.as_mut_ptr());
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
@@ -7,7 +7,7 @@ LL |         libc::pthread_condattr_destroy(attr.as_mut_ptr());
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/libc_pthread_condattr_double_destroy.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_condattr_double_destroy.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_main_terminate.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_main_terminate.rs
index 9cd0a35d36e..d4a9f076bfd 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_main_terminate.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_main_terminate.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 //@error-in-other-file: the main thread terminated without waiting for all remaining threads
 
 // Check that we terminate the program when the main thread terminates.
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_few_args.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_few_args.rs
index 39b1c3007cb..d4accdba5d7 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_few_args.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_few_args.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 //~^ERROR: calling a function with more arguments than it expected
 
 //! The thread function must have exactly one argument.
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_many_args.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_many_args.rs
index fc2ab71dff7..0af3600854d 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_many_args.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_create_too_many_args.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 //~^ERROR: calling a function with fewer arguments than it requires
 
 //! The thread function must have exactly one argument.
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_detached.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_detached.rs
index e89d7a9f02b..472d07f617e 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_detached.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_detached.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 
 // Joining a detached thread is undefined behavior.
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_detached.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_detached.stderr
index 7238dfb40b7..327737a0b3f 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_detached.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_detached.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to join a detached thread
-  --> $DIR/libc_pthread_join_detached.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_join_detached.rs:LL:CC
    |
 LL |         assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0);
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join a detached thread
@@ -7,7 +7,7 @@ LL |         assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/libc_pthread_join_detached.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_join_detached.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_joined.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_joined.rs
index cbad743ca56..988c33868a6 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_joined.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_joined.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 
 // Joining an already joined thread is undefined behavior.
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_joined.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_joined.stderr
index e501a086cca..1dd1cb9f731 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_joined.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_joined.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to join an already joined thread
-  --> $DIR/libc_pthread_join_joined.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_join_joined.rs:LL:CC
    |
 LL |         assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0);
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join an already joined thread
@@ -7,7 +7,7 @@ LL |         assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/libc_pthread_join_joined.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_join_joined.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_main.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_main.rs
index 002498e6c82..b47c0121a3e 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_main.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_main.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 
 // Joining the main thread is undefined behavior.
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_main.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_main.stderr
index e27e88dda2d..b04a18561fd 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_main.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_main.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to join a detached thread
-  --> $DIR/libc_pthread_join_main.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_join_main.rs:LL:CC
    |
 LL |             assert_eq!(libc::pthread_join(thread_id, ptr::null_mut()), 0);
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join a detached thread
@@ -7,7 +7,7 @@ LL |             assert_eq!(libc::pthread_join(thread_id, ptr::null_mut()), 0);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE on thread `unnamed-ID`:
-   = note: inside closure at $DIR/libc_pthread_join_main.rs:LL:CC
+   = note: inside closure at tests/fail-dep/concurrency/libc_pthread_join_main.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_multiple.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_multiple.rs
index f5b687a623f..6a49625d75d 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_multiple.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_multiple.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 
 // Joining the same thread from multiple threads is undefined behavior.
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_multiple.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_multiple.stderr
index 6a7b237e5b3..1ada476811e 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_multiple.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_multiple.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to join an already joined thread
-  --> $DIR/libc_pthread_join_multiple.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_join_multiple.rs:LL:CC
    |
 LL | ...   assert_eq!(libc::pthread_join(native_copy, ptr::null_mut()), 0);
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join an already joined thread
@@ -7,7 +7,7 @@ LL | ...   assert_eq!(libc::pthread_join(native_copy, ptr::null_mut()), 0);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE on thread `unnamed-ID`:
-   = note: inside closure at $DIR/libc_pthread_join_multiple.rs:LL:CC
+   = note: inside closure at tests/fail-dep/concurrency/libc_pthread_join_multiple.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_self.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_self.rs
index 4bc1c82a254..53760b05a31 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_self.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_self.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 // We are making scheduler assumptions here.
 //@compile-flags: -Zmiri-preemption-rate=0
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_self.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_self.stderr
index 258c5f26c7a..6aa85086a83 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_self.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_join_self.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to join itself
-  --> $DIR/libc_pthread_join_self.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_join_self.rs:LL:CC
    |
 LL |             assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0);
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join itself
@@ -7,7 +7,7 @@ LL |             assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE on thread `unnamed-ID`:
-   = note: inside closure at $DIR/libc_pthread_join_self.rs:LL:CC
+   = note: inside closure at tests/fail-dep/concurrency/libc_pthread_join_self.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_NULL_deadlock.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_NULL_deadlock.rs
index 0a494c53b4b..a79abe65328 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_NULL_deadlock.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_NULL_deadlock.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 //
 // Check that if we pass NULL attribute, then we get the default mutex type.
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_NULL_deadlock.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_NULL_deadlock.stderr
index 3675ce49f30..e9961ed413d 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_NULL_deadlock.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_NULL_deadlock.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to acquire already locked default mutex
-  --> $DIR/libc_pthread_mutex_NULL_deadlock.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_mutex_NULL_deadlock.rs:LL:CC
    |
 LL |         libc::pthread_mutex_lock(&mut mutex as *mut _);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to acquire already locked default mutex
@@ -7,7 +7,7 @@ LL |         libc::pthread_mutex_lock(&mut mutex as *mut _);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/libc_pthread_mutex_NULL_deadlock.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_mutex_NULL_deadlock.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.rs
index 0328115c637..e3d5da26aea 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 //@error-in-other-file: deadlock
 
 use std::cell::UnsafeCell;
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.stderr
index 079c1729b60..534cacaed59 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.stderr
@@ -1,11 +1,11 @@
 error: deadlock: the evaluated program deadlocked
-  --> $DIR/libc_pthread_mutex_deadlock.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.rs:LL:CC
    |
 LL |             assert_eq!(libc::pthread_mutex_lock(lock_copy.0.get() as *mut _), 0);
    |                                                                            ^ the evaluated program deadlocked
    |
    = note: BACKTRACE on thread `unnamed-ID`:
-   = note: inside closure at $DIR/libc_pthread_mutex_deadlock.rs:LL:CC
+   = note: inside closure at tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.rs:LL:CC
 
 error: deadlock: the evaluated program deadlocked
   --> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
@@ -18,7 +18,7 @@ LL |         let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) };
    = note: inside `std::thread::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC
    = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC
 note: inside `main`
-  --> $DIR/libc_pthread_mutex_deadlock.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_mutex_deadlock.rs:LL:CC
    |
 LL | /         thread::spawn(move || {
 LL | |             assert_eq!(libc::pthread_mutex_lock(lock_copy.0.get() as *mut _), 0);
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_default_deadlock.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_default_deadlock.rs
index 6723f2c6e77..d9293f938b6 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_default_deadlock.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_default_deadlock.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 //
 // Check that if we do not set the mutex type, it is the default.
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_default_deadlock.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_default_deadlock.stderr
index 4d41141b545..a57d10753d9 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_default_deadlock.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_default_deadlock.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to acquire already locked default mutex
-  --> $DIR/libc_pthread_mutex_default_deadlock.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_mutex_default_deadlock.rs:LL:CC
    |
 LL |         libc::pthread_mutex_lock(&mut mutex as *mut _);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to acquire already locked default mutex
@@ -7,7 +7,7 @@ LL |         libc::pthread_mutex_lock(&mut mutex as *mut _);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/libc_pthread_mutex_default_deadlock.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_mutex_default_deadlock.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_destroy_locked.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_destroy_locked.rs
index e474712cfd9..35998c95f6f 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_destroy_locked.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_destroy_locked.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 
 fn main() {
     unsafe {
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_destroy_locked.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_destroy_locked.stderr
index ed5e27b607a..38f38b4283a 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_destroy_locked.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_destroy_locked.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: destroyed a locked mutex
-  --> $DIR/libc_pthread_mutex_destroy_locked.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_mutex_destroy_locked.rs:LL:CC
    |
 LL |         libc::pthread_mutex_destroy(&mut mutex as *mut _);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ destroyed a locked mutex
@@ -7,7 +7,7 @@ LL |         libc::pthread_mutex_destroy(&mut mutex as *mut _);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/libc_pthread_mutex_destroy_locked.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_mutex_destroy_locked.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.rs
index 46f0c5f8d72..1792c227e13 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 
 /// Test that destroying a pthread_mutex twice fails, even without a check for number validity
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.stderr
index 05b35ee3b30..72ad2db75aa 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
-  --> $DIR/libc_pthread_mutex_double_destroy.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.rs:LL:CC
    |
 LL |         libc::pthread_mutex_destroy(mutex.as_mut_ptr());
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
@@ -7,7 +7,7 @@ LL |         libc::pthread_mutex_destroy(mutex.as_mut_ptr());
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/libc_pthread_mutex_double_destroy.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_mutex_double_destroy.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.init.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.init.stderr
index 5ca6acc3fbe..15f397d4ac2 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.init.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.init.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: pthread_mutex_t can't be moved after first use
-  --> $DIR/libc_pthread_mutex_move.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_mutex_move.rs:LL:CC
    |
 LL |         libc::pthread_mutex_lock(&mut m2 as *mut _);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pthread_mutex_t can't be moved after first use
@@ -7,9 +7,9 @@ LL |         libc::pthread_mutex_lock(&mut m2 as *mut _);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `check` at $DIR/libc_pthread_mutex_move.rs:LL:CC
+   = note: inside `check` at tests/fail-dep/concurrency/libc_pthread_mutex_move.rs:LL:CC
 note: inside `main`
-  --> $DIR/libc_pthread_mutex_move.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_mutex_move.rs:LL:CC
    |
 LL |     check();
    |     ^^^^^^^
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.rs
index 229335c97ce..c12a97a9ca1 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 //@revisions: static_initializer init
 
 fn main() {
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.static_initializer.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.static_initializer.stderr
index c3632eca43f..ebc253bf7a6 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.static_initializer.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_move.static_initializer.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: pthread_mutex_t can't be moved after first use
-  --> $DIR/libc_pthread_mutex_move.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_mutex_move.rs:LL:CC
    |
 LL |         libc::pthread_mutex_unlock(&mut m2 as *mut _);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pthread_mutex_t can't be moved after first use
@@ -7,9 +7,9 @@ LL |         libc::pthread_mutex_unlock(&mut m2 as *mut _);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `check` at $DIR/libc_pthread_mutex_move.rs:LL:CC
+   = note: inside `check` at tests/fail-dep/concurrency/libc_pthread_mutex_move.rs:LL:CC
 note: inside `main`
-  --> $DIR/libc_pthread_mutex_move.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_mutex_move.rs:LL:CC
    |
 LL |     check();
    |     ^^^^^^^
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_deadlock.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_deadlock.rs
index f311934e28b..b38582482b8 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_deadlock.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_deadlock.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 
 fn main() {
     unsafe {
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_deadlock.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_deadlock.stderr
index 334c14ebf04..4337475963e 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_deadlock.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_deadlock.stderr
@@ -1,11 +1,11 @@
 error: deadlock: the evaluated program deadlocked
-  --> $DIR/libc_pthread_mutex_normal_deadlock.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_mutex_normal_deadlock.rs:LL:CC
    |
 LL |         libc::pthread_mutex_lock(&mut mutex as *mut _);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program deadlocked
    |
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/libc_pthread_mutex_normal_deadlock.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_mutex_normal_deadlock.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_unlock_unlocked.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_unlock_unlocked.rs
index 2b5886dc163..50b55049050 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_unlock_unlocked.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_unlock_unlocked.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 
 fn main() {
     unsafe {
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_unlock_unlocked.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_unlock_unlocked.stderr
index d717b4ec56b..db08496889e 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_unlock_unlocked.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_normal_unlock_unlocked.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: unlocked a PTHREAD_MUTEX_NORMAL mutex that was not locked by the current thread
-  --> $DIR/libc_pthread_mutex_normal_unlock_unlocked.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_mutex_normal_unlock_unlocked.rs:LL:CC
    |
 LL |         libc::pthread_mutex_unlock(&mut mutex as *mut _);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unlocked a PTHREAD_MUTEX_NORMAL mutex that was not locked by the current thread
@@ -7,7 +7,7 @@ LL |         libc::pthread_mutex_unlock(&mut mutex as *mut _);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/libc_pthread_mutex_normal_unlock_unlocked.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_mutex_normal_unlock_unlocked.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.rs
index 686a394f7cb..84c72fd9ba1 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 
 use std::cell::UnsafeCell;
 use std::sync::Arc;
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.stderr
index b8ec2d6d018..97c92e828e6 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: unlocked a default mutex that was not locked by the current thread
-  --> $DIR/libc_pthread_mutex_wrong_owner.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.rs:LL:CC
    |
 LL | ...t_eq!(libc::pthread_mutex_unlock(lock_copy.0.get() as *mut _), 0);
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unlocked a default mutex that was not locked by the current thread
@@ -7,7 +7,7 @@ LL | ...t_eq!(libc::pthread_mutex_unlock(lock_copy.0.get() as *mut _), 0);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE on thread `unnamed-ID`:
-   = note: inside closure at $DIR/libc_pthread_mutex_wrong_owner.rs:LL:CC
+   = note: inside closure at tests/fail-dep/concurrency/libc_pthread_mutex_wrong_owner.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.rs
index 51f00d62b75..3711c1f8dc1 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 
 /// Test that destroying a pthread_mutexattr twice fails, even without a check for number validity
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.stderr
index a8425e6f81d..4c39ca003ec 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
-  --> $DIR/libc_pthread_mutexattr_double_destroy.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.rs:LL:CC
    |
 LL |         libc::pthread_mutexattr_destroy(attr.as_mut_ptr());
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
@@ -7,7 +7,7 @@ LL |         libc::pthread_mutexattr_destroy(attr.as_mut_ptr());
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/libc_pthread_mutexattr_double_destroy.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_mutexattr_double_destroy.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_read_locked.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_read_locked.rs
index fa4575bc1d4..f2c19f98103 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_read_locked.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_read_locked.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 
 fn main() {
     let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER);
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_read_locked.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_read_locked.stderr
index bb90545c503..0a964da82a6 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_read_locked.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_read_locked.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: destroyed a locked rwlock
-  --> $DIR/libc_pthread_rwlock_destroy_read_locked.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_read_locked.rs:LL:CC
    |
 LL |         libc::pthread_rwlock_destroy(rw.get());
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ destroyed a locked rwlock
@@ -7,7 +7,7 @@ LL |         libc::pthread_rwlock_destroy(rw.get());
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/libc_pthread_rwlock_destroy_read_locked.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_read_locked.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_write_locked.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_write_locked.rs
index e734a62bca8..200477467af 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_write_locked.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_write_locked.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 
 fn main() {
     let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER);
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_write_locked.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_write_locked.stderr
index 7210c6a742a..cfdadbefe4e 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_write_locked.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_write_locked.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: destroyed a locked rwlock
-  --> $DIR/libc_pthread_rwlock_destroy_write_locked.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_write_locked.rs:LL:CC
    |
 LL |         libc::pthread_rwlock_destroy(rw.get());
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ destroyed a locked rwlock
@@ -7,7 +7,7 @@ LL |         libc::pthread_rwlock_destroy(rw.get());
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/libc_pthread_rwlock_destroy_write_locked.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_rwlock_destroy_write_locked.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.rs
index e96f7fc6803..6a31e972e68 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 
 /// Test that destroying a pthread_rwlock twice fails, even without a check for number validity
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.stderr
index 5032e98f116..41c189f3efd 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
-  --> $DIR/libc_pthread_rwlock_double_destroy.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.rs:LL:CC
    |
 LL |         libc::pthread_rwlock_destroy(&mut lock);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
@@ -7,7 +7,7 @@ LL |         libc::pthread_rwlock_destroy(&mut lock);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/libc_pthread_rwlock_double_destroy.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_rwlock_double_destroy.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.rs
index dffeee2b794..5de70cb38a1 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 
 fn main() {
     let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER);
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.stderr
index 957458a7ba0..5b5d35bf195 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.stderr
@@ -1,11 +1,11 @@
 error: deadlock: the evaluated program deadlocked
-  --> $DIR/libc_pthread_rwlock_read_write_deadlock_single_thread.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.rs:LL:CC
    |
 LL |         libc::pthread_rwlock_wrlock(rw.get());
    |                                             ^ the evaluated program deadlocked
    |
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/libc_pthread_rwlock_read_write_deadlock_single_thread.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_rwlock_read_write_deadlock_single_thread.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.rs
index 328372b22ef..d59c9423818 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 
 use std::cell::UnsafeCell;
 use std::sync::Arc;
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.stderr
index a964a64284a..d2fccfcc3f0 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: unlocked an rwlock that was not locked by the active thread
-  --> $DIR/libc_pthread_rwlock_read_wrong_owner.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.rs:LL:CC
    |
 LL | ...   assert_eq!(libc::pthread_rwlock_unlock(lock_copy.0.get() as *mut _), 0);
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unlocked an rwlock that was not locked by the active thread
@@ -7,7 +7,7 @@ LL | ...   assert_eq!(libc::pthread_rwlock_unlock(lock_copy.0.get() as *mut _),
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE on thread `unnamed-ID`:
-   = note: inside closure at $DIR/libc_pthread_rwlock_read_wrong_owner.rs:LL:CC
+   = note: inside closure at tests/fail-dep/concurrency/libc_pthread_rwlock_read_wrong_owner.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_unlock_unlocked.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_unlock_unlocked.rs
index ced6b7a4f61..ca0444a7b43 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_unlock_unlocked.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_unlock_unlocked.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 
 fn main() {
     let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER);
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_unlock_unlocked.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_unlock_unlocked.stderr
index 98b09472904..da2a650151d 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_unlock_unlocked.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_unlock_unlocked.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: unlocked an rwlock that was not locked by the active thread
-  --> $DIR/libc_pthread_rwlock_unlock_unlocked.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_rwlock_unlock_unlocked.rs:LL:CC
    |
 LL |         libc::pthread_rwlock_unlock(rw.get());
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unlocked an rwlock that was not locked by the active thread
@@ -7,7 +7,7 @@ LL |         libc::pthread_rwlock_unlock(rw.get());
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/libc_pthread_rwlock_unlock_unlocked.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_rwlock_unlock_unlocked.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.rs
index 4174751926d..3a985122e22 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 //@error-in-other-file: deadlock
 
 use std::cell::UnsafeCell;
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.stderr
index d03c6402d64..ae77d79fcd4 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.stderr
@@ -1,11 +1,11 @@
 error: deadlock: the evaluated program deadlocked
-  --> $DIR/libc_pthread_rwlock_write_read_deadlock.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.rs:LL:CC
    |
 LL |             assert_eq!(libc::pthread_rwlock_wrlock(lock_copy.0.get() as *mut _), 0);
    |                                                                               ^ the evaluated program deadlocked
    |
    = note: BACKTRACE on thread `unnamed-ID`:
-   = note: inside closure at $DIR/libc_pthread_rwlock_write_read_deadlock.rs:LL:CC
+   = note: inside closure at tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.rs:LL:CC
 
 error: deadlock: the evaluated program deadlocked
   --> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
@@ -18,7 +18,7 @@ LL |         let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) };
    = note: inside `std::thread::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC
    = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC
 note: inside `main`
-  --> $DIR/libc_pthread_rwlock_write_read_deadlock.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock.rs:LL:CC
    |
 LL | /         thread::spawn(move || {
 LL | |             assert_eq!(libc::pthread_rwlock_wrlock(lock_copy.0.get() as *mut _), 0);
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.rs
index 099b8dcd106..708192ddccc 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 
 fn main() {
     let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER);
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.stderr
index d6cceaff166..24c1a993652 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.stderr
@@ -1,11 +1,11 @@
 error: deadlock: the evaluated program deadlocked
-  --> $DIR/libc_pthread_rwlock_write_read_deadlock_single_thread.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.rs:LL:CC
    |
 LL |         libc::pthread_rwlock_rdlock(rw.get());
    |                                             ^ the evaluated program deadlocked
    |
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/libc_pthread_rwlock_write_read_deadlock_single_thread.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_rwlock_write_read_deadlock_single_thread.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.rs
index 43b3ab09bb2..6d7bb80d8e6 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 //@error-in-other-file: deadlock
 
 use std::cell::UnsafeCell;
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.stderr
index 73c5e77a1bc..4f463464130 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.stderr
@@ -1,11 +1,11 @@
 error: deadlock: the evaluated program deadlocked
-  --> $DIR/libc_pthread_rwlock_write_write_deadlock.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.rs:LL:CC
    |
 LL |             assert_eq!(libc::pthread_rwlock_wrlock(lock_copy.0.get() as *mut _), 0);
    |                                                                               ^ the evaluated program deadlocked
    |
    = note: BACKTRACE on thread `unnamed-ID`:
-   = note: inside closure at $DIR/libc_pthread_rwlock_write_write_deadlock.rs:LL:CC
+   = note: inside closure at tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.rs:LL:CC
 
 error: deadlock: the evaluated program deadlocked
   --> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
@@ -18,7 +18,7 @@ LL |         let ret = unsafe { libc::pthread_join(id, ptr::null_mut()) };
    = note: inside `std::thread::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC
    = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC
 note: inside `main`
-  --> $DIR/libc_pthread_rwlock_write_write_deadlock.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock.rs:LL:CC
    |
 LL | /         thread::spawn(move || {
 LL | |             assert_eq!(libc::pthread_rwlock_wrlock(lock_copy.0.get() as *mut _), 0);
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.rs
index 2704ff15441..c7bacbacd87 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 
 fn main() {
     let rw = std::cell::UnsafeCell::new(libc::PTHREAD_RWLOCK_INITIALIZER);
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.stderr
index 3ba99e3db4a..e76ce84e757 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.stderr
@@ -1,11 +1,11 @@
 error: deadlock: the evaluated program deadlocked
-  --> $DIR/libc_pthread_rwlock_write_write_deadlock_single_thread.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.rs:LL:CC
    |
 LL |         libc::pthread_rwlock_wrlock(rw.get());
    |                                             ^ the evaluated program deadlocked
    |
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/libc_pthread_rwlock_write_write_deadlock_single_thread.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/concurrency/libc_pthread_rwlock_write_write_deadlock_single_thread.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.rs b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.rs
index 9a2cd09f083..21559e2e58f 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 
 use std::cell::UnsafeCell;
 use std::sync::Arc;
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.stderr b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.stderr
index c9c22dea655..906311144e8 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: unlocked an rwlock that was not locked by the active thread
-  --> $DIR/libc_pthread_rwlock_write_wrong_owner.rs:LL:CC
+  --> tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.rs:LL:CC
    |
 LL | ...   assert_eq!(libc::pthread_rwlock_unlock(lock_copy.0.get() as *mut _), 0);
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unlocked an rwlock that was not locked by the active thread
@@ -7,7 +7,7 @@ LL | ...   assert_eq!(libc::pthread_rwlock_unlock(lock_copy.0.get() as *mut _),
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE on thread `unnamed-ID`:
-   = note: inside closure at $DIR/libc_pthread_rwlock_write_wrong_owner.rs:LL:CC
+   = note: inside closure at tests/fail-dep/concurrency/libc_pthread_rwlock_write_wrong_owner.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libx_pthread_rwlock_moved.rs b/src/tools/miri/tests/fail-dep/concurrency/libx_pthread_rwlock_moved.rs
index b51bae79849..540729962a9 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libx_pthread_rwlock_moved.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/libx_pthread_rwlock_moved.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 
 fn main() {
     unsafe {
diff --git a/src/tools/miri/tests/fail-dep/concurrency/libx_pthread_rwlock_moved.stderr b/src/tools/miri/tests/fail-dep/concurrency/libx_pthread_rwlock_moved.stderr
index 8a5ec4aa98d..ce08fa8159c 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/libx_pthread_rwlock_moved.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/libx_pthread_rwlock_moved.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: pthread_rwlock_t can't be moved after first use
-  --> $DIR/libx_pthread_rwlock_moved.rs:LL:CC
+  --> tests/fail-dep/concurrency/libx_pthread_rwlock_moved.rs:LL:CC
    |
 LL |         libc::pthread_rwlock_unlock(&mut rw2 as *mut _);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pthread_rwlock_t can't be moved after first use
@@ -7,7 +7,7 @@ LL |         libc::pthread_rwlock_unlock(&mut rw2 as *mut _);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/libx_pthread_rwlock_moved.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/concurrency/libx_pthread_rwlock_moved.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/concurrency/windows_join_detached.rs b/src/tools/miri/tests/fail-dep/concurrency/windows_join_detached.rs
index 0e9eb24459c..63e7eb113dd 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/windows_join_detached.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/windows_join_detached.rs
@@ -1,4 +1,4 @@
-//@only-target-windows: Uses win32 api functions
+//@only-target: windows # Uses win32 api functions
 //@error-in-other-file: Undefined Behavior: trying to join a detached thread
 
 // Joining a detached thread is undefined behavior.
diff --git a/src/tools/miri/tests/fail-dep/concurrency/windows_join_detached.stderr b/src/tools/miri/tests/fail-dep/concurrency/windows_join_detached.stderr
index 19bfe56395e..947d665b95a 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/windows_join_detached.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/windows_join_detached.stderr
@@ -11,7 +11,7 @@ LL |         let rc = unsafe { c::WaitForSingleObject(self.handle.as_raw_handle(
    = note: inside `std::thread::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC
    = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC
 note: inside `main`
-  --> $DIR/windows_join_detached.rs:LL:CC
+  --> tests/fail-dep/concurrency/windows_join_detached.rs:LL:CC
    |
 LL |     thread.join().unwrap();
    |     ^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail-dep/concurrency/windows_join_main.rs b/src/tools/miri/tests/fail-dep/concurrency/windows_join_main.rs
index 532bda20136..e28b0343135 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/windows_join_main.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/windows_join_main.rs
@@ -1,4 +1,4 @@
-//@only-target-windows: Uses win32 api functions
+//@only-target: windows # Uses win32 api functions
 // We are making scheduler assumptions here.
 //@compile-flags: -Zmiri-preemption-rate=0
 //@error-in-other-file: deadlock
diff --git a/src/tools/miri/tests/fail-dep/concurrency/windows_join_main.stderr b/src/tools/miri/tests/fail-dep/concurrency/windows_join_main.stderr
index 12f35fdeb02..23a9f8f9c28 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/windows_join_main.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/windows_join_main.stderr
@@ -1,5 +1,5 @@
 error: deadlock: the evaluated program deadlocked
-  --> $DIR/windows_join_main.rs:LL:CC
+  --> tests/fail-dep/concurrency/windows_join_main.rs:LL:CC
    |
 LL |             assert_eq!(WaitForSingleObject(MAIN_THREAD, INFINITE), WAIT_OBJECT_0);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program deadlocked
@@ -19,7 +19,7 @@ LL |         let rc = unsafe { c::WaitForSingleObject(self.handle.as_raw_handle(
    = note: inside `std::thread::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC
    = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC
 note: inside `main`
-  --> $DIR/windows_join_main.rs:LL:CC
+  --> tests/fail-dep/concurrency/windows_join_main.rs:LL:CC
    |
 LL | /     thread::spawn(|| {
 LL | |         unsafe {
diff --git a/src/tools/miri/tests/fail-dep/concurrency/windows_join_self.rs b/src/tools/miri/tests/fail-dep/concurrency/windows_join_self.rs
index a64265ca0ca..4d48e839bb4 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/windows_join_self.rs
+++ b/src/tools/miri/tests/fail-dep/concurrency/windows_join_self.rs
@@ -1,4 +1,4 @@
-//@only-target-windows: Uses win32 api functions
+//@only-target: windows # Uses win32 api functions
 // We are making scheduler assumptions here.
 //@compile-flags: -Zmiri-preemption-rate=0
 //@error-in-other-file: deadlock
diff --git a/src/tools/miri/tests/fail-dep/concurrency/windows_join_self.stderr b/src/tools/miri/tests/fail-dep/concurrency/windows_join_self.stderr
index 8d26c35de8a..4e640296dbe 100644
--- a/src/tools/miri/tests/fail-dep/concurrency/windows_join_self.stderr
+++ b/src/tools/miri/tests/fail-dep/concurrency/windows_join_self.stderr
@@ -1,11 +1,11 @@
 error: deadlock: the evaluated program deadlocked
-  --> $DIR/windows_join_self.rs:LL:CC
+  --> tests/fail-dep/concurrency/windows_join_self.rs:LL:CC
    |
 LL |             assert_eq!(WaitForSingleObject(native, INFINITE), WAIT_OBJECT_0);
    |                                                            ^ the evaluated program deadlocked
    |
    = note: BACKTRACE on thread `unnamed-ID`:
-   = note: inside closure at $DIR/windows_join_self.rs:LL:CC
+   = note: inside closure at tests/fail-dep/concurrency/windows_join_self.rs:LL:CC
 
 error: deadlock: the evaluated program deadlocked
   --> RUSTLIB/std/src/sys/pal/PLATFORM/thread.rs:LL:CC
@@ -18,7 +18,7 @@ LL |         let rc = unsafe { c::WaitForSingleObject(self.handle.as_raw_handle(
    = note: inside `std::thread::JoinInner::<'_, ()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC
    = note: inside `std::thread::JoinHandle::<()>::join` at RUSTLIB/std/src/thread/mod.rs:LL:CC
 note: inside `main`
-  --> $DIR/windows_join_self.rs:LL:CC
+  --> tests/fail-dep/concurrency/windows_join_self.rs:LL:CC
    |
 LL | /     thread::spawn(|| {
 LL | |         unsafe {
diff --git a/src/tools/miri/tests/fail-dep/libc/affinity.rs b/src/tools/miri/tests/fail-dep/libc/affinity.rs
index c41d1d18018..d7d5c59e1bc 100644
--- a/src/tools/miri/tests/fail-dep/libc/affinity.rs
+++ b/src/tools/miri/tests/fail-dep/libc/affinity.rs
@@ -1,5 +1,5 @@
-//@ignore-target-windows: only very limited libc on Windows
-//@ignore-target-apple: `sched_setaffinity` is not supported on macOS
+//@ignore-target: windows # only very limited libc on Windows
+//@ignore-target: apple # `sched_setaffinity` is not supported on macOS
 //@compile-flags: -Zmiri-disable-isolation -Zmiri-num-cpus=4
 
 fn main() {
diff --git a/src/tools/miri/tests/fail-dep/libc/affinity.stderr b/src/tools/miri/tests/fail-dep/libc/affinity.stderr
index 38414623ccb..5a226c6a44b 100644
--- a/src/tools/miri/tests/fail-dep/libc/affinity.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/affinity.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: expected a pointer to 129 bytes of memory, but got ALLOC which is only 128 bytes from the end of the allocation
-  --> $DIR/affinity.rs:LL:CC
+  --> tests/fail-dep/libc/affinity.rs:LL:CC
    |
 LL |     let err = unsafe { sched_setaffinity(PID, size_of::<cpu_set_t>() + 1, &cpuset) };
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 129 bytes of memory, but got ALLOC which is only 128 bytes from the end of the allocation
@@ -7,12 +7,12 @@ LL |     let err = unsafe { sched_setaffinity(PID, size_of::<cpu_set_t>() + 1, &
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/affinity.rs:LL:CC
+  --> tests/fail-dep/libc/affinity.rs:LL:CC
    |
 LL |     let cpuset: cpu_set_t = unsafe { core::mem::MaybeUninit::zeroed().assume_init() };
    |         ^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/affinity.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/affinity.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/aligned_alloc_size_zero_leak.rs b/src/tools/miri/tests/fail-dep/libc/aligned_alloc_size_zero_leak.rs
index 9a33cdccd27..0caba9059ef 100644
--- a/src/tools/miri/tests/fail-dep/libc/aligned_alloc_size_zero_leak.rs
+++ b/src/tools/miri/tests/fail-dep/libc/aligned_alloc_size_zero_leak.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: Windows does not support the standard C11 aligned_alloc.
+//@ignore-target: windows # Windows does not support the standard C11 aligned_alloc.
 
 fn main() {
     // libc doesn't have this function (https://github.com/rust-lang/libc/issues/3689),
diff --git a/src/tools/miri/tests/fail-dep/libc/aligned_alloc_size_zero_leak.stderr b/src/tools/miri/tests/fail-dep/libc/aligned_alloc_size_zero_leak.stderr
index 91c67823320..bde7f5b515e 100644
--- a/src/tools/miri/tests/fail-dep/libc/aligned_alloc_size_zero_leak.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/aligned_alloc_size_zero_leak.stderr
@@ -1,11 +1,11 @@
 error: memory leaked: ALLOC (C heap, size: 0, align: 2), allocated here:
-  --> $DIR/aligned_alloc_size_zero_leak.rs:LL:CC
+  --> tests/fail-dep/libc/aligned_alloc_size_zero_leak.rs:LL:CC
    |
 LL |         aligned_alloc(2, 0);
    |         ^^^^^^^^^^^^^^^^^^^
    |
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/aligned_alloc_size_zero_leak.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/aligned_alloc_size_zero_leak.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/env-set_var-data-race.rs b/src/tools/miri/tests/fail-dep/libc/env-set_var-data-race.rs
index a1895feb957..c7d8bacd379 100644
--- a/src/tools/miri/tests/fail-dep/libc/env-set_var-data-race.rs
+++ b/src/tools/miri/tests/fail-dep/libc/env-set_var-data-race.rs
@@ -1,5 +1,5 @@
 //@compile-flags: -Zmiri-disable-isolation -Zmiri-preemption-rate=0
-//@ignore-target-windows: No libc env support on Windows
+//@ignore-target: windows # No libc env support on Windows
 
 use std::env;
 use std::thread;
diff --git a/src/tools/miri/tests/fail-dep/libc/env-set_var-data-race.stderr b/src/tools/miri/tests/fail-dep/libc/env-set_var-data-race.stderr
index f85234f5627..904a1677b80 100644
--- a/src/tools/miri/tests/fail-dep/libc/env-set_var-data-race.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/env-set_var-data-race.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `main` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/env-set_var-data-race.rs:LL:CC
+  --> tests/fail-dep/libc/env-set_var-data-race.rs:LL:CC
    |
 LL |         libc::getenv(b"TZ/0".as_ptr().cast());
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) non-atomic write on thread `main` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/env-set_var-data-race.rs:LL:CC
+  --> tests/fail-dep/libc/env-set_var-data-race.rs:LL:CC
    |
 LL |     env::set_var("MY_RUST_VAR", "Ferris");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/env-set_var-data-race.rs:LL:CC
+   = note: inside closure at tests/fail-dep/libc/env-set_var-data-race.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/fs/close_stdout.rs b/src/tools/miri/tests/fail-dep/libc/fs/close_stdout.rs
index 42b7e2b7838..7911133f548 100644
--- a/src/tools/miri/tests/fail-dep/libc/fs/close_stdout.rs
+++ b/src/tools/miri/tests/fail-dep/libc/fs/close_stdout.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No libc IO on Windows
+//@ignore-target: windows # No libc IO on Windows
 //@compile-flags: -Zmiri-disable-isolation
 
 // FIXME: standard handles cannot be closed (https://github.com/rust-lang/rust/issues/40032)
diff --git a/src/tools/miri/tests/fail-dep/libc/fs/close_stdout.stderr b/src/tools/miri/tests/fail-dep/libc/fs/close_stdout.stderr
index e1b1b053bbc..029eeab4044 100644
--- a/src/tools/miri/tests/fail-dep/libc/fs/close_stdout.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/fs/close_stdout.stderr
@@ -1,12 +1,12 @@
 error: unsupported operation: cannot close stdout
-  --> $DIR/close_stdout.rs:LL:CC
+  --> tests/fail-dep/libc/fs/close_stdout.rs:LL:CC
    |
 LL |         libc::close(1);
    |         ^^^^^^^^^^^^^^ cannot close stdout
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/close_stdout.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/fs/close_stdout.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/fs/isolated_stdin.rs b/src/tools/miri/tests/fail-dep/libc/fs/isolated_stdin.rs
index 3c62015a051..3ef194c5c71 100644
--- a/src/tools/miri/tests/fail-dep/libc/fs/isolated_stdin.rs
+++ b/src/tools/miri/tests/fail-dep/libc/fs/isolated_stdin.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No libc IO on Windows
+//@ignore-target: windows # No libc IO on Windows
 
 fn main() -> std::io::Result<()> {
     let mut bytes = [0u8; 512];
diff --git a/src/tools/miri/tests/fail-dep/libc/fs/isolated_stdin.stderr b/src/tools/miri/tests/fail-dep/libc/fs/isolated_stdin.stderr
index 9abe145ea9e..bb7e8cef5dc 100644
--- a/src/tools/miri/tests/fail-dep/libc/fs/isolated_stdin.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/fs/isolated_stdin.stderr
@@ -1,5 +1,5 @@
 error: unsupported operation: `read` from stdin not available when isolation is enabled
-  --> $DIR/isolated_stdin.rs:LL:CC
+  --> tests/fail-dep/libc/fs/isolated_stdin.rs:LL:CC
    |
 LL |         libc::read(0, bytes.as_mut_ptr() as *mut libc::c_void, 512);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `read` from stdin not available when isolation is enabled
@@ -7,7 +7,7 @@ LL |         libc::read(0, bytes.as_mut_ptr() as *mut libc::c_void, 512);
    = help: set `MIRIFLAGS=-Zmiri-disable-isolation` to disable isolation;
    = help: or set `MIRIFLAGS=-Zmiri-isolation-error=warn` to make Miri return an error code from isolated operations (if supported for that operation) and continue with a warning
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/isolated_stdin.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/fs/isolated_stdin.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/fs/mkstemp_immutable_arg.rs b/src/tools/miri/tests/fail-dep/libc/fs/mkstemp_immutable_arg.rs
index 6d951a3a7b3..2c676f12b4f 100644
--- a/src/tools/miri/tests/fail-dep/libc/fs/mkstemp_immutable_arg.rs
+++ b/src/tools/miri/tests/fail-dep/libc/fs/mkstemp_immutable_arg.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No mkstemp on Windows
+//@ignore-target: windows # No mkstemp on Windows
 //@compile-flags: -Zmiri-disable-isolation
 
 fn main() {
diff --git a/src/tools/miri/tests/fail-dep/libc/fs/mkstemp_immutable_arg.stderr b/src/tools/miri/tests/fail-dep/libc/fs/mkstemp_immutable_arg.stderr
index 7a2757557ef..9227bddf5a8 100644
--- a/src/tools/miri/tests/fail-dep/libc/fs/mkstemp_immutable_arg.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/fs/mkstemp_immutable_arg.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: writing to ALLOC which is read-only
-  --> $DIR/mkstemp_immutable_arg.rs:LL:CC
+  --> tests/fail-dep/libc/fs/mkstemp_immutable_arg.rs:LL:CC
    |
 LL |     let _fd = unsafe { libc::mkstemp(s) };
    |                        ^^^^^^^^^^^^^^^^ writing to ALLOC which is read-only
@@ -7,9 +7,9 @@ LL |     let _fd = unsafe { libc::mkstemp(s) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `test_mkstemp_immutable_arg` at $DIR/mkstemp_immutable_arg.rs:LL:CC
+   = note: inside `test_mkstemp_immutable_arg` at tests/fail-dep/libc/fs/mkstemp_immutable_arg.rs:LL:CC
 note: inside `main`
-  --> $DIR/mkstemp_immutable_arg.rs:LL:CC
+  --> tests/fail-dep/libc/fs/mkstemp_immutable_arg.rs:LL:CC
    |
 LL |     test_mkstemp_immutable_arg();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail-dep/libc/fs/read_from_stdout.rs b/src/tools/miri/tests/fail-dep/libc/fs/read_from_stdout.rs
index 624f584a0c8..ff95beb3a9f 100644
--- a/src/tools/miri/tests/fail-dep/libc/fs/read_from_stdout.rs
+++ b/src/tools/miri/tests/fail-dep/libc/fs/read_from_stdout.rs
@@ -1,5 +1,5 @@
 //@compile-flags: -Zmiri-disable-isolation
-//@ignore-target-windows: No libc IO on Windows
+//@ignore-target: windows # No libc IO on Windows
 
 fn main() -> std::io::Result<()> {
     let mut bytes = [0u8; 512];
diff --git a/src/tools/miri/tests/fail-dep/libc/fs/read_from_stdout.stderr b/src/tools/miri/tests/fail-dep/libc/fs/read_from_stdout.stderr
index baa6eb5ad6a..1be2f08dd8c 100644
--- a/src/tools/miri/tests/fail-dep/libc/fs/read_from_stdout.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/fs/read_from_stdout.stderr
@@ -1,12 +1,12 @@
 error: unsupported operation: cannot read from stdout
-  --> $DIR/read_from_stdout.rs:LL:CC
+  --> tests/fail-dep/libc/fs/read_from_stdout.rs:LL:CC
    |
 LL |         libc::read(1, bytes.as_mut_ptr() as *mut libc::c_void, 512);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot read from stdout
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/read_from_stdout.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/fs/read_from_stdout.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/fs/unix_open_missing_required_mode.rs b/src/tools/miri/tests/fail-dep/libc/fs/unix_open_missing_required_mode.rs
index d783967f959..b763121080e 100644
--- a/src/tools/miri/tests/fail-dep/libc/fs/unix_open_missing_required_mode.rs
+++ b/src/tools/miri/tests/fail-dep/libc/fs/unix_open_missing_required_mode.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No libc IO on Windows
+//@ignore-target: windows # No libc IO on Windows
 //@compile-flags: -Zmiri-disable-isolation
 
 fn main() {
diff --git a/src/tools/miri/tests/fail-dep/libc/fs/unix_open_missing_required_mode.stderr b/src/tools/miri/tests/fail-dep/libc/fs/unix_open_missing_required_mode.stderr
index 0988eefe222..971a2d76053 100644
--- a/src/tools/miri/tests/fail-dep/libc/fs/unix_open_missing_required_mode.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/fs/unix_open_missing_required_mode.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: incorrect number of arguments for `open` with `O_CREAT`: got 2, expected at least 3
-  --> $DIR/unix_open_missing_required_mode.rs:LL:CC
+  --> tests/fail-dep/libc/fs/unix_open_missing_required_mode.rs:LL:CC
    |
 LL | ...safe { libc::open(name_ptr, libc::O_CREAT) };
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of arguments for `open` with `O_CREAT`: got 2, expected at least 3
@@ -7,9 +7,9 @@ LL | ...safe { libc::open(name_ptr, libc::O_CREAT) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `test_file_open_missing_needed_mode` at $DIR/unix_open_missing_required_mode.rs:LL:CC
+   = note: inside `test_file_open_missing_needed_mode` at tests/fail-dep/libc/fs/unix_open_missing_required_mode.rs:LL:CC
 note: inside `main`
-  --> $DIR/unix_open_missing_required_mode.rs:LL:CC
+  --> tests/fail-dep/libc/fs/unix_open_missing_required_mode.rs:LL:CC
    |
 LL |     test_file_open_missing_needed_mode();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail-dep/libc/fs/write_to_stdin.rs b/src/tools/miri/tests/fail-dep/libc/fs/write_to_stdin.rs
index 683c55e90e1..81e5034f117 100644
--- a/src/tools/miri/tests/fail-dep/libc/fs/write_to_stdin.rs
+++ b/src/tools/miri/tests/fail-dep/libc/fs/write_to_stdin.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No libc IO on Windows
+//@ignore-target: windows # No libc IO on Windows
 
 fn main() -> std::io::Result<()> {
     let bytes = b"hello";
diff --git a/src/tools/miri/tests/fail-dep/libc/fs/write_to_stdin.stderr b/src/tools/miri/tests/fail-dep/libc/fs/write_to_stdin.stderr
index 37323faf560..9726a1d2a97 100644
--- a/src/tools/miri/tests/fail-dep/libc/fs/write_to_stdin.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/fs/write_to_stdin.stderr
@@ -1,12 +1,12 @@
 error: unsupported operation: cannot write to stdin
-  --> $DIR/write_to_stdin.rs:LL:CC
+  --> tests/fail-dep/libc/fs/write_to_stdin.rs:LL:CC
    |
 LL |         libc::write(0, bytes.as_ptr() as *const libc::c_void, 5);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot write to stdin
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/write_to_stdin.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/fs/write_to_stdin.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/libc-read-and-uninit-premature-eof.rs b/src/tools/miri/tests/fail-dep/libc/libc-read-and-uninit-premature-eof.rs
index 98ef454c88b..dd2dd346231 100644
--- a/src/tools/miri/tests/fail-dep/libc/libc-read-and-uninit-premature-eof.rs
+++ b/src/tools/miri/tests/fail-dep/libc/libc-read-and-uninit-premature-eof.rs
@@ -1,6 +1,6 @@
 //! We test that if we requested to read 4 bytes, but actually read 3 bytes,
 //! then 3 bytes (not 4) will be initialized.
-//@ignore-target-windows: no file system support on Windows
+//@ignore-target: windows # no file system support on Windows
 //@compile-flags: -Zmiri-disable-isolation
 
 use std::ffi::CString;
diff --git a/src/tools/miri/tests/fail-dep/libc/libc-read-and-uninit-premature-eof.stderr b/src/tools/miri/tests/fail-dep/libc/libc-read-and-uninit-premature-eof.stderr
index e4c7aba07e3..980d9810abc 100644
--- a/src/tools/miri/tests/fail-dep/libc/libc-read-and-uninit-premature-eof.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/libc-read-and-uninit-premature-eof.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value at .value[3]: encountered uninitialized memory, but expected an integer
-  --> $DIR/libc-read-and-uninit-premature-eof.rs:LL:CC
+  --> tests/fail-dep/libc/libc-read-and-uninit-premature-eof.rs:LL:CC
    |
 LL | ...   buf.assume_init();
    |       ^^^^^^^^^^^^^^^^^ constructing invalid value at .value[3]: encountered uninitialized memory, but expected an integer
@@ -7,7 +7,7 @@ LL | ...   buf.assume_init();
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/libc-read-and-uninit-premature-eof.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/libc-read-and-uninit-premature-eof.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/libc_epoll_unsupported_fd.rs b/src/tools/miri/tests/fail-dep/libc/libc_epoll_unsupported_fd.rs
index fb2426f7b66..03d4b2d6633 100644
--- a/src/tools/miri/tests/fail-dep/libc/libc_epoll_unsupported_fd.rs
+++ b/src/tools/miri/tests/fail-dep/libc/libc_epoll_unsupported_fd.rs
@@ -1,4 +1,4 @@
-//@only-target-linux
+//@only-target: linux
 
 // This is a test for registering unsupported fd with epoll.
 // Register epoll fd with epoll is allowed in real system, but we do not support this.
diff --git a/src/tools/miri/tests/fail-dep/libc/libc_epoll_unsupported_fd.stderr b/src/tools/miri/tests/fail-dep/libc/libc_epoll_unsupported_fd.stderr
index 6f9b988d4ee..59797145c20 100644
--- a/src/tools/miri/tests/fail-dep/libc/libc_epoll_unsupported_fd.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/libc_epoll_unsupported_fd.stderr
@@ -1,12 +1,12 @@
 error: unsupported operation: epoll: epoll does not support this file description
-  --> $DIR/libc_epoll_unsupported_fd.rs:LL:CC
+  --> tests/fail-dep/libc/libc_epoll_unsupported_fd.rs:LL:CC
    |
 LL |     let res = unsafe { libc::epoll_ctl(epfd0, libc::EPOLL_CTL_ADD, epfd1, &mut ev) };
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ epoll: epoll does not support this file description
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/libc_epoll_unsupported_fd.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/libc_epoll_unsupported_fd.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/libc_eventfd_read_block.rs b/src/tools/miri/tests/fail-dep/libc/libc_eventfd_read_block.rs
index fb9a23206c6..0212a63bd0f 100644
--- a/src/tools/miri/tests/fail-dep/libc/libc_eventfd_read_block.rs
+++ b/src/tools/miri/tests/fail-dep/libc/libc_eventfd_read_block.rs
@@ -1,4 +1,4 @@
-//@only-target-linux
+//@only-target: linux
 fn main() {
     // eventfd read will block when EFD_NONBLOCK flag is clear and counter = 0.
     // This will pass when blocking is implemented.
diff --git a/src/tools/miri/tests/fail-dep/libc/libc_eventfd_read_block.stderr b/src/tools/miri/tests/fail-dep/libc/libc_eventfd_read_block.stderr
index fdd0b4272ca..aff30c81ebd 100644
--- a/src/tools/miri/tests/fail-dep/libc/libc_eventfd_read_block.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/libc_eventfd_read_block.stderr
@@ -1,12 +1,12 @@
 error: unsupported operation: eventfd: blocking is unsupported
-  --> $DIR/libc_eventfd_read_block.rs:LL:CC
+  --> tests/fail-dep/libc/libc_eventfd_read_block.rs:LL:CC
    |
 LL |         libc::read(fd, buf.as_mut_ptr().cast(), buf.len() as libc::size_t).try_into().unwrap()
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ eventfd: blocking is unsupported
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/libc_eventfd_read_block.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/libc_eventfd_read_block.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/libc_eventfd_write_block.rs b/src/tools/miri/tests/fail-dep/libc/libc_eventfd_write_block.rs
index 2037a516dea..ed6ad466901 100644
--- a/src/tools/miri/tests/fail-dep/libc/libc_eventfd_write_block.rs
+++ b/src/tools/miri/tests/fail-dep/libc/libc_eventfd_write_block.rs
@@ -1,4 +1,4 @@
-//@only-target-linux
+//@only-target: linux
 fn main() {
     // eventfd write will block when EFD_NONBLOCK flag is clear
     // and the addition caused counter to exceed u64::MAX - 1.
diff --git a/src/tools/miri/tests/fail-dep/libc/libc_eventfd_write_block.stderr b/src/tools/miri/tests/fail-dep/libc/libc_eventfd_write_block.stderr
index f12c0ddfb17..2b606605794 100644
--- a/src/tools/miri/tests/fail-dep/libc/libc_eventfd_write_block.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/libc_eventfd_write_block.stderr
@@ -1,12 +1,12 @@
 error: unsupported operation: eventfd: blocking is unsupported
-  --> $DIR/libc_eventfd_write_block.rs:LL:CC
+  --> tests/fail-dep/libc/libc_eventfd_write_block.rs:LL:CC
    |
 LL |         libc::write(fd, sized_8_data.as_ptr() as *const libc::c_void, 8).try_into().unwrap()
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ eventfd: blocking is unsupported
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/libc_eventfd_write_block.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/libc_eventfd_write_block.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/malloc_zero_double_free.stderr b/src/tools/miri/tests/fail-dep/libc/malloc_zero_double_free.stderr
index 6437c9dbeb4..d6337c059ba 100644
--- a/src/tools/miri/tests/fail-dep/libc/malloc_zero_double_free.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/malloc_zero_double_free.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling
-  --> $DIR/malloc_zero_double_free.rs:LL:CC
+  --> tests/fail-dep/libc/malloc_zero_double_free.rs:LL:CC
    |
 LL |         libc::free(ptr);
    |         ^^^^^^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling
@@ -7,17 +7,17 @@ LL |         libc::free(ptr);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/malloc_zero_double_free.rs:LL:CC
+  --> tests/fail-dep/libc/malloc_zero_double_free.rs:LL:CC
    |
 LL |         let ptr = libc::malloc(0);
    |                   ^^^^^^^^^^^^^^^
 help: ALLOC was deallocated here:
-  --> $DIR/malloc_zero_double_free.rs:LL:CC
+  --> tests/fail-dep/libc/malloc_zero_double_free.rs:LL:CC
    |
 LL |         libc::free(ptr);
    |         ^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/malloc_zero_double_free.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/malloc_zero_double_free.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/malloc_zero_memory_leak.stderr b/src/tools/miri/tests/fail-dep/libc/malloc_zero_memory_leak.stderr
index 657262b8d41..6f3d7fa7a4f 100644
--- a/src/tools/miri/tests/fail-dep/libc/malloc_zero_memory_leak.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/malloc_zero_memory_leak.stderr
@@ -1,11 +1,11 @@
 error: memory leaked: ALLOC (C heap, size: 0, align: 1), allocated here:
-  --> $DIR/malloc_zero_memory_leak.rs:LL:CC
+  --> tests/fail-dep/libc/malloc_zero_memory_leak.rs:LL:CC
    |
 LL |         let _ptr = libc::malloc(0);
    |                    ^^^^^^^^^^^^^^^
    |
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/malloc_zero_memory_leak.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/malloc_zero_memory_leak.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/memchr_null.stderr b/src/tools/miri/tests/fail-dep/libc/memchr_null.stderr
index f03ae33ed9f..6d3ff176c35 100644
--- a/src/tools/miri/tests/fail-dep/libc/memchr_null.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/memchr_null.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: out-of-bounds pointer use: expected a pointer to some allocation, but got a null pointer
-  --> $DIR/memchr_null.rs:LL:CC
+  --> tests/fail-dep/libc/memchr_null.rs:LL:CC
    |
 LL |         libc::memchr(ptr::null(), 0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: expected a pointer to some allocation, but got a null pointer
@@ -7,7 +7,7 @@ LL |         libc::memchr(ptr::null(), 0, 0);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/memchr_null.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/memchr_null.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/memcmp_null.stderr b/src/tools/miri/tests/fail-dep/libc/memcmp_null.stderr
index 4bca5a3db07..a4ca205c377 100644
--- a/src/tools/miri/tests/fail-dep/libc/memcmp_null.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/memcmp_null.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: out-of-bounds pointer use: expected a pointer to some allocation, but got a null pointer
-  --> $DIR/memcmp_null.rs:LL:CC
+  --> tests/fail-dep/libc/memcmp_null.rs:LL:CC
    |
 LL |         libc::memcmp(ptr::null(), ptr::null(), 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: expected a pointer to some allocation, but got a null pointer
@@ -7,7 +7,7 @@ LL |         libc::memcmp(ptr::null(), ptr::null(), 0);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/memcmp_null.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/memcmp_null.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/memcmp_zero.stderr b/src/tools/miri/tests/fail-dep/libc/memcmp_zero.stderr
index 6adaaeb3dbf..d7b046c1823 100644
--- a/src/tools/miri/tests/fail-dep/libc/memcmp_zero.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/memcmp_zero.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: out-of-bounds pointer use: expected a pointer to some allocation, but got 0x2a[noalloc] which is a dangling pointer (it has no provenance)
-  --> $DIR/memcmp_zero.rs:LL:CC
+  --> tests/fail-dep/libc/memcmp_zero.rs:LL:CC
    |
 LL |         libc::memcmp(ptr.cast(), ptr.cast(), 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: expected a pointer to some allocation, but got 0x2a[noalloc] which is a dangling pointer (it has no provenance)
@@ -7,7 +7,7 @@ LL |         libc::memcmp(ptr.cast(), ptr.cast(), 0);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/memcmp_zero.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/memcmp_zero.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/memcpy_zero.stderr b/src/tools/miri/tests/fail-dep/libc/memcpy_zero.stderr
index b2da332df21..336113e3440 100644
--- a/src/tools/miri/tests/fail-dep/libc/memcpy_zero.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/memcpy_zero.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: out-of-bounds pointer use: expected a pointer to some allocation, but got 0x17[noalloc] which is a dangling pointer (it has no provenance)
-  --> $DIR/memcpy_zero.rs:LL:CC
+  --> tests/fail-dep/libc/memcpy_zero.rs:LL:CC
    |
 LL |         libc::memcpy(to.cast(), from.cast(), 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: expected a pointer to some allocation, but got 0x17[noalloc] which is a dangling pointer (it has no provenance)
@@ -7,7 +7,7 @@ LL |         libc::memcpy(to.cast(), from.cast(), 0);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/memcpy_zero.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/memcpy_zero.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/memrchr_null.rs b/src/tools/miri/tests/fail-dep/libc/memrchr_null.rs
index 1fe637d6ce7..8b34ff4ac2e 100644
--- a/src/tools/miri/tests/fail-dep/libc/memrchr_null.rs
+++ b/src/tools/miri/tests/fail-dep/libc/memrchr_null.rs
@@ -1,5 +1,5 @@
-//@ignore-target-windows: No `memrchr` on Windows
-//@ignore-target-apple: No `memrchr` on some apple targets
+//@ignore-target: windows # No `memrchr` on Windows
+//@ignore-target: apple # No `memrchr` on some apple targets
 
 use std::ptr;
 
diff --git a/src/tools/miri/tests/fail-dep/libc/memrchr_null.stderr b/src/tools/miri/tests/fail-dep/libc/memrchr_null.stderr
index a9ed58d61bb..ce759f3e17a 100644
--- a/src/tools/miri/tests/fail-dep/libc/memrchr_null.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/memrchr_null.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: out-of-bounds pointer use: expected a pointer to some allocation, but got a null pointer
-  --> $DIR/memrchr_null.rs:LL:CC
+  --> tests/fail-dep/libc/memrchr_null.rs:LL:CC
    |
 LL |         libc::memrchr(ptr::null(), 0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: expected a pointer to some allocation, but got a null pointer
@@ -7,7 +7,7 @@ LL |         libc::memrchr(ptr::null(), 0, 0);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/memrchr_null.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/memrchr_null.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/mmap_invalid_dealloc.rs b/src/tools/miri/tests/fail-dep/libc/mmap_invalid_dealloc.rs
index 9d55a493554..53ca14e6e89 100644
--- a/src/tools/miri/tests/fail-dep/libc/mmap_invalid_dealloc.rs
+++ b/src/tools/miri/tests/fail-dep/libc/mmap_invalid_dealloc.rs
@@ -1,5 +1,5 @@
 //@compile-flags: -Zmiri-disable-isolation
-//@ignore-target-windows: No mmap on Windows
+//@ignore-target: windows # No mmap on Windows
 
 #![feature(rustc_private)]
 
diff --git a/src/tools/miri/tests/fail-dep/libc/mmap_invalid_dealloc.stderr b/src/tools/miri/tests/fail-dep/libc/mmap_invalid_dealloc.stderr
index cec67b6ef84..193c9f1eccc 100644
--- a/src/tools/miri/tests/fail-dep/libc/mmap_invalid_dealloc.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/mmap_invalid_dealloc.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: deallocating ALLOC, which is mmap memory, using C heap deallocation operation
-  --> $DIR/mmap_invalid_dealloc.rs:LL:CC
+  --> tests/fail-dep/libc/mmap_invalid_dealloc.rs:LL:CC
    |
 LL |         libc::free(ptr);
    |         ^^^^^^^^^^^^^^^ deallocating ALLOC, which is mmap memory, using C heap deallocation operation
@@ -7,7 +7,7 @@ LL |         libc::free(ptr);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/mmap_invalid_dealloc.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/mmap_invalid_dealloc.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/mmap_use_after_munmap.rs b/src/tools/miri/tests/fail-dep/libc/mmap_use_after_munmap.rs
index 05ac232f5d7..6831734a31b 100644
--- a/src/tools/miri/tests/fail-dep/libc/mmap_use_after_munmap.rs
+++ b/src/tools/miri/tests/fail-dep/libc/mmap_use_after_munmap.rs
@@ -1,5 +1,5 @@
 //@compile-flags: -Zmiri-disable-isolation
-//@ignore-target-windows: No mmap on Windows
+//@ignore-target: windows # No mmap on Windows
 
 #![feature(rustc_private)]
 
diff --git a/src/tools/miri/tests/fail-dep/libc/mmap_use_after_munmap.stderr b/src/tools/miri/tests/fail-dep/libc/mmap_use_after_munmap.stderr
index 49f2b84baa8..8404aeb5a7a 100644
--- a/src/tools/miri/tests/fail-dep/libc/mmap_use_after_munmap.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/mmap_use_after_munmap.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling
-  --> $DIR/mmap_use_after_munmap.rs:LL:CC
+  --> tests/fail-dep/libc/mmap_use_after_munmap.rs:LL:CC
    |
 LL |         let _x = *(ptr as *mut u8);
    |                  ^^^^^^^^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling
@@ -7,7 +7,7 @@ LL |         let _x = *(ptr as *mut u8);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/mmap_use_after_munmap.rs:LL:CC
+  --> tests/fail-dep/libc/mmap_use_after_munmap.rs:LL:CC
    |
 LL |           let ptr = libc::mmap(
    |  ___________________^
@@ -19,12 +19,12 @@ LL | |             0,
 LL | |         );
    | |_________^
 help: ALLOC was deallocated here:
-  --> $DIR/mmap_use_after_munmap.rs:LL:CC
+  --> tests/fail-dep/libc/mmap_use_after_munmap.rs:LL:CC
    |
 LL |         libc::munmap(ptr, 4096);
    |         ^^^^^^^^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/mmap_use_after_munmap.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/mmap_use_after_munmap.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/munmap_partial.rs b/src/tools/miri/tests/fail-dep/libc/munmap_partial.rs
index 4386dc71af6..58aab14ef1d 100644
--- a/src/tools/miri/tests/fail-dep/libc/munmap_partial.rs
+++ b/src/tools/miri/tests/fail-dep/libc/munmap_partial.rs
@@ -1,7 +1,7 @@
 //! The man pages for mmap/munmap suggest that it is possible to partly unmap a previously-mapped
 //! region of address space, but to LLVM that would be partial deallocation, which LLVM does not
 //! support. So even though the man pages say this sort of use is possible, we must report UB.
-//@ignore-target-windows: No mmap on Windows
+//@ignore-target: windows # No mmap on Windows
 //@normalize-stderr-test: "size [0-9]+ and alignment" -> "size SIZE and alignment"
 
 fn main() {
diff --git a/src/tools/miri/tests/fail-dep/libc/munmap_partial.stderr b/src/tools/miri/tests/fail-dep/libc/munmap_partial.stderr
index 39825eb27c0..7b1703a968a 100644
--- a/src/tools/miri/tests/fail-dep/libc/munmap_partial.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/munmap_partial.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: incorrect layout on deallocation: ALLOC has size SIZE and alignment ALIGN, but gave size SIZE and alignment ALIGN
-  --> $DIR/munmap_partial.rs:LL:CC
+  --> tests/fail-dep/libc/munmap_partial.rs:LL:CC
    |
 LL |         libc::munmap(ptr, 1);
    |         ^^^^^^^^^^^^^^^^^^^^ incorrect layout on deallocation: ALLOC has size SIZE and alignment ALIGN, but gave size SIZE and alignment ALIGN
@@ -7,7 +7,7 @@ LL |         libc::munmap(ptr, 1);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/munmap_partial.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/munmap_partial.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_double_free.rs b/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_double_free.rs
index b6b7b007f2b..be5d372a048 100644
--- a/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_double_free.rs
+++ b/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_double_free.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No posix_memalign on Windows
+//@ignore-target: windows # No posix_memalign on Windows
 
 use std::ptr;
 
diff --git a/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_double_free.stderr b/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_double_free.stderr
index 3ed117c5a0a..1d73ec95754 100644
--- a/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_double_free.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_double_free.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling
-  --> $DIR/posix_memalign_size_zero_double_free.rs:LL:CC
+  --> tests/fail-dep/libc/posix_memalign_size_zero_double_free.rs:LL:CC
    |
 LL |         libc::free(ptr);
    |         ^^^^^^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling
@@ -7,17 +7,17 @@ LL |         libc::free(ptr);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/posix_memalign_size_zero_double_free.rs:LL:CC
+  --> tests/fail-dep/libc/posix_memalign_size_zero_double_free.rs:LL:CC
    |
 LL |         let _ = libc::posix_memalign(&mut ptr, align, size);
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: ALLOC was deallocated here:
-  --> $DIR/posix_memalign_size_zero_double_free.rs:LL:CC
+  --> tests/fail-dep/libc/posix_memalign_size_zero_double_free.rs:LL:CC
    |
 LL |         libc::free(ptr);
    |         ^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/posix_memalign_size_zero_double_free.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/posix_memalign_size_zero_double_free.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_leak.rs b/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_leak.rs
index 1a4c9605fe0..2f990b34ab5 100644
--- a/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_leak.rs
+++ b/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_leak.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No posix_memalign on Windows
+//@ignore-target: windows # No posix_memalign on Windows
 
 use std::ptr;
 
diff --git a/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_leak.stderr b/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_leak.stderr
index 2639031f1cc..4546185b13e 100644
--- a/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_leak.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/posix_memalign_size_zero_leak.stderr
@@ -1,11 +1,11 @@
 error: memory leaked: ALLOC (C heap, size: 0, align: 64), allocated here:
-  --> $DIR/posix_memalign_size_zero_leak.rs:LL:CC
+  --> tests/fail-dep/libc/posix_memalign_size_zero_leak.rs:LL:CC
    |
 LL |     let _ = unsafe { libc::posix_memalign(&mut ptr, align, size) };
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/posix_memalign_size_zero_leak.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/posix_memalign_size_zero_leak.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/realloc-zero.stderr b/src/tools/miri/tests/fail-dep/libc/realloc-zero.stderr
index 749a61f7396..6f8095dbba1 100644
--- a/src/tools/miri/tests/fail-dep/libc/realloc-zero.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/realloc-zero.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `realloc` with a size of zero
-  --> $DIR/realloc-zero.rs:LL:CC
+  --> tests/fail-dep/libc/realloc-zero.rs:LL:CC
    |
 LL |         let p2 = libc::realloc(p1, 0);
    |                  ^^^^^^^^^^^^^^^^^^^^ `realloc` with a size of zero
@@ -7,7 +7,7 @@ LL |         let p2 = libc::realloc(p1, 0);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/realloc-zero.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/realloc-zero.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/socketpair_read_blocking.rs b/src/tools/miri/tests/fail-dep/libc/socketpair_read_blocking.rs
index c28a6d966fe..ffa4e36f0f4 100644
--- a/src/tools/miri/tests/fail-dep/libc/socketpair_read_blocking.rs
+++ b/src/tools/miri/tests/fail-dep/libc/socketpair_read_blocking.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: no libc socketpair on Windows
+//@ignore-target: windows # no libc socketpair on Windows
 
 // This is temporarily here because blocking on fd is not supported yet.
 // When blocking is eventually supported, this will be moved to pass-dep/libc/libc-socketpair
diff --git a/src/tools/miri/tests/fail-dep/libc/socketpair_read_blocking.stderr b/src/tools/miri/tests/fail-dep/libc/socketpair_read_blocking.stderr
index b5ed72d9f1b..dff332f9992 100644
--- a/src/tools/miri/tests/fail-dep/libc/socketpair_read_blocking.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/socketpair_read_blocking.stderr
@@ -1,12 +1,12 @@
 error: unsupported operation: socketpair read: blocking isn't supported yet
-  --> $DIR/socketpair_read_blocking.rs:LL:CC
+  --> tests/fail-dep/libc/socketpair_read_blocking.rs:LL:CC
    |
 LL |     let _res = unsafe { libc::read(fds[1], buf.as_mut_ptr().cast(), buf.len() as libc::size_t) };
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ socketpair read: blocking isn't supported yet
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/socketpair_read_blocking.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/socketpair_read_blocking.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/socketpair_write_blocking.rs b/src/tools/miri/tests/fail-dep/libc/socketpair_write_blocking.rs
index e2fbc0ae4b4..e83197dfc0f 100644
--- a/src/tools/miri/tests/fail-dep/libc/socketpair_write_blocking.rs
+++ b/src/tools/miri/tests/fail-dep/libc/socketpair_write_blocking.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: no libc socketpair on Windows
+//@ignore-target: windows # no libc socketpair on Windows
 // This is temporarily here because blocking on fd is not supported yet.
 // When blocking is eventually supported, this will be moved to pass-dep/libc/libc-socketpair
 fn main() {
diff --git a/src/tools/miri/tests/fail-dep/libc/socketpair_write_blocking.stderr b/src/tools/miri/tests/fail-dep/libc/socketpair_write_blocking.stderr
index 7b3a0d27636..0dd89a15c7c 100644
--- a/src/tools/miri/tests/fail-dep/libc/socketpair_write_blocking.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/socketpair_write_blocking.stderr
@@ -1,12 +1,12 @@
 error: unsupported operation: socketpair write: blocking isn't supported yet
-  --> $DIR/socketpair_write_blocking.rs:LL:CC
+  --> tests/fail-dep/libc/socketpair_write_blocking.rs:LL:CC
    |
 LL |     let _ = unsafe { libc::write(fds[0], data as *const libc::c_void, 3) };
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ socketpair write: blocking isn't supported yet
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/socketpair_write_blocking.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/socketpair_write_blocking.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail-dep/libc/unsupported_incomplete_function.rs b/src/tools/miri/tests/fail-dep/libc/unsupported_incomplete_function.rs
index cd8422f4afd..b23b90d6fcd 100644
--- a/src/tools/miri/tests/fail-dep/libc/unsupported_incomplete_function.rs
+++ b/src/tools/miri/tests/fail-dep/libc/unsupported_incomplete_function.rs
@@ -1,6 +1,6 @@
 //! `signal()` is special on Linux and macOS that it's only supported within libstd.
 //! The implementation is not complete enough to permit user code to call it.
-//@ignore-target-windows: No `libc::signal` on Windows
+//@ignore-target: windows # No `libc: #signal` on Windows
 //@normalize-stderr-test: "OS `.*`" -> "$$OS"
 
 fn main() {
diff --git a/src/tools/miri/tests/fail-dep/libc/unsupported_incomplete_function.stderr b/src/tools/miri/tests/fail-dep/libc/unsupported_incomplete_function.stderr
index f62622e29bf..a92a97cef3b 100644
--- a/src/tools/miri/tests/fail-dep/libc/unsupported_incomplete_function.stderr
+++ b/src/tools/miri/tests/fail-dep/libc/unsupported_incomplete_function.stderr
@@ -1,5 +1,5 @@
 error: unsupported operation: can't call foreign function `signal` on $OS
-  --> $DIR/unsupported_incomplete_function.rs:LL:CC
+  --> tests/fail-dep/libc/unsupported_incomplete_function.rs:LL:CC
    |
 LL |         libc::signal(libc::SIGPIPE, libc::SIG_IGN);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function `signal` on $OS
@@ -7,7 +7,7 @@ LL |         libc::signal(libc::SIGPIPE, libc::SIG_IGN);
    = help: if this is a basic API commonly used on this target, please report an issue with Miri
    = help: however, note that Miri does not aim to support every FFI function out there; for instance, we will not support APIs for things such as GUIs, scripting languages, or databases
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unsupported_incomplete_function.rs:LL:CC
+   = note: inside `main` at tests/fail-dep/libc/unsupported_incomplete_function.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/alloc/alloc_error_handler.stderr b/src/tools/miri/tests/fail/alloc/alloc_error_handler.stderr
index d1731a0f420..3642f3f28ca 100644
--- a/src/tools/miri/tests/fail/alloc/alloc_error_handler.stderr
+++ b/src/tools/miri/tests/fail/alloc/alloc_error_handler.stderr
@@ -13,7 +13,7 @@ LL |     ABORT();
    = note: inside `std::alloc::handle_alloc_error::rt_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC
    = note: inside `std::alloc::handle_alloc_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC
 note: inside `main`
-  --> $DIR/alloc_error_handler.rs:LL:CC
+  --> tests/fail/alloc/alloc_error_handler.rs:LL:CC
    |
 LL |     handle_alloc_error(Layout::for_value(&0));
    | ^
diff --git a/src/tools/miri/tests/fail/alloc/alloc_error_handler_custom.stderr b/src/tools/miri/tests/fail/alloc/alloc_error_handler_custom.stderr
index 5d9c2e2fb4c..d12e119bce3 100644
--- a/src/tools/miri/tests/fail/alloc/alloc_error_handler_custom.stderr
+++ b/src/tools/miri/tests/fail/alloc/alloc_error_handler_custom.stderr
@@ -1,14 +1,14 @@
 custom alloc error handler: Layout { size: 4, align: 4 (1 << 2) }
 error: abnormal termination: the program aborted execution
-  --> $DIR/alloc_error_handler_custom.rs:LL:CC
+  --> tests/fail/alloc/alloc_error_handler_custom.rs:LL:CC
    |
 LL |     core::intrinsics::abort();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ the program aborted execution
    |
    = note: BACKTRACE:
-   = note: inside `alloc_error_handler` at $DIR/alloc_error_handler_custom.rs:LL:CC
+   = note: inside `alloc_error_handler` at tests/fail/alloc/alloc_error_handler_custom.rs:LL:CC
 note: inside `_::__rg_oom`
-  --> $DIR/alloc_error_handler_custom.rs:LL:CC
+  --> tests/fail/alloc/alloc_error_handler_custom.rs:LL:CC
    |
 LL | #[alloc_error_handler]
    | ---------------------- in this procedural macro expansion
@@ -17,7 +17,7 @@ LL | fn alloc_error_handler(layout: Layout) -> ! {
    = note: inside `alloc::alloc::handle_alloc_error::rt_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC
    = note: inside `alloc::alloc::handle_alloc_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC
 note: inside `start`
-  --> $DIR/alloc_error_handler_custom.rs:LL:CC
+  --> tests/fail/alloc/alloc_error_handler_custom.rs:LL:CC
    |
 LL |     handle_alloc_error(Layout::for_value(&0));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/alloc/alloc_error_handler_no_std.stderr b/src/tools/miri/tests/fail/alloc/alloc_error_handler_no_std.stderr
index 6b98f6f75d8..f495d65a8b0 100644
--- a/src/tools/miri/tests/fail/alloc/alloc_error_handler_no_std.stderr
+++ b/src/tools/miri/tests/fail/alloc/alloc_error_handler_no_std.stderr
@@ -2,18 +2,18 @@ custom panic handler called!
 panicked at RUSTLIB/alloc/src/alloc.rs:LL:CC:
 memory allocation of 4 bytes failed
 error: abnormal termination: the program aborted execution
-  --> $DIR/alloc_error_handler_no_std.rs:LL:CC
+  --> tests/fail/alloc/alloc_error_handler_no_std.rs:LL:CC
    |
 LL |     core::intrinsics::abort();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ the program aborted execution
    |
    = note: BACKTRACE:
-   = note: inside `panic_handler` at $DIR/alloc_error_handler_no_std.rs:LL:CC
+   = note: inside `panic_handler` at tests/fail/alloc/alloc_error_handler_no_std.rs:LL:CC
    = note: inside `alloc::alloc::__alloc_error_handler::__rdl_oom` at RUSTLIB/alloc/src/alloc.rs:LL:CC
    = note: inside `alloc::alloc::handle_alloc_error::rt_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC
    = note: inside `alloc::alloc::handle_alloc_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC
 note: inside `start`
-  --> $DIR/alloc_error_handler_no_std.rs:LL:CC
+  --> tests/fail/alloc/alloc_error_handler_no_std.rs:LL:CC
    |
 LL |     handle_alloc_error(Layout::for_value(&0));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/alloc/deallocate-bad-alignment.stderr b/src/tools/miri/tests/fail/alloc/deallocate-bad-alignment.stderr
index d340413d231..f07db3c62c9 100644
--- a/src/tools/miri/tests/fail/alloc/deallocate-bad-alignment.stderr
+++ b/src/tools/miri/tests/fail/alloc/deallocate-bad-alignment.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: incorrect layout on deallocation: ALLOC has size 1 and alignment ALIGN, but gave size 1 and alignment ALIGN
-  --> $DIR/deallocate-bad-alignment.rs:LL:CC
+  --> tests/fail/alloc/deallocate-bad-alignment.rs:LL:CC
    |
 LL |         dealloc(x, Layout::from_size_align_unchecked(1, 2));
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect layout on deallocation: ALLOC has size 1 and alignment ALIGN, but gave size 1 and alignment ALIGN
@@ -7,7 +7,7 @@ LL |         dealloc(x, Layout::from_size_align_unchecked(1, 2));
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/deallocate-bad-alignment.rs:LL:CC
+   = note: inside `main` at tests/fail/alloc/deallocate-bad-alignment.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/alloc/deallocate-bad-size.stderr b/src/tools/miri/tests/fail/alloc/deallocate-bad-size.stderr
index b661b49c9f3..c913bde04cc 100644
--- a/src/tools/miri/tests/fail/alloc/deallocate-bad-size.stderr
+++ b/src/tools/miri/tests/fail/alloc/deallocate-bad-size.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: incorrect layout on deallocation: ALLOC has size 1 and alignment ALIGN, but gave size 2 and alignment ALIGN
-  --> $DIR/deallocate-bad-size.rs:LL:CC
+  --> tests/fail/alloc/deallocate-bad-size.rs:LL:CC
    |
 LL |         dealloc(x, Layout::from_size_align_unchecked(2, 1));
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect layout on deallocation: ALLOC has size 1 and alignment ALIGN, but gave size 2 and alignment ALIGN
@@ -7,7 +7,7 @@ LL |         dealloc(x, Layout::from_size_align_unchecked(2, 1));
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/deallocate-bad-size.rs:LL:CC
+   = note: inside `main` at tests/fail/alloc/deallocate-bad-size.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/alloc/deallocate-twice.stderr b/src/tools/miri/tests/fail/alloc/deallocate-twice.stderr
index 32cdfa0d228..9e6ce3d45a7 100644
--- a/src/tools/miri/tests/fail/alloc/deallocate-twice.stderr
+++ b/src/tools/miri/tests/fail/alloc/deallocate-twice.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling
-  --> $DIR/deallocate-twice.rs:LL:CC
+  --> tests/fail/alloc/deallocate-twice.rs:LL:CC
    |
 LL |         dealloc(x, Layout::from_size_align_unchecked(1, 1));
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling
@@ -7,17 +7,17 @@ LL |         dealloc(x, Layout::from_size_align_unchecked(1, 1));
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/deallocate-twice.rs:LL:CC
+  --> tests/fail/alloc/deallocate-twice.rs:LL:CC
    |
 LL |         let x = alloc(Layout::from_size_align_unchecked(1, 1));
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: ALLOC was deallocated here:
-  --> $DIR/deallocate-twice.rs:LL:CC
+  --> tests/fail/alloc/deallocate-twice.rs:LL:CC
    |
 LL |         dealloc(x, Layout::from_size_align_unchecked(1, 1));
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/deallocate-twice.rs:LL:CC
+   = note: inside `main` at tests/fail/alloc/deallocate-twice.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/alloc/global_system_mixup.stderr b/src/tools/miri/tests/fail/alloc/global_system_mixup.stderr
index 287a1f1a3e3..4c355c511ef 100644
--- a/src/tools/miri/tests/fail/alloc/global_system_mixup.stderr
+++ b/src/tools/miri/tests/fail/alloc/global_system_mixup.stderr
@@ -10,7 +10,7 @@ LL |         FREE();
    = note: inside `std::sys::alloc::PLATFORM::<impl std::alloc::GlobalAlloc for std::alloc::System>::dealloc` at RUSTLIB/std/src/sys/alloc/PLATFORM.rs:LL:CC
    = note: inside `<std::alloc::System as std::alloc::Allocator>::deallocate` at RUSTLIB/std/src/alloc.rs:LL:CC
 note: inside `main`
-  --> $DIR/global_system_mixup.rs:LL:CC
+  --> tests/fail/alloc/global_system_mixup.rs:LL:CC
    |
 LL |     unsafe { System.deallocate(ptr, l) };
    | ^
diff --git a/src/tools/miri/tests/fail/alloc/no_global_allocator.stderr b/src/tools/miri/tests/fail/alloc/no_global_allocator.stderr
index 82bcb48cbe6..e08a747f7fa 100644
--- a/src/tools/miri/tests/fail/alloc/no_global_allocator.stderr
+++ b/src/tools/miri/tests/fail/alloc/no_global_allocator.stderr
@@ -1,5 +1,5 @@
 error: unsupported operation: can't call foreign function `__rust_alloc` on $OS
-  --> $DIR/no_global_allocator.rs:LL:CC
+  --> tests/fail/alloc/no_global_allocator.rs:LL:CC
    |
 LL |         __rust_alloc(1, 1);
    |         ^^^^^^^^^^^^^^^^^^ can't call foreign function `__rust_alloc` on $OS
@@ -7,7 +7,7 @@ LL |         __rust_alloc(1, 1);
    = help: if this is a basic API commonly used on this target, please report an issue with Miri
    = help: however, note that Miri does not aim to support every FFI function out there; for instance, we will not support APIs for things such as GUIs, scripting languages, or databases
    = note: BACKTRACE:
-   = note: inside `start` at $DIR/no_global_allocator.rs:LL:CC
+   = note: inside `start` at tests/fail/alloc/no_global_allocator.rs:LL:CC
 
 error: aborting due to 1 previous error
 
diff --git a/src/tools/miri/tests/fail/alloc/reallocate-bad-size.stderr b/src/tools/miri/tests/fail/alloc/reallocate-bad-size.stderr
index 965cbc4dd03..6f6c8850603 100644
--- a/src/tools/miri/tests/fail/alloc/reallocate-bad-size.stderr
+++ b/src/tools/miri/tests/fail/alloc/reallocate-bad-size.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: incorrect layout on deallocation: ALLOC has size 1 and alignment ALIGN, but gave size 2 and alignment ALIGN
-  --> $DIR/reallocate-bad-size.rs:LL:CC
+  --> tests/fail/alloc/reallocate-bad-size.rs:LL:CC
    |
 LL |         let _y = realloc(x, Layout::from_size_align_unchecked(2, 1), 1);
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect layout on deallocation: ALLOC has size 1 and alignment ALIGN, but gave size 2 and alignment ALIGN
@@ -7,7 +7,7 @@ LL |         let _y = realloc(x, Layout::from_size_align_unchecked(2, 1), 1);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/reallocate-bad-size.rs:LL:CC
+   = note: inside `main` at tests/fail/alloc/reallocate-bad-size.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/alloc/reallocate-change-alloc.stderr b/src/tools/miri/tests/fail/alloc/reallocate-change-alloc.stderr
index fb3b035b116..17b40fbdcdc 100644
--- a/src/tools/miri/tests/fail/alloc/reallocate-change-alloc.stderr
+++ b/src/tools/miri/tests/fail/alloc/reallocate-change-alloc.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling
-  --> $DIR/reallocate-change-alloc.rs:LL:CC
+  --> tests/fail/alloc/reallocate-change-alloc.rs:LL:CC
    |
 LL |         let _z = *x;
    |                  ^^ memory access failed: ALLOC has been freed, so this pointer is dangling
@@ -7,17 +7,17 @@ LL |         let _z = *x;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/reallocate-change-alloc.rs:LL:CC
+  --> tests/fail/alloc/reallocate-change-alloc.rs:LL:CC
    |
 LL |         let x = alloc(Layout::from_size_align_unchecked(1, 1));
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: ALLOC was deallocated here:
-  --> $DIR/reallocate-change-alloc.rs:LL:CC
+  --> tests/fail/alloc/reallocate-change-alloc.rs:LL:CC
    |
 LL |         let _y = realloc(x, Layout::from_size_align_unchecked(1, 1), 1);
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/reallocate-change-alloc.rs:LL:CC
+   = note: inside `main` at tests/fail/alloc/reallocate-change-alloc.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/alloc/reallocate-dangling.stderr b/src/tools/miri/tests/fail/alloc/reallocate-dangling.stderr
index 9a582b9b4cf..06960380f6c 100644
--- a/src/tools/miri/tests/fail/alloc/reallocate-dangling.stderr
+++ b/src/tools/miri/tests/fail/alloc/reallocate-dangling.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling
-  --> $DIR/reallocate-dangling.rs:LL:CC
+  --> tests/fail/alloc/reallocate-dangling.rs:LL:CC
    |
 LL |         let _z = realloc(x, Layout::from_size_align_unchecked(1, 1), 1);
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling
@@ -7,17 +7,17 @@ LL |         let _z = realloc(x, Layout::from_size_align_unchecked(1, 1), 1);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/reallocate-dangling.rs:LL:CC
+  --> tests/fail/alloc/reallocate-dangling.rs:LL:CC
    |
 LL |         let x = alloc(Layout::from_size_align_unchecked(1, 1));
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: ALLOC was deallocated here:
-  --> $DIR/reallocate-dangling.rs:LL:CC
+  --> tests/fail/alloc/reallocate-dangling.rs:LL:CC
    |
 LL |         dealloc(x, Layout::from_size_align_unchecked(1, 1));
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/reallocate-dangling.rs:LL:CC
+   = note: inside `main` at tests/fail/alloc/reallocate-dangling.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/alloc/stack_free.stderr b/src/tools/miri/tests/fail/alloc/stack_free.stderr
index 36e78c1b7fb..7d7cee133c6 100644
--- a/src/tools/miri/tests/fail/alloc/stack_free.stderr
+++ b/src/tools/miri/tests/fail/alloc/stack_free.stderr
@@ -11,7 +11,7 @@ LL |                 self.1.deallocate(From::from(ptr.cast()), layout);
    = note: inside `std::ptr::drop_in_place::<std::boxed::Box<i32>> - shim(Some(std::boxed::Box<i32>))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC
    = note: inside `std::mem::drop::<std::boxed::Box<i32>>` at RUSTLIB/core/src/mem/mod.rs:LL:CC
 note: inside `main`
-  --> $DIR/stack_free.rs:LL:CC
+  --> tests/fail/alloc/stack_free.rs:LL:CC
    |
 LL |     drop(bad_box);
    |     ^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/alloc/too_large.stderr b/src/tools/miri/tests/fail/alloc/too_large.stderr
index 77dcf91d843..03e54088e3b 100644
--- a/src/tools/miri/tests/fail/alloc/too_large.stderr
+++ b/src/tools/miri/tests/fail/alloc/too_large.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: creating an allocation larger than half the address space
-  --> $DIR/too_large.rs:LL:CC
+  --> tests/fail/alloc/too_large.rs:LL:CC
    |
 LL |         __rust_alloc(bytes, 1);
    |         ^^^^^^^^^^^^^^^^^^^^^^ creating an allocation larger than half the address space
@@ -7,7 +7,7 @@ LL |         __rust_alloc(bytes, 1);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/too_large.rs:LL:CC
+   = note: inside `main` at tests/fail/alloc/too_large.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/alloc/unsupported_big_alignment.stderr b/src/tools/miri/tests/fail/alloc/unsupported_big_alignment.stderr
index 4c783b866c8..8eb71f5ce84 100644
--- a/src/tools/miri/tests/fail/alloc/unsupported_big_alignment.stderr
+++ b/src/tools/miri/tests/fail/alloc/unsupported_big_alignment.stderr
@@ -1,12 +1,12 @@
 error: unsupported operation: creating allocation with alignment ALIGN exceeding rustc's maximum supported value
-  --> $DIR/unsupported_big_alignment.rs:LL:CC
+  --> tests/fail/alloc/unsupported_big_alignment.rs:LL:CC
    |
 LL |         __rust_alloc(1, 1 << 30);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^ creating allocation with alignment ALIGN exceeding rustc's maximum supported value
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unsupported_big_alignment.rs:LL:CC
+   = note: inside `main` at tests/fail/alloc/unsupported_big_alignment.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/alloc/unsupported_non_power_two_alignment.stderr b/src/tools/miri/tests/fail/alloc/unsupported_non_power_two_alignment.stderr
index 69a6c375f47..0a36d3d58b6 100644
--- a/src/tools/miri/tests/fail/alloc/unsupported_non_power_two_alignment.stderr
+++ b/src/tools/miri/tests/fail/alloc/unsupported_non_power_two_alignment.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: creating allocation with non-power-of-two alignment ALIGN
-  --> $DIR/unsupported_non_power_two_alignment.rs:LL:CC
+  --> tests/fail/alloc/unsupported_non_power_two_alignment.rs:LL:CC
    |
 LL |         __rust_alloc(1, 3);
    |         ^^^^^^^^^^^^^^^^^^ creating allocation with non-power-of-two alignment ALIGN
@@ -7,7 +7,7 @@ LL |         __rust_alloc(1, 3);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unsupported_non_power_two_alignment.rs:LL:CC
+   = note: inside `main` at tests/fail/alloc/unsupported_non_power_two_alignment.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/alias_through_mutation.stack.stderr b/src/tools/miri/tests/fail/both_borrows/alias_through_mutation.stack.stderr
index 6903a52f304..d7e7c2bc039 100644
--- a/src/tools/miri/tests/fail/both_borrows/alias_through_mutation.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/alias_through_mutation.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a read access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/alias_through_mutation.rs:LL:CC
+  --> tests/fail/both_borrows/alias_through_mutation.rs:LL:CC
    |
 LL |     let _val = *target_alias;
    |                ^^^^^^^^^^^^^
@@ -10,17 +10,17 @@ LL |     let _val = *target_alias;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadOnly retag at offsets [0x0..0x4]
-  --> $DIR/alias_through_mutation.rs:LL:CC
+  --> tests/fail/both_borrows/alias_through_mutation.rs:LL:CC
    |
 LL |         *x = &mut *(target as *mut _);
    |              ^^^^^^^^^^^^^^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a write access
-  --> $DIR/alias_through_mutation.rs:LL:CC
+  --> tests/fail/both_borrows/alias_through_mutation.rs:LL:CC
    |
 LL |     *target = 13;
    |     ^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/alias_through_mutation.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/alias_through_mutation.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/alias_through_mutation.tree.stderr b/src/tools/miri/tests/fail/both_borrows/alias_through_mutation.tree.stderr
index 0bd196eab1b..c146658d310 100644
--- a/src/tools/miri/tests/fail/both_borrows/alias_through_mutation.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/alias_through_mutation.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: read access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/alias_through_mutation.rs:LL:CC
+  --> tests/fail/both_borrows/alias_through_mutation.rs:LL:CC
    |
 LL |     let _val = *target_alias;
    |                ^^^^^^^^^^^^^ read access through <TAG> at ALLOC[0x0] is forbidden
@@ -7,18 +7,18 @@ LL |     let _val = *target_alias;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Disabled which forbids this child read access
 help: the accessed tag <TAG> was created here, in the initial state Frozen
-  --> $DIR/alias_through_mutation.rs:LL:CC
+  --> tests/fail/both_borrows/alias_through_mutation.rs:LL:CC
    |
 LL |         *x = &mut *(target as *mut _);
    |              ^^^^^^^^^^^^^^^^^^^^^^^^
 help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x0..0x4]
-  --> $DIR/alias_through_mutation.rs:LL:CC
+  --> tests/fail/both_borrows/alias_through_mutation.rs:LL:CC
    |
 LL |     *target = 13;
    |     ^^^^^^^^^^^^
    = help: this transition corresponds to a loss of read permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/alias_through_mutation.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/alias_through_mutation.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.stack.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.stack.stderr
index 4f9e6222db2..170027d9f90 100644
--- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: not granting access to tag <TAG> because that would remove [Unique for <TAG>] which is strongly protected
-  --> $DIR/aliasing_mut1.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC
    |
 LL | pub fn safe(x: &mut i32, y: &mut i32) {
    |                          ^ not granting access to tag <TAG> because that would remove [Unique for <TAG>] which is strongly protected
@@ -7,19 +7,19 @@ LL | pub fn safe(x: &mut i32, y: &mut i32) {
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a Unique retag at offsets [0x0..0x4]
-  --> $DIR/aliasing_mut1.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC
    |
 LL |     let xraw: *mut i32 = unsafe { mem::transmute(&mut x) };
    |                                                  ^^^^^^
 help: <TAG> is this argument
-  --> $DIR/aliasing_mut1.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC
    |
 LL | pub fn safe(x: &mut i32, y: &mut i32) {
    |             ^
    = note: BACKTRACE (of the first span):
-   = note: inside `safe` at $DIR/aliasing_mut1.rs:LL:CC
+   = note: inside `safe` at tests/fail/both_borrows/aliasing_mut1.rs:LL:CC
 note: inside `main`
-  --> $DIR/aliasing_mut1.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC
    |
 LL |     safe_raw(xraw, xraw);
    |     ^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.tree.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.tree.stderr
index 3aff0a41de2..62ab1c4f872 100644
--- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut1.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/aliasing_mut1.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC
    |
 LL |     *x = 1;
    |     ^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
@@ -7,20 +7,20 @@ LL |     *x = 1;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Reserved (conflicted) which forbids this child write access
 help: the accessed tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/aliasing_mut1.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC
    |
 LL | pub fn safe(x: &mut i32, y: &mut i32) {
    |             ^
 help: the accessed tag <TAG> later transitioned to Reserved (conflicted) due to a reborrow (acting as a foreign read access) at offsets [0x0..0x4]
-  --> $DIR/aliasing_mut1.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC
    |
 LL | pub fn safe(x: &mut i32, y: &mut i32) {
    |                          ^
    = help: this transition corresponds to a temporary loss of write permissions until function exit
    = note: BACKTRACE (of the first span):
-   = note: inside `safe` at $DIR/aliasing_mut1.rs:LL:CC
+   = note: inside `safe` at tests/fail/both_borrows/aliasing_mut1.rs:LL:CC
 note: inside `main`
-  --> $DIR/aliasing_mut1.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut1.rs:LL:CC
    |
 LL |     safe_raw(xraw, xraw);
    |     ^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.stack.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.stack.stderr
index 54679d177da..274dc22a7e1 100644
--- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: not granting access to tag <TAG> because that would remove [SharedReadOnly for <TAG>] which is strongly protected
-  --> $DIR/aliasing_mut2.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC
    |
 LL | pub fn safe(x: &i32, y: &mut i32) {
    |                      ^ not granting access to tag <TAG> because that would remove [SharedReadOnly for <TAG>] which is strongly protected
@@ -7,19 +7,19 @@ LL | pub fn safe(x: &i32, y: &mut i32) {
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a Unique retag at offsets [0x0..0x4]
-  --> $DIR/aliasing_mut2.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC
    |
 LL |     let xref = &mut x;
    |                ^^^^^^
 help: <TAG> is this argument
-  --> $DIR/aliasing_mut2.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC
    |
 LL | pub fn safe(x: &i32, y: &mut i32) {
    |             ^
    = note: BACKTRACE (of the first span):
-   = note: inside `safe` at $DIR/aliasing_mut2.rs:LL:CC
+   = note: inside `safe` at tests/fail/both_borrows/aliasing_mut2.rs:LL:CC
 note: inside `main`
-  --> $DIR/aliasing_mut2.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC
    |
 LL |     safe_raw(xshr, xraw);
    |     ^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.tree.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.tree.stderr
index d8602a54c64..f3d7a016825 100644
--- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut2.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/aliasing_mut2.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC
    |
 LL |     *y = 2;
    |     ^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
@@ -7,20 +7,20 @@ LL |     *y = 2;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Reserved (conflicted) which forbids this child write access
 help: the accessed tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/aliasing_mut2.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC
    |
 LL | pub fn safe(x: &i32, y: &mut i32) {
    |                      ^
 help: the accessed tag <TAG> later transitioned to Reserved (conflicted) due to a foreign read access at offsets [0x0..0x4]
-  --> $DIR/aliasing_mut2.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC
    |
 LL |     let _v = *x;
    |              ^^
    = help: this transition corresponds to a temporary loss of write permissions until function exit
    = note: BACKTRACE (of the first span):
-   = note: inside `safe` at $DIR/aliasing_mut2.rs:LL:CC
+   = note: inside `safe` at tests/fail/both_borrows/aliasing_mut2.rs:LL:CC
 note: inside `main`
-  --> $DIR/aliasing_mut2.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut2.rs:LL:CC
    |
 LL |     safe_raw(xshr, xraw);
    |     ^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.stack.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.stack.stderr
index b04139f3bd9..a89baa50ff3 100644
--- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to retag from <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/aliasing_mut3.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut3.rs:LL:CC
    |
 LL | pub fn safe(x: &mut i32, y: &i32) {
    |                          ^
@@ -10,19 +10,19 @@ LL | pub fn safe(x: &mut i32, y: &i32) {
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadOnly retag at offsets [0x0..0x4]
-  --> $DIR/aliasing_mut3.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut3.rs:LL:CC
    |
 LL |     safe_raw(xraw, xshr);
    |                    ^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a Unique function-entry retag inside this call
-  --> $DIR/aliasing_mut3.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut3.rs:LL:CC
    |
 LL |     safe_raw(xraw, xshr);
    |     ^^^^^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `safe` at $DIR/aliasing_mut3.rs:LL:CC
+   = note: inside `safe` at tests/fail/both_borrows/aliasing_mut3.rs:LL:CC
 note: inside `main`
-  --> $DIR/aliasing_mut3.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut3.rs:LL:CC
    |
 LL |     safe_raw(xraw, xshr);
    |     ^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.tree.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.tree.stderr
index 83191962a3f..ba9197a50d6 100644
--- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut3.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/aliasing_mut3.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut3.rs:LL:CC
    |
 LL |     *x = 1;
    |     ^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
@@ -7,20 +7,20 @@ LL |     *x = 1;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Reserved (conflicted) which forbids this child write access
 help: the accessed tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/aliasing_mut3.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut3.rs:LL:CC
    |
 LL | pub fn safe(x: &mut i32, y: &i32) {
    |             ^
 help: the accessed tag <TAG> later transitioned to Reserved (conflicted) due to a reborrow (acting as a foreign read access) at offsets [0x0..0x4]
-  --> $DIR/aliasing_mut3.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut3.rs:LL:CC
    |
 LL | pub fn safe(x: &mut i32, y: &i32) {
    |                          ^
    = help: this transition corresponds to a temporary loss of write permissions until function exit
    = note: BACKTRACE (of the first span):
-   = note: inside `safe` at $DIR/aliasing_mut3.rs:LL:CC
+   = note: inside `safe` at tests/fail/both_borrows/aliasing_mut3.rs:LL:CC
 note: inside `main`
-  --> $DIR/aliasing_mut3.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut3.rs:LL:CC
    |
 LL |     safe_raw(xraw, xshr);
    |     ^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.stack.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.stack.stderr
index b3e97c92f1a..bdda7139490 100644
--- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: not granting access to tag <TAG> because that would remove [SharedReadOnly for <TAG>] which is strongly protected
-  --> $DIR/aliasing_mut4.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut4.rs:LL:CC
    |
 LL | pub fn safe(x: &i32, y: &mut Cell<i32>) {
    |                      ^ not granting access to tag <TAG> because that would remove [SharedReadOnly for <TAG>] which is strongly protected
@@ -7,19 +7,19 @@ LL | pub fn safe(x: &i32, y: &mut Cell<i32>) {
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a Unique retag at offsets [0x0..0x4]
-  --> $DIR/aliasing_mut4.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut4.rs:LL:CC
    |
 LL |     let xref = &mut x;
    |                ^^^^^^
 help: <TAG> is this argument
-  --> $DIR/aliasing_mut4.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut4.rs:LL:CC
    |
 LL | pub fn safe(x: &i32, y: &mut Cell<i32>) {
    |             ^
    = note: BACKTRACE (of the first span):
-   = note: inside `safe` at $DIR/aliasing_mut4.rs:LL:CC
+   = note: inside `safe` at tests/fail/both_borrows/aliasing_mut4.rs:LL:CC
 note: inside `main`
-  --> $DIR/aliasing_mut4.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut4.rs:LL:CC
    |
 LL |     safe_raw(xshr, xraw as *mut _);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.tree.stderr b/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.tree.stderr
index b1f1e231e5a..5162368b51f 100644
--- a/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/aliasing_mut4.tree.stderr
@@ -9,12 +9,12 @@ LL |         ptr::write(dest, src);
    = help: this foreign write access would cause the protected tag <TAG> (currently Frozen) to become Disabled
    = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
-  --> $DIR/aliasing_mut4.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut4.rs:LL:CC
    |
 LL |     y.set(1);
    |     ^^^^^^^^
 help: the protected tag <TAG> was created here, in the initial state Frozen
-  --> $DIR/aliasing_mut4.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut4.rs:LL:CC
    |
 LL | pub fn safe(x: &i32, y: &mut Cell<i32>) {
    |             ^
@@ -23,12 +23,12 @@ LL | pub fn safe(x: &i32, y: &mut Cell<i32>) {
    = note: inside `std::cell::Cell::<i32>::replace` at RUSTLIB/core/src/cell.rs:LL:CC
    = note: inside `std::cell::Cell::<i32>::set` at RUSTLIB/core/src/cell.rs:LL:CC
 note: inside `safe`
-  --> $DIR/aliasing_mut4.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut4.rs:LL:CC
    |
 LL |     y.set(1);
    |     ^^^^^^^^
 note: inside `main`
-  --> $DIR/aliasing_mut4.rs:LL:CC
+  --> tests/fail/both_borrows/aliasing_mut4.rs:LL:CC
    |
 LL |     safe_raw(xshr, xraw as *mut _);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.stack.stderr b/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.stack.stderr
index bed0b880c3a..0cffdcd21c4 100644
--- a/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a write access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/box_exclusive_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC
    |
 LL |         *LEAK = 7;
    |         ^^^^^^^^^
@@ -10,24 +10,24 @@ LL |         *LEAK = 7;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadOnly retag at offsets [0x0..0x4]
-  --> $DIR/box_exclusive_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC
    |
 LL |         LEAK = x as *const _ as *mut _;
    |                ^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a write access
-  --> $DIR/box_exclusive_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC
    |
 LL |     *our = 5;
    |     ^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `unknown_code_2` at $DIR/box_exclusive_violation1.rs:LL:CC
+   = note: inside `unknown_code_2` at tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC
 note: inside `demo_box_advanced_unique`
-  --> $DIR/box_exclusive_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC
    |
 LL |     unknown_code_2();
    |     ^^^^^^^^^^^^^^^^
 note: inside `main`
-  --> $DIR/box_exclusive_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC
    |
 LL |     demo_box_advanced_unique(Box::new(0));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.tree.stderr b/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.tree.stderr
index 27d987feb57..075df9982c6 100644
--- a/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/box_exclusive_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC
    |
 LL |         *LEAK = 7;
    |         ^^^^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
@@ -7,25 +7,25 @@ LL |         *LEAK = 7;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Disabled which forbids this child write access
 help: the accessed tag <TAG> was created here, in the initial state Frozen
-  --> $DIR/box_exclusive_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC
    |
 LL | fn unknown_code_1(x: &i32) {
    |                   ^
 help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x0..0x4]
-  --> $DIR/box_exclusive_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC
    |
 LL |     *our = 5;
    |     ^^^^^^^^
    = help: this transition corresponds to a loss of read permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `unknown_code_2` at $DIR/box_exclusive_violation1.rs:LL:CC
+   = note: inside `unknown_code_2` at tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC
 note: inside `demo_box_advanced_unique`
-  --> $DIR/box_exclusive_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC
    |
 LL |     unknown_code_2();
    |     ^^^^^^^^^^^^^^^^
 note: inside `main`
-  --> $DIR/box_exclusive_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/box_exclusive_violation1.rs:LL:CC
    |
 LL |     demo_box_advanced_unique(Box::new(0));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.stack.stderr b/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.stack.stderr
index a9ea7a9e9c4..3dc3f8c6619 100644
--- a/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: not granting access to tag <TAG> because that would remove [Unique for <TAG>] which is weakly protected
-  --> $DIR/box_noalias_violation.rs:LL:CC
+  --> tests/fail/both_borrows/box_noalias_violation.rs:LL:CC
    |
 LL |     *y
    |     ^^ not granting access to tag <TAG> because that would remove [Unique for <TAG>] which is weakly protected
@@ -7,19 +7,19 @@ LL |     *y
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x4]
-  --> $DIR/box_noalias_violation.rs:LL:CC
+  --> tests/fail/both_borrows/box_noalias_violation.rs:LL:CC
    |
 LL |         let ptr = &mut v as *mut i32;
    |                   ^^^^^^
 help: <TAG> is this argument
-  --> $DIR/box_noalias_violation.rs:LL:CC
+  --> tests/fail/both_borrows/box_noalias_violation.rs:LL:CC
    |
 LL | unsafe fn test(mut x: Box<i32>, y: *const i32) -> i32 {
    |                ^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `test` at $DIR/box_noalias_violation.rs:LL:CC
+   = note: inside `test` at tests/fail/both_borrows/box_noalias_violation.rs:LL:CC
 note: inside `main`
-  --> $DIR/box_noalias_violation.rs:LL:CC
+  --> tests/fail/both_borrows/box_noalias_violation.rs:LL:CC
    |
 LL |         test(Box::from_raw(ptr), ptr);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.tree.stderr b/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.tree.stderr
index 95cf37c8123..c788e455c8d 100644
--- a/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/box_noalias_violation.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: read access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/box_noalias_violation.rs:LL:CC
+  --> tests/fail/both_borrows/box_noalias_violation.rs:LL:CC
    |
 LL |     *y
    |     ^^ read access through <TAG> at ALLOC[0x0] is forbidden
@@ -9,25 +9,25 @@ LL |     *y
    = help: this foreign read access would cause the protected tag <TAG> (currently Active) to become Disabled
    = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
-  --> $DIR/box_noalias_violation.rs:LL:CC
+  --> tests/fail/both_borrows/box_noalias_violation.rs:LL:CC
    |
 LL |         let ptr = &mut v as *mut i32;
    |                   ^^^^^^
 help: the protected tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/box_noalias_violation.rs:LL:CC
+  --> tests/fail/both_borrows/box_noalias_violation.rs:LL:CC
    |
 LL | unsafe fn test(mut x: Box<i32>, y: *const i32) -> i32 {
    |                ^^^^^
 help: the protected tag <TAG> later transitioned to Active due to a child write access at offsets [0x0..0x4]
-  --> $DIR/box_noalias_violation.rs:LL:CC
+  --> tests/fail/both_borrows/box_noalias_violation.rs:LL:CC
    |
 LL |     *x = 5;
    |     ^^^^^^
    = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference
    = note: BACKTRACE (of the first span):
-   = note: inside `test` at $DIR/box_noalias_violation.rs:LL:CC
+   = note: inside `test` at tests/fail/both_borrows/box_noalias_violation.rs:LL:CC
 note: inside `main`
-  --> $DIR/box_noalias_violation.rs:LL:CC
+  --> tests/fail/both_borrows/box_noalias_violation.rs:LL:CC
    |
 LL |         test(Box::from_raw(ptr), ptr);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/buggy_as_mut_slice.stack.stderr b/src/tools/miri/tests/fail/both_borrows/buggy_as_mut_slice.stack.stderr
index d2bf4c6a59c..4e5355f5653 100644
--- a/src/tools/miri/tests/fail/both_borrows/buggy_as_mut_slice.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/buggy_as_mut_slice.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a write access using <TAG> at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
-  --> $DIR/buggy_as_mut_slice.rs:LL:CC
+  --> tests/fail/both_borrows/buggy_as_mut_slice.rs:LL:CC
    |
 LL |     v1[1] = 5;
    |     ^^^^^^^^^
@@ -10,17 +10,17 @@ LL |     v1[1] = 5;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a Unique retag at offsets [0x0..0xc]
-  --> $DIR/buggy_as_mut_slice.rs:LL:CC
+  --> tests/fail/both_borrows/buggy_as_mut_slice.rs:LL:CC
    |
 LL |     let v1 = safe::as_mut_slice(&v);
    |              ^^^^^^^^^^^^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0xc] by a Unique retag
-  --> $DIR/buggy_as_mut_slice.rs:LL:CC
+  --> tests/fail/both_borrows/buggy_as_mut_slice.rs:LL:CC
    |
 LL |         unsafe { from_raw_parts_mut(self_.as_ptr() as *mut T, self_.len()) }
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/buggy_as_mut_slice.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/buggy_as_mut_slice.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/buggy_as_mut_slice.tree.stderr b/src/tools/miri/tests/fail/both_borrows/buggy_as_mut_slice.tree.stderr
index 16e87c4d4eb..bad42343c00 100644
--- a/src/tools/miri/tests/fail/both_borrows/buggy_as_mut_slice.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/buggy_as_mut_slice.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x4] is forbidden
-  --> $DIR/buggy_as_mut_slice.rs:LL:CC
+  --> tests/fail/both_borrows/buggy_as_mut_slice.rs:LL:CC
    |
 LL |     v2[1] = 7;
    |     ^^^^^^^^^ write access through <TAG> at ALLOC[0x4] is forbidden
@@ -7,18 +7,18 @@ LL |     v2[1] = 7;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Disabled which forbids this child write access
 help: the accessed tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/buggy_as_mut_slice.rs:LL:CC
+  --> tests/fail/both_borrows/buggy_as_mut_slice.rs:LL:CC
    |
 LL |     let v2 = safe::as_mut_slice(&v);
    |              ^^^^^^^^^^^^^^^^^^^^^^
 help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x4..0x8]
-  --> $DIR/buggy_as_mut_slice.rs:LL:CC
+  --> tests/fail/both_borrows/buggy_as_mut_slice.rs:LL:CC
    |
 LL |     v1[1] = 5;
    |     ^^^^^^^^^
    = help: this transition corresponds to a loss of read and write permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/buggy_as_mut_slice.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/buggy_as_mut_slice.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/buggy_split_at_mut.stack.stderr b/src/tools/miri/tests/fail/both_borrows/buggy_split_at_mut.stack.stderr
index 71d962a5523..28be7607aa3 100644
--- a/src/tools/miri/tests/fail/both_borrows/buggy_split_at_mut.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/buggy_split_at_mut.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to retag from <TAG> for Unique permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/buggy_split_at_mut.rs:LL:CC
+  --> tests/fail/both_borrows/buggy_split_at_mut.rs:LL:CC
    |
 LL | /             (
 LL | |                 from_raw_parts_mut(ptr, len - mid), // BUG: should be "mid" instead of "len - mid"
@@ -14,19 +14,19 @@ LL | |             )
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a Unique retag at offsets [0x0..0x10]
-  --> $DIR/buggy_split_at_mut.rs:LL:CC
+  --> tests/fail/both_borrows/buggy_split_at_mut.rs:LL:CC
    |
 LL |                 from_raw_parts_mut(ptr, len - mid), // BUG: should be "mid" instead of "len - mid"
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x10] by a Unique retag
-  --> $DIR/buggy_split_at_mut.rs:LL:CC
+  --> tests/fail/both_borrows/buggy_split_at_mut.rs:LL:CC
    |
 LL |                 from_raw_parts_mut(ptr.offset(mid as isize), len - mid),
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `safe::split_at_mut::<i32>` at $DIR/buggy_split_at_mut.rs:LL:CC
+   = note: inside `safe::split_at_mut::<i32>` at tests/fail/both_borrows/buggy_split_at_mut.rs:LL:CC
 note: inside `main`
-  --> $DIR/buggy_split_at_mut.rs:LL:CC
+  --> tests/fail/both_borrows/buggy_split_at_mut.rs:LL:CC
    |
 LL |     let (a, b) = safe::split_at_mut(&mut array, 0);
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/buggy_split_at_mut.tree.stderr b/src/tools/miri/tests/fail/both_borrows/buggy_split_at_mut.tree.stderr
index aaf7c2256a7..c734f257a40 100644
--- a/src/tools/miri/tests/fail/both_borrows/buggy_split_at_mut.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/buggy_split_at_mut.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x4] is forbidden
-  --> $DIR/buggy_split_at_mut.rs:LL:CC
+  --> tests/fail/both_borrows/buggy_split_at_mut.rs:LL:CC
    |
 LL |     b[1] = 6;
    |     ^^^^^^^^ write access through <TAG> at ALLOC[0x4] is forbidden
@@ -7,18 +7,18 @@ LL |     b[1] = 6;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Disabled which forbids this child write access
 help: the accessed tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/buggy_split_at_mut.rs:LL:CC
+  --> tests/fail/both_borrows/buggy_split_at_mut.rs:LL:CC
    |
 LL |     let (a, b) = safe::split_at_mut(&mut array, 0);
    |             ^
 help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x4..0x8]
-  --> $DIR/buggy_split_at_mut.rs:LL:CC
+  --> tests/fail/both_borrows/buggy_split_at_mut.rs:LL:CC
    |
 LL |     a[1] = 5;
    |     ^^^^^^^^
    = help: this transition corresponds to a loss of read and write permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/buggy_split_at_mut.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/buggy_split_at_mut.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/illegal_write1.stack.stderr b/src/tools/miri/tests/fail/both_borrows/illegal_write1.stack.stderr
index 3a9faeb80ee..9df441cb956 100644
--- a/src/tools/miri/tests/fail/both_borrows/illegal_write1.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/illegal_write1.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a write access using <TAG> at ALLOC[0x0], but that tag only grants SharedReadOnly permission for this location
-  --> $DIR/illegal_write1.rs:LL:CC
+  --> tests/fail/both_borrows/illegal_write1.rs:LL:CC
    |
 LL |         unsafe { *x = 42 };
    |                  ^^^^^^^
@@ -10,12 +10,12 @@ LL |         unsafe { *x = 42 };
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadOnly retag at offsets [0x0..0x4]
-  --> $DIR/illegal_write1.rs:LL:CC
+  --> tests/fail/both_borrows/illegal_write1.rs:LL:CC
    |
 LL |         let x: *mut u32 = xref as *const _ as *mut _;
    |                           ^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/illegal_write1.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/illegal_write1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/illegal_write1.tree.stderr b/src/tools/miri/tests/fail/both_borrows/illegal_write1.tree.stderr
index 6241c9db0d2..cd415ad6de9 100644
--- a/src/tools/miri/tests/fail/both_borrows/illegal_write1.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/illegal_write1.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/illegal_write1.rs:LL:CC
+  --> tests/fail/both_borrows/illegal_write1.rs:LL:CC
    |
 LL |         unsafe { *x = 42 };
    |                  ^^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
@@ -7,12 +7,12 @@ LL |         unsafe { *x = 42 };
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Frozen which forbids this child write access
 help: the accessed tag <TAG> was created here, in the initial state Frozen
-  --> $DIR/illegal_write1.rs:LL:CC
+  --> tests/fail/both_borrows/illegal_write1.rs:LL:CC
    |
 LL |     let xref = &*target;
    |                ^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/illegal_write1.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/illegal_write1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/illegal_write5.stack.stderr b/src/tools/miri/tests/fail/both_borrows/illegal_write5.stack.stderr
index 16f8a3cbd02..2a517941de5 100644
--- a/src/tools/miri/tests/fail/both_borrows/illegal_write5.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/illegal_write5.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a read access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/illegal_write5.rs:LL:CC
+  --> tests/fail/both_borrows/illegal_write5.rs:LL:CC
    |
 LL |     let _val = *xref;
    |                ^^^^^
@@ -10,17 +10,17 @@ LL |     let _val = *xref;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a Unique retag at offsets [0x0..0x4]
-  --> $DIR/illegal_write5.rs:LL:CC
+  --> tests/fail/both_borrows/illegal_write5.rs:LL:CC
    |
 LL |     let xref = unsafe { &mut *xraw };
    |                         ^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a write access
-  --> $DIR/illegal_write5.rs:LL:CC
+  --> tests/fail/both_borrows/illegal_write5.rs:LL:CC
    |
 LL |     unsafe { *xraw = 15 };
    |              ^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/illegal_write5.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/illegal_write5.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/illegal_write5.tree.stderr b/src/tools/miri/tests/fail/both_borrows/illegal_write5.tree.stderr
index dec2bb6880f..38bc957cc33 100644
--- a/src/tools/miri/tests/fail/both_borrows/illegal_write5.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/illegal_write5.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: read access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/illegal_write5.rs:LL:CC
+  --> tests/fail/both_borrows/illegal_write5.rs:LL:CC
    |
 LL |     let _val = *xref;
    |                ^^^^^ read access through <TAG> at ALLOC[0x0] is forbidden
@@ -7,18 +7,18 @@ LL |     let _val = *xref;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Disabled which forbids this child read access
 help: the accessed tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/illegal_write5.rs:LL:CC
+  --> tests/fail/both_borrows/illegal_write5.rs:LL:CC
    |
 LL |     let xref = unsafe { &mut *xraw };
    |                         ^^^^^^^^^^
 help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x0..0x4]
-  --> $DIR/illegal_write5.rs:LL:CC
+  --> tests/fail/both_borrows/illegal_write5.rs:LL:CC
    |
 LL |     unsafe { *xraw = 15 };
    |              ^^^^^^^^^^
    = help: this transition corresponds to a loss of read and write permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/illegal_write5.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/illegal_write5.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/illegal_write6.stack.stderr b/src/tools/miri/tests/fail/both_borrows/illegal_write6.stack.stderr
index b5484745c41..e75334508ff 100644
--- a/src/tools/miri/tests/fail/both_borrows/illegal_write6.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/illegal_write6.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: not granting access to tag <TAG> because that would remove [Unique for <TAG>] which is strongly protected
-  --> $DIR/illegal_write6.rs:LL:CC
+  --> tests/fail/both_borrows/illegal_write6.rs:LL:CC
    |
 LL |     unsafe { *y = 2 };
    |              ^^^^^^ not granting access to tag <TAG> because that would remove [Unique for <TAG>] which is strongly protected
@@ -7,19 +7,19 @@ LL |     unsafe { *y = 2 };
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x4]
-  --> $DIR/illegal_write6.rs:LL:CC
+  --> tests/fail/both_borrows/illegal_write6.rs:LL:CC
    |
 LL |     let p = x as *mut u32;
    |             ^
 help: <TAG> is this argument
-  --> $DIR/illegal_write6.rs:LL:CC
+  --> tests/fail/both_borrows/illegal_write6.rs:LL:CC
    |
 LL | fn foo(a: &mut u32, y: *mut u32) -> u32 {
    |        ^
    = note: BACKTRACE (of the first span):
-   = note: inside `foo` at $DIR/illegal_write6.rs:LL:CC
+   = note: inside `foo` at tests/fail/both_borrows/illegal_write6.rs:LL:CC
 note: inside `main`
-  --> $DIR/illegal_write6.rs:LL:CC
+  --> tests/fail/both_borrows/illegal_write6.rs:LL:CC
    |
 LL |     foo(x, p);
    |     ^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/illegal_write6.tree.stderr b/src/tools/miri/tests/fail/both_borrows/illegal_write6.tree.stderr
index 2e161ceea88..31599a767cf 100644
--- a/src/tools/miri/tests/fail/both_borrows/illegal_write6.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/illegal_write6.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/illegal_write6.rs:LL:CC
+  --> tests/fail/both_borrows/illegal_write6.rs:LL:CC
    |
 LL |     unsafe { *y = 2 };
    |              ^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
@@ -9,25 +9,25 @@ LL |     unsafe { *y = 2 };
    = help: this foreign write access would cause the protected tag <TAG> (currently Active) to become Disabled
    = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
-  --> $DIR/illegal_write6.rs:LL:CC
+  --> tests/fail/both_borrows/illegal_write6.rs:LL:CC
    |
 LL |     let x = &mut 0u32;
    |             ^^^^^^^^^
 help: the protected tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/illegal_write6.rs:LL:CC
+  --> tests/fail/both_borrows/illegal_write6.rs:LL:CC
    |
 LL | fn foo(a: &mut u32, y: *mut u32) -> u32 {
    |        ^
 help: the protected tag <TAG> later transitioned to Active due to a child write access at offsets [0x0..0x4]
-  --> $DIR/illegal_write6.rs:LL:CC
+  --> tests/fail/both_borrows/illegal_write6.rs:LL:CC
    |
 LL |     *a = 1;
    |     ^^^^^^
    = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference
    = note: BACKTRACE (of the first span):
-   = note: inside `foo` at $DIR/illegal_write6.rs:LL:CC
+   = note: inside `foo` at tests/fail/both_borrows/illegal_write6.rs:LL:CC
 note: inside `main`
-  --> $DIR/illegal_write6.rs:LL:CC
+  --> tests/fail/both_borrows/illegal_write6.rs:LL:CC
    |
 LL |     foo(x, p);
    |     ^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.stack.stderr b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.stack.stderr
index 11edbc3270c..b5df1653289 100644
--- a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: not granting access to tag <TAG> because that would remove [SharedReadOnly for <TAG>] which is strongly protected
-  --> $DIR/invalidate_against_protector2.rs:LL:CC
+  --> tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC
    |
 LL |     unsafe { *x = 0 };
    |              ^^^^^^ not granting access to tag <TAG> because that would remove [SharedReadOnly for <TAG>] which is strongly protected
@@ -7,19 +7,19 @@ LL |     unsafe { *x = 0 };
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x4]
-  --> $DIR/invalidate_against_protector2.rs:LL:CC
+  --> tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC
    |
 LL |     let xraw = &mut x as *mut _;
    |                ^^^^^^
 help: <TAG> is this argument
-  --> $DIR/invalidate_against_protector2.rs:LL:CC
+  --> tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC
    |
 LL | fn inner(x: *mut i32, _y: &i32) {
    |                       ^^
    = note: BACKTRACE (of the first span):
-   = note: inside `inner` at $DIR/invalidate_against_protector2.rs:LL:CC
+   = note: inside `inner` at tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC
 note: inside `main`
-  --> $DIR/invalidate_against_protector2.rs:LL:CC
+  --> tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC
    |
 LL |     inner(xraw, xref);
    |     ^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.tree.stderr b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.tree.stderr
index 9fa52262f7e..c3b836a8aa7 100644
--- a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/invalidate_against_protector2.rs:LL:CC
+  --> tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC
    |
 LL |     unsafe { *x = 0 };
    |              ^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
@@ -9,19 +9,19 @@ LL |     unsafe { *x = 0 };
    = help: this foreign write access would cause the protected tag <TAG> (currently Frozen) to become Disabled
    = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
-  --> $DIR/invalidate_against_protector2.rs:LL:CC
+  --> tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC
    |
 LL |     let xraw = &mut x as *mut _;
    |                ^^^^^^
 help: the protected tag <TAG> was created here, in the initial state Frozen
-  --> $DIR/invalidate_against_protector2.rs:LL:CC
+  --> tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC
    |
 LL | fn inner(x: *mut i32, _y: &i32) {
    |                       ^^
    = note: BACKTRACE (of the first span):
-   = note: inside `inner` at $DIR/invalidate_against_protector2.rs:LL:CC
+   = note: inside `inner` at tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC
 note: inside `main`
-  --> $DIR/invalidate_against_protector2.rs:LL:CC
+  --> tests/fail/both_borrows/invalidate_against_protector2.rs:LL:CC
    |
 LL |     inner(xraw, xref);
    |     ^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.stack.stderr b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.stack.stderr
index c6666ceac2b..0010ce0e4ed 100644
--- a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: not granting access to tag <TAG> because that would remove [SharedReadOnly for <TAG>] which is strongly protected
-  --> $DIR/invalidate_against_protector3.rs:LL:CC
+  --> tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC
    |
 LL |     unsafe { *x = 0 };
    |              ^^^^^^ not granting access to tag <TAG> because that would remove [SharedReadOnly for <TAG>] which is strongly protected
@@ -7,19 +7,19 @@ LL |     unsafe { *x = 0 };
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created here, as the root tag for ALLOC
-  --> $DIR/invalidate_against_protector3.rs:LL:CC
+  --> tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC
    |
 LL |         let ptr = alloc(Layout::for_value(&0i32)) as *mut i32;
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: <TAG> is this argument
-  --> $DIR/invalidate_against_protector3.rs:LL:CC
+  --> tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC
    |
 LL | fn inner(x: *mut i32, _y: &i32) {
    |                       ^^
    = note: BACKTRACE (of the first span):
-   = note: inside `inner` at $DIR/invalidate_against_protector3.rs:LL:CC
+   = note: inside `inner` at tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC
 note: inside `main`
-  --> $DIR/invalidate_against_protector3.rs:LL:CC
+  --> tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC
    |
 LL |         inner(ptr, &*ptr);
    |         ^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.tree.stderr b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.tree.stderr
index 2cf476c837c..b47fb81f5f4 100644
--- a/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> (root of the allocation) at ALLOC[0x0] is forbidden
-  --> $DIR/invalidate_against_protector3.rs:LL:CC
+  --> tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC
    |
 LL |     unsafe { *x = 0 };
    |              ^^^^^^ write access through <TAG> (root of the allocation) at ALLOC[0x0] is forbidden
@@ -9,19 +9,19 @@ LL |     unsafe { *x = 0 };
    = help: this foreign write access would cause the protected tag <TAG> (currently Frozen) to become Disabled
    = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
-  --> $DIR/invalidate_against_protector3.rs:LL:CC
+  --> tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC
    |
 LL |         let ptr = alloc(Layout::for_value(&0i32)) as *mut i32;
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: the protected tag <TAG> was created here, in the initial state Frozen
-  --> $DIR/invalidate_against_protector3.rs:LL:CC
+  --> tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC
    |
 LL | fn inner(x: *mut i32, _y: &i32) {
    |                       ^^
    = note: BACKTRACE (of the first span):
-   = note: inside `inner` at $DIR/invalidate_against_protector3.rs:LL:CC
+   = note: inside `inner` at tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC
 note: inside `main`
-  --> $DIR/invalidate_against_protector3.rs:LL:CC
+  --> tests/fail/both_borrows/invalidate_against_protector3.rs:LL:CC
    |
 LL |         inner(ptr, &*ptr);
    |         ^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.stack.stderr b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.stack.stderr
index 64bbbfcd848..cd27bb818e7 100644
--- a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.stack.stderr
@@ -7,7 +7,7 @@ LL |         Box(unsafe { Unique::new_unchecked(raw) }, alloc)
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/issue-miri-1050-1.rs:LL:CC
+  --> tests/fail/both_borrows/issue-miri-1050-1.rs:LL:CC
    |
 LL |         let ptr = Box::into_raw(Box::new(0u16));
    |                                 ^^^^^^^^^^^^^^
@@ -15,7 +15,7 @@ LL |         let ptr = Box::into_raw(Box::new(0u16));
    = note: inside `std::boxed::Box::<u32>::from_raw_in` at RUSTLIB/alloc/src/boxed.rs:LL:CC
    = note: inside `std::boxed::Box::<u32>::from_raw` at RUSTLIB/alloc/src/boxed.rs:LL:CC
 note: inside `main`
-  --> $DIR/issue-miri-1050-1.rs:LL:CC
+  --> tests/fail/both_borrows/issue-miri-1050-1.rs:LL:CC
    |
 LL |         drop(Box::from_raw(ptr as *mut u32));
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.tree.stderr b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.tree.stderr
index 64bbbfcd848..cd27bb818e7 100644
--- a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-1.tree.stderr
@@ -7,7 +7,7 @@ LL |         Box(unsafe { Unique::new_unchecked(raw) }, alloc)
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/issue-miri-1050-1.rs:LL:CC
+  --> tests/fail/both_borrows/issue-miri-1050-1.rs:LL:CC
    |
 LL |         let ptr = Box::into_raw(Box::new(0u16));
    |                                 ^^^^^^^^^^^^^^
@@ -15,7 +15,7 @@ LL |         let ptr = Box::into_raw(Box::new(0u16));
    = note: inside `std::boxed::Box::<u32>::from_raw_in` at RUSTLIB/alloc/src/boxed.rs:LL:CC
    = note: inside `std::boxed::Box::<u32>::from_raw` at RUSTLIB/alloc/src/boxed.rs:LL:CC
 note: inside `main`
-  --> $DIR/issue-miri-1050-1.rs:LL:CC
+  --> tests/fail/both_borrows/issue-miri-1050-1.rs:LL:CC
    |
 LL |         drop(Box::from_raw(ptr as *mut u32));
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.stack.stderr b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.stack.stderr
index 04494b52561..04e5765371e 100644
--- a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.stack.stderr
@@ -10,7 +10,7 @@ LL |         Box(unsafe { Unique::new_unchecked(raw) }, alloc)
    = note: inside `std::boxed::Box::<i32>::from_raw_in` at RUSTLIB/alloc/src/boxed.rs:LL:CC
    = note: inside `std::boxed::Box::<i32>::from_raw` at RUSTLIB/alloc/src/boxed.rs:LL:CC
 note: inside `main`
-  --> $DIR/issue-miri-1050-2.rs:LL:CC
+  --> tests/fail/both_borrows/issue-miri-1050-2.rs:LL:CC
    |
 LL |         drop(Box::from_raw(ptr.as_ptr()));
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.tree.stderr b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.tree.stderr
index 04494b52561..04e5765371e 100644
--- a/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/issue-miri-1050-2.tree.stderr
@@ -10,7 +10,7 @@ LL |         Box(unsafe { Unique::new_unchecked(raw) }, alloc)
    = note: inside `std::boxed::Box::<i32>::from_raw_in` at RUSTLIB/alloc/src/boxed.rs:LL:CC
    = note: inside `std::boxed::Box::<i32>::from_raw` at RUSTLIB/alloc/src/boxed.rs:LL:CC
 note: inside `main`
-  --> $DIR/issue-miri-1050-2.rs:LL:CC
+  --> tests/fail/both_borrows/issue-miri-1050-2.rs:LL:CC
    |
 LL |         drop(Box::from_raw(ptr.as_ptr()));
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/load_invalid_shr.stack.stderr b/src/tools/miri/tests/fail/both_borrows/load_invalid_shr.stack.stderr
index e78807ec1c8..ffc73ee43de 100644
--- a/src/tools/miri/tests/fail/both_borrows/load_invalid_shr.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/load_invalid_shr.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to retag from <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/load_invalid_shr.rs:LL:CC
+  --> tests/fail/both_borrows/load_invalid_shr.rs:LL:CC
    |
 LL |     let _val = *xref_in_mem;
    |                ^^^^^^^^^^^^
@@ -10,17 +10,17 @@ LL |     let _val = *xref_in_mem;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadOnly retag at offsets [0x0..0x4]
-  --> $DIR/load_invalid_shr.rs:LL:CC
+  --> tests/fail/both_borrows/load_invalid_shr.rs:LL:CC
    |
 LL |     let xref_in_mem = Box::new(xref);
    |                       ^^^^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a write access
-  --> $DIR/load_invalid_shr.rs:LL:CC
+  --> tests/fail/both_borrows/load_invalid_shr.rs:LL:CC
    |
 LL |     unsafe { *xraw = 42 }; // unfreeze
    |              ^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/load_invalid_shr.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/load_invalid_shr.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/load_invalid_shr.tree.stderr b/src/tools/miri/tests/fail/both_borrows/load_invalid_shr.tree.stderr
index 0fcfc20e436..4610739739c 100644
--- a/src/tools/miri/tests/fail/both_borrows/load_invalid_shr.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/load_invalid_shr.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: reborrow through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/load_invalid_shr.rs:LL:CC
+  --> tests/fail/both_borrows/load_invalid_shr.rs:LL:CC
    |
 LL |     let _val = *xref_in_mem;
    |                ^^^^^^^^^^^^ reborrow through <TAG> at ALLOC[0x0] is forbidden
@@ -7,18 +7,18 @@ LL |     let _val = *xref_in_mem;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Disabled which forbids this reborrow (acting as a child read access)
 help: the accessed tag <TAG> was created here, in the initial state Frozen
-  --> $DIR/load_invalid_shr.rs:LL:CC
+  --> tests/fail/both_borrows/load_invalid_shr.rs:LL:CC
    |
 LL |     let xref_in_mem = Box::new(xref);
    |                       ^^^^^^^^^^^^^^
 help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x0..0x4]
-  --> $DIR/load_invalid_shr.rs:LL:CC
+  --> tests/fail/both_borrows/load_invalid_shr.rs:LL:CC
    |
 LL |     unsafe { *xraw = 42 }; // unfreeze
    |              ^^^^^^^^^^
    = help: this transition corresponds to a loss of read permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/load_invalid_shr.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/load_invalid_shr.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.stack.stderr b/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.stack.stderr
index 264503f2f2f..92df9bcbe38 100644
--- a/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a write access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/mut_exclusive_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC
    |
 LL |         *LEAK = 7;
    |         ^^^^^^^^^
@@ -10,24 +10,24 @@ LL |         *LEAK = 7;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadOnly retag at offsets [0x0..0x4]
-  --> $DIR/mut_exclusive_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC
    |
 LL |         LEAK = x as *const _ as *mut _;
    |                ^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a write access
-  --> $DIR/mut_exclusive_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC
    |
 LL |     *our = 5;
    |     ^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `unknown_code_2` at $DIR/mut_exclusive_violation1.rs:LL:CC
+   = note: inside `unknown_code_2` at tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC
 note: inside `demo_mut_advanced_unique`
-  --> $DIR/mut_exclusive_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC
    |
 LL |     unknown_code_2();
    |     ^^^^^^^^^^^^^^^^
 note: inside `main`
-  --> $DIR/mut_exclusive_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC
    |
 LL |     demo_mut_advanced_unique(&mut 0);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.tree.stderr b/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.tree.stderr
index 5b4ee4a8913..46660d31295 100644
--- a/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/mut_exclusive_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC
    |
 LL |         *LEAK = 7;
    |         ^^^^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
@@ -7,25 +7,25 @@ LL |         *LEAK = 7;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Disabled which forbids this child write access
 help: the accessed tag <TAG> was created here, in the initial state Frozen
-  --> $DIR/mut_exclusive_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC
    |
 LL | fn unknown_code_1(x: &i32) {
    |                   ^
 help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x0..0x4]
-  --> $DIR/mut_exclusive_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC
    |
 LL |     *our = 5;
    |     ^^^^^^^^
    = help: this transition corresponds to a loss of read permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `unknown_code_2` at $DIR/mut_exclusive_violation1.rs:LL:CC
+   = note: inside `unknown_code_2` at tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC
 note: inside `demo_mut_advanced_unique`
-  --> $DIR/mut_exclusive_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC
    |
 LL |     unknown_code_2();
    |     ^^^^^^^^^^^^^^^^
 note: inside `main`
-  --> $DIR/mut_exclusive_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/mut_exclusive_violation1.rs:LL:CC
    |
 LL |     demo_mut_advanced_unique(&mut 0);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation2.stack.stderr b/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation2.stack.stderr
index 35d418f574c..42e30cf10c9 100644
--- a/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation2.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation2.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a read access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/mut_exclusive_violation2.rs:LL:CC
+  --> tests/fail/both_borrows/mut_exclusive_violation2.rs:LL:CC
    |
 LL |         let _val = *raw1;
    |                    ^^^^^
@@ -10,17 +10,17 @@ LL |         let _val = *raw1;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a Unique retag at offsets [0x0..0x4]
-  --> $DIR/mut_exclusive_violation2.rs:LL:CC
+  --> tests/fail/both_borrows/mut_exclusive_violation2.rs:LL:CC
    |
 LL |         let raw1 = ptr1.as_mut();
    |                    ^^^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a Unique retag
-  --> $DIR/mut_exclusive_violation2.rs:LL:CC
+  --> tests/fail/both_borrows/mut_exclusive_violation2.rs:LL:CC
    |
 LL |         let raw2 = ptr2.as_mut();
    |                    ^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/mut_exclusive_violation2.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/mut_exclusive_violation2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation2.tree.stderr b/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation2.tree.stderr
index d3bc54b7ef3..a9b1b49e385 100644
--- a/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation2.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation2.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/mut_exclusive_violation2.rs:LL:CC
+  --> tests/fail/both_borrows/mut_exclusive_violation2.rs:LL:CC
    |
 LL |         *raw1 = 3;
    |         ^^^^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
@@ -7,18 +7,18 @@ LL |         *raw1 = 3;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Disabled which forbids this child write access
 help: the accessed tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/mut_exclusive_violation2.rs:LL:CC
+  --> tests/fail/both_borrows/mut_exclusive_violation2.rs:LL:CC
    |
 LL |         let raw1 = ptr1.as_mut();
    |                    ^^^^^^^^^^^^^
 help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x0..0x4]
-  --> $DIR/mut_exclusive_violation2.rs:LL:CC
+  --> tests/fail/both_borrows/mut_exclusive_violation2.rs:LL:CC
    |
 LL |         *raw2 = 2;
    |         ^^^^^^^^^
    = help: this transition corresponds to a loss of read and write permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/mut_exclusive_violation2.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/mut_exclusive_violation2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.stack.stderr b/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.stack.stderr
index 9f545e5687e..f428447230a 100644
--- a/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.stack.stderr
@@ -7,12 +7,12 @@ LL |         Box(unsafe { Unique::new_unchecked(raw) }, alloc)
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x4]
-  --> $DIR/newtype_pair_retagging.rs:LL:CC
+  --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC
    |
 LL |     let ptr = Box::into_raw(Box::new(0i32));
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: <TAG> is this argument
-  --> $DIR/newtype_pair_retagging.rs:LL:CC
+  --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC
    |
 LL | fn dealloc_while_running(_n: Newtype<'_>, dealloc: impl FnOnce()) {
    |                          ^^
@@ -20,17 +20,17 @@ LL | fn dealloc_while_running(_n: Newtype<'_>, dealloc: impl FnOnce()) {
    = note: inside `std::boxed::Box::<i32>::from_raw_in` at RUSTLIB/alloc/src/boxed.rs:LL:CC
    = note: inside `std::boxed::Box::<i32>::from_raw` at RUSTLIB/alloc/src/boxed.rs:LL:CC
 note: inside closure
-  --> $DIR/newtype_pair_retagging.rs:LL:CC
+  --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC
    |
 LL |             || drop(Box::from_raw(ptr)),
    |                     ^^^^^^^^^^^^^^^^^^
-note: inside `dealloc_while_running::<{closure@$DIR/newtype_pair_retagging.rs:LL:CC}>`
-  --> $DIR/newtype_pair_retagging.rs:LL:CC
+note: inside `dealloc_while_running::<{closure@tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC}>`
+  --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC
    |
 LL |     dealloc();
    |     ^^^^^^^^^
 note: inside `main`
-  --> $DIR/newtype_pair_retagging.rs:LL:CC
+  --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC
    |
 LL | /         dealloc_while_running(
 LL | |             Newtype(&mut *ptr, 0),
diff --git a/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.tree.stderr b/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.tree.stderr
index a344229eeb4..ef1aa74ddf4 100644
--- a/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.tree.stderr
@@ -9,17 +9,17 @@ LL |                 self.1.deallocate(From::from(ptr.cast()), layout);
    = help: this deallocation (acting as a foreign write access) would cause the protected tag <TAG> (currently Reserved (conflicted)) to become Disabled
    = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
-  --> $DIR/newtype_pair_retagging.rs:LL:CC
+  --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC
    |
 LL |             || drop(Box::from_raw(ptr)),
    |                ^^^^^^^^^^^^^^^^^^^^^^^^
 help: the protected tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/newtype_pair_retagging.rs:LL:CC
+  --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC
    |
 LL | fn dealloc_while_running(_n: Newtype<'_>, dealloc: impl FnOnce()) {
    |                          ^^
 help: the protected tag <TAG> later transitioned to Reserved (conflicted) due to a reborrow (acting as a foreign read access) at offsets [0x0..0x4]
-  --> $DIR/newtype_pair_retagging.rs:LL:CC
+  --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC
    |
 LL |             || drop(Box::from_raw(ptr)),
    |                     ^^^^^^^^^^^^^^^^^^
@@ -29,17 +29,17 @@ LL |             || drop(Box::from_raw(ptr)),
    = note: inside `std::ptr::drop_in_place::<std::boxed::Box<i32>> - shim(Some(std::boxed::Box<i32>))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC
    = note: inside `std::mem::drop::<std::boxed::Box<i32>>` at RUSTLIB/core/src/mem/mod.rs:LL:CC
 note: inside closure
-  --> $DIR/newtype_pair_retagging.rs:LL:CC
+  --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC
    |
 LL |             || drop(Box::from_raw(ptr)),
    |                ^^^^^^^^^^^^^^^^^^^^^^^^
-note: inside `dealloc_while_running::<{closure@$DIR/newtype_pair_retagging.rs:LL:CC}>`
-  --> $DIR/newtype_pair_retagging.rs:LL:CC
+note: inside `dealloc_while_running::<{closure@tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC}>`
+  --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC
    |
 LL |     dealloc();
    |     ^^^^^^^^^
 note: inside `main`
-  --> $DIR/newtype_pair_retagging.rs:LL:CC
+  --> tests/fail/both_borrows/newtype_pair_retagging.rs:LL:CC
    |
 LL | /         dealloc_while_running(
 LL | |             Newtype(&mut *ptr, 0),
diff --git a/src/tools/miri/tests/fail/both_borrows/newtype_retagging.stack.stderr b/src/tools/miri/tests/fail/both_borrows/newtype_retagging.stack.stderr
index a4111f6f5cc..0410c2488db 100644
--- a/src/tools/miri/tests/fail/both_borrows/newtype_retagging.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/newtype_retagging.stack.stderr
@@ -7,12 +7,12 @@ LL |         Box(unsafe { Unique::new_unchecked(raw) }, alloc)
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x4]
-  --> $DIR/newtype_retagging.rs:LL:CC
+  --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC
    |
 LL |     let ptr = Box::into_raw(Box::new(0i32));
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: <TAG> is this argument
-  --> $DIR/newtype_retagging.rs:LL:CC
+  --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC
    |
 LL | fn dealloc_while_running(_n: Newtype<'_>, dealloc: impl FnOnce()) {
    |                          ^^
@@ -20,17 +20,17 @@ LL | fn dealloc_while_running(_n: Newtype<'_>, dealloc: impl FnOnce()) {
    = note: inside `std::boxed::Box::<i32>::from_raw_in` at RUSTLIB/alloc/src/boxed.rs:LL:CC
    = note: inside `std::boxed::Box::<i32>::from_raw` at RUSTLIB/alloc/src/boxed.rs:LL:CC
 note: inside closure
-  --> $DIR/newtype_retagging.rs:LL:CC
+  --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC
    |
 LL |             || drop(Box::from_raw(ptr)),
    |                     ^^^^^^^^^^^^^^^^^^
-note: inside `dealloc_while_running::<{closure@$DIR/newtype_retagging.rs:LL:CC}>`
-  --> $DIR/newtype_retagging.rs:LL:CC
+note: inside `dealloc_while_running::<{closure@tests/fail/both_borrows/newtype_retagging.rs:LL:CC}>`
+  --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC
    |
 LL |     dealloc();
    |     ^^^^^^^^^
 note: inside `main`
-  --> $DIR/newtype_retagging.rs:LL:CC
+  --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC
    |
 LL | /         dealloc_while_running(
 LL | |             Newtype(&mut *ptr),
diff --git a/src/tools/miri/tests/fail/both_borrows/newtype_retagging.tree.stderr b/src/tools/miri/tests/fail/both_borrows/newtype_retagging.tree.stderr
index 321ef39e62b..28fcd1411f9 100644
--- a/src/tools/miri/tests/fail/both_borrows/newtype_retagging.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/newtype_retagging.tree.stderr
@@ -9,17 +9,17 @@ LL |                 self.1.deallocate(From::from(ptr.cast()), layout);
    = help: this deallocation (acting as a foreign write access) would cause the protected tag <TAG> (currently Reserved (conflicted)) to become Disabled
    = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
-  --> $DIR/newtype_retagging.rs:LL:CC
+  --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC
    |
 LL |             || drop(Box::from_raw(ptr)),
    |                ^^^^^^^^^^^^^^^^^^^^^^^^
 help: the protected tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/newtype_retagging.rs:LL:CC
+  --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC
    |
 LL | fn dealloc_while_running(_n: Newtype<'_>, dealloc: impl FnOnce()) {
    |                          ^^
 help: the protected tag <TAG> later transitioned to Reserved (conflicted) due to a reborrow (acting as a foreign read access) at offsets [0x0..0x4]
-  --> $DIR/newtype_retagging.rs:LL:CC
+  --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC
    |
 LL |             || drop(Box::from_raw(ptr)),
    |                     ^^^^^^^^^^^^^^^^^^
@@ -29,17 +29,17 @@ LL |             || drop(Box::from_raw(ptr)),
    = note: inside `std::ptr::drop_in_place::<std::boxed::Box<i32>> - shim(Some(std::boxed::Box<i32>))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC
    = note: inside `std::mem::drop::<std::boxed::Box<i32>>` at RUSTLIB/core/src/mem/mod.rs:LL:CC
 note: inside closure
-  --> $DIR/newtype_retagging.rs:LL:CC
+  --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC
    |
 LL |             || drop(Box::from_raw(ptr)),
    |                ^^^^^^^^^^^^^^^^^^^^^^^^
-note: inside `dealloc_while_running::<{closure@$DIR/newtype_retagging.rs:LL:CC}>`
-  --> $DIR/newtype_retagging.rs:LL:CC
+note: inside `dealloc_while_running::<{closure@tests/fail/both_borrows/newtype_retagging.rs:LL:CC}>`
+  --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC
    |
 LL |     dealloc();
    |     ^^^^^^^^^
 note: inside `main`
-  --> $DIR/newtype_retagging.rs:LL:CC
+  --> tests/fail/both_borrows/newtype_retagging.rs:LL:CC
    |
 LL | /         dealloc_while_running(
 LL | |             Newtype(&mut *ptr),
diff --git a/src/tools/miri/tests/fail/both_borrows/outdated_local.stack.stderr b/src/tools/miri/tests/fail/both_borrows/outdated_local.stack.stderr
index 9717dd16b5b..79d3538e920 100644
--- a/src/tools/miri/tests/fail/both_borrows/outdated_local.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/outdated_local.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a read access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/outdated_local.rs:LL:CC
+  --> tests/fail/both_borrows/outdated_local.rs:LL:CC
    |
 LL |     assert_eq!(unsafe { *y }, 1);
    |                         ^^
@@ -10,17 +10,17 @@ LL |     assert_eq!(unsafe { *y }, 1);
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadOnly retag at offsets [0x0..0x4]
-  --> $DIR/outdated_local.rs:LL:CC
+  --> tests/fail/both_borrows/outdated_local.rs:LL:CC
    |
 LL |     let y: *const i32 = &x;
    |                         ^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a write access
-  --> $DIR/outdated_local.rs:LL:CC
+  --> tests/fail/both_borrows/outdated_local.rs:LL:CC
    |
 LL |     x = 1; // this invalidates y by reactivating the lowermost uniq borrow for this local
    |     ^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/outdated_local.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/outdated_local.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/outdated_local.tree.stderr b/src/tools/miri/tests/fail/both_borrows/outdated_local.tree.stderr
index 60de8417c10..fffa83a9628 100644
--- a/src/tools/miri/tests/fail/both_borrows/outdated_local.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/outdated_local.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: read access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/outdated_local.rs:LL:CC
+  --> tests/fail/both_borrows/outdated_local.rs:LL:CC
    |
 LL |     assert_eq!(unsafe { *y }, 1);
    |                         ^^ read access through <TAG> at ALLOC[0x0] is forbidden
@@ -7,18 +7,18 @@ LL |     assert_eq!(unsafe { *y }, 1);
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Disabled which forbids this child read access
 help: the accessed tag <TAG> was created here, in the initial state Frozen
-  --> $DIR/outdated_local.rs:LL:CC
+  --> tests/fail/both_borrows/outdated_local.rs:LL:CC
    |
 LL |     let y: *const i32 = &x;
    |                         ^^
 help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x0..0x4]
-  --> $DIR/outdated_local.rs:LL:CC
+  --> tests/fail/both_borrows/outdated_local.rs:LL:CC
    |
 LL |     x = 1; // this invalidates y by reactivating the lowermost uniq borrow for this local
    |     ^^^^^
    = help: this transition corresponds to a loss of read permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/outdated_local.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/outdated_local.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr.stack.stderr b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr.stack.stderr
index 57c4a756cf7..108c78abef5 100644
--- a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to retag from <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/pass_invalid_shr.rs:LL:CC
+  --> tests/fail/both_borrows/pass_invalid_shr.rs:LL:CC
    |
 LL |     foo(xref);
    |         ^^^^
@@ -10,17 +10,17 @@ LL |     foo(xref);
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadOnly retag at offsets [0x0..0x4]
-  --> $DIR/pass_invalid_shr.rs:LL:CC
+  --> tests/fail/both_borrows/pass_invalid_shr.rs:LL:CC
    |
 LL |     let xref = unsafe { &*xraw };
    |                         ^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a write access
-  --> $DIR/pass_invalid_shr.rs:LL:CC
+  --> tests/fail/both_borrows/pass_invalid_shr.rs:LL:CC
    |
 LL |     unsafe { *xraw = 42 }; // unfreeze
    |              ^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/pass_invalid_shr.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/pass_invalid_shr.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr.tree.stderr b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr.tree.stderr
index 97a6efa9f6a..59750d56470 100644
--- a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: reborrow through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/pass_invalid_shr.rs:LL:CC
+  --> tests/fail/both_borrows/pass_invalid_shr.rs:LL:CC
    |
 LL |     foo(xref);
    |         ^^^^ reborrow through <TAG> at ALLOC[0x0] is forbidden
@@ -7,18 +7,18 @@ LL |     foo(xref);
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Disabled which forbids this reborrow (acting as a child read access)
 help: the accessed tag <TAG> was created here, in the initial state Frozen
-  --> $DIR/pass_invalid_shr.rs:LL:CC
+  --> tests/fail/both_borrows/pass_invalid_shr.rs:LL:CC
    |
 LL |     let xref = unsafe { &*xraw };
    |                         ^^^^^^
 help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x0..0x4]
-  --> $DIR/pass_invalid_shr.rs:LL:CC
+  --> tests/fail/both_borrows/pass_invalid_shr.rs:LL:CC
    |
 LL |     unsafe { *xraw = 42 }; // unfreeze
    |              ^^^^^^^^^^
    = help: this transition corresponds to a loss of read permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/pass_invalid_shr.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/pass_invalid_shr.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_option.stack.stderr b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_option.stack.stderr
index dfc99ff7cd2..5aca026cb76 100644
--- a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_option.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_option.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to retag from <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/pass_invalid_shr_option.rs:LL:CC
+  --> tests/fail/both_borrows/pass_invalid_shr_option.rs:LL:CC
    |
 LL |     foo(some_xref);
    |         ^^^^^^^^^
@@ -11,17 +11,17 @@ LL |     foo(some_xref);
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadOnly retag at offsets [0x0..0x4]
-  --> $DIR/pass_invalid_shr_option.rs:LL:CC
+  --> tests/fail/both_borrows/pass_invalid_shr_option.rs:LL:CC
    |
 LL |     let some_xref = unsafe { Some(&*xraw) };
    |                              ^^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a write access
-  --> $DIR/pass_invalid_shr_option.rs:LL:CC
+  --> tests/fail/both_borrows/pass_invalid_shr_option.rs:LL:CC
    |
 LL |     unsafe { *xraw = 42 }; // unfreeze
    |              ^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/pass_invalid_shr_option.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/pass_invalid_shr_option.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_option.tree.stderr b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_option.tree.stderr
index f687b3f867f..de63c9609a6 100644
--- a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_option.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_option.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: reborrow through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/pass_invalid_shr_option.rs:LL:CC
+  --> tests/fail/both_borrows/pass_invalid_shr_option.rs:LL:CC
    |
 LL |     foo(some_xref);
    |         ^^^^^^^^^ reborrow through <TAG> at ALLOC[0x0] is forbidden
@@ -7,18 +7,18 @@ LL |     foo(some_xref);
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Disabled which forbids this reborrow (acting as a child read access)
 help: the accessed tag <TAG> was created here, in the initial state Frozen
-  --> $DIR/pass_invalid_shr_option.rs:LL:CC
+  --> tests/fail/both_borrows/pass_invalid_shr_option.rs:LL:CC
    |
 LL |     let some_xref = unsafe { Some(&*xraw) };
    |                              ^^^^^^^^^^^^
 help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x0..0x4]
-  --> $DIR/pass_invalid_shr_option.rs:LL:CC
+  --> tests/fail/both_borrows/pass_invalid_shr_option.rs:LL:CC
    |
 LL |     unsafe { *xraw = 42 }; // unfreeze
    |              ^^^^^^^^^^
    = help: this transition corresponds to a loss of read permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/pass_invalid_shr_option.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/pass_invalid_shr_option.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_tuple.stack.stderr b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_tuple.stack.stderr
index e4ebe22b60e..16c2af081ad 100644
--- a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_tuple.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_tuple.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to retag from <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/pass_invalid_shr_tuple.rs:LL:CC
+  --> tests/fail/both_borrows/pass_invalid_shr_tuple.rs:LL:CC
    |
 LL |     foo(pair_xref);
    |         ^^^^^^^^^
@@ -11,17 +11,17 @@ LL |     foo(pair_xref);
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadOnly retag at offsets [0x0..0x4]
-  --> $DIR/pass_invalid_shr_tuple.rs:LL:CC
+  --> tests/fail/both_borrows/pass_invalid_shr_tuple.rs:LL:CC
    |
 LL |     let pair_xref = unsafe { (&*xraw0, &*xraw1) };
    |                              ^^^^^^^^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a write access
-  --> $DIR/pass_invalid_shr_tuple.rs:LL:CC
+  --> tests/fail/both_borrows/pass_invalid_shr_tuple.rs:LL:CC
    |
 LL |     unsafe { *xraw0 = 42 }; // unfreeze
    |              ^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/pass_invalid_shr_tuple.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/pass_invalid_shr_tuple.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_tuple.tree.stderr b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_tuple.tree.stderr
index 845838f93d5..d2a727a920d 100644
--- a/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_tuple.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/pass_invalid_shr_tuple.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: reborrow through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/pass_invalid_shr_tuple.rs:LL:CC
+  --> tests/fail/both_borrows/pass_invalid_shr_tuple.rs:LL:CC
    |
 LL |     foo(pair_xref);
    |         ^^^^^^^^^ reborrow through <TAG> at ALLOC[0x0] is forbidden
@@ -7,18 +7,18 @@ LL |     foo(pair_xref);
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Disabled which forbids this reborrow (acting as a child read access)
 help: the accessed tag <TAG> was created here, in the initial state Frozen
-  --> $DIR/pass_invalid_shr_tuple.rs:LL:CC
+  --> tests/fail/both_borrows/pass_invalid_shr_tuple.rs:LL:CC
    |
 LL |     let pair_xref = unsafe { (&*xraw0, &*xraw1) };
    |                              ^^^^^^^^^^^^^^^^^^
 help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x0..0x4]
-  --> $DIR/pass_invalid_shr_tuple.rs:LL:CC
+  --> tests/fail/both_borrows/pass_invalid_shr_tuple.rs:LL:CC
    |
 LL |     unsafe { *xraw0 = 42 }; // unfreeze
    |              ^^^^^^^^^^^
    = help: this transition corresponds to a loss of read permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/pass_invalid_shr_tuple.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/pass_invalid_shr_tuple.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.stack.stderr b/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.stack.stderr
index 6f4b52fb887..6bc66f24192 100644
--- a/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.stack.stderr
@@ -1,11 +1,11 @@
 error: Undefined Behavior: Data race detected between (1) retag write on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/retag_data_race_write.rs:LL:CC
+  --> tests/fail/both_borrows/retag_data_race_write.rs:LL:CC
    |
 LL |         *p = 5;
    |         ^^^^^^ Data race detected between (1) retag write on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/retag_data_race_write.rs:LL:CC
+  --> tests/fail/both_borrows/retag_data_race_write.rs:LL:CC
    |
 LL |         let _r = &mut *p;
    |                  ^^^^^^^
@@ -15,9 +15,9 @@ LL |         let _r = &mut *p;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside `thread_2` at $DIR/retag_data_race_write.rs:LL:CC
+   = note: inside `thread_2` at tests/fail/both_borrows/retag_data_race_write.rs:LL:CC
 note: inside closure
-  --> $DIR/retag_data_race_write.rs:LL:CC
+  --> tests/fail/both_borrows/retag_data_race_write.rs:LL:CC
    |
 LL |     let t2 = std::thread::spawn(move || thread_2(p));
    |                                         ^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.tree.stderr b/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.tree.stderr
index fa0012f9b26..510e592539f 100644
--- a/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/retag_data_race_write.tree.stderr
@@ -1,11 +1,11 @@
 error: Undefined Behavior: Data race detected between (1) retag read on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/retag_data_race_write.rs:LL:CC
+  --> tests/fail/both_borrows/retag_data_race_write.rs:LL:CC
    |
 LL |         *p = 5;
    |         ^^^^^^ Data race detected between (1) retag read on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/retag_data_race_write.rs:LL:CC
+  --> tests/fail/both_borrows/retag_data_race_write.rs:LL:CC
    |
 LL |         let _r = &mut *p;
    |                  ^^^^^^^
@@ -15,9 +15,9 @@ LL |         let _r = &mut *p;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside `thread_2` at $DIR/retag_data_race_write.rs:LL:CC
+   = note: inside `thread_2` at tests/fail/both_borrows/retag_data_race_write.rs:LL:CC
 note: inside closure
-  --> $DIR/retag_data_race_write.rs:LL:CC
+  --> tests/fail/both_borrows/retag_data_race_write.rs:LL:CC
    |
 LL |     let t2 = std::thread::spawn(move || thread_2(p));
    |                                         ^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.stack.stderr b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.stack.stderr
index 858afa6fb3c..0ac3ed9db35 100644
--- a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to retag from <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
-  --> $DIR/return_invalid_shr.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr.rs:LL:CC
    |
 LL |     ret
    |     ^^^
@@ -10,19 +10,19 @@ LL |     ret
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadOnly retag at offsets [0x4..0x8]
-  --> $DIR/return_invalid_shr.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr.rs:LL:CC
    |
 LL |     let ret = unsafe { &(*xraw).1 };
    |                        ^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x8] by a write access
-  --> $DIR/return_invalid_shr.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr.rs:LL:CC
    |
 LL |     unsafe { *xraw = (42, 23) }; // unfreeze
    |              ^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `foo` at $DIR/return_invalid_shr.rs:LL:CC
+   = note: inside `foo` at tests/fail/both_borrows/return_invalid_shr.rs:LL:CC
 note: inside `main`
-  --> $DIR/return_invalid_shr.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr.rs:LL:CC
    |
 LL |     foo(&mut (1, 2));
    |     ^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.tree.stderr b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.tree.stderr
index 0d19681f637..cc51f4c77ee 100644
--- a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: reborrow through <TAG> at ALLOC[0x4] is forbidden
-  --> $DIR/return_invalid_shr.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr.rs:LL:CC
    |
 LL |     ret
    |     ^^^ reborrow through <TAG> at ALLOC[0x4] is forbidden
@@ -7,20 +7,20 @@ LL |     ret
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Disabled which forbids this reborrow (acting as a child read access)
 help: the accessed tag <TAG> was created here, in the initial state Frozen
-  --> $DIR/return_invalid_shr.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr.rs:LL:CC
    |
 LL |     let ret = unsafe { &(*xraw).1 };
    |                        ^^^^^^^^^^
 help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x0..0x8]
-  --> $DIR/return_invalid_shr.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr.rs:LL:CC
    |
 LL |     unsafe { *xraw = (42, 23) }; // unfreeze
    |              ^^^^^^^^^^^^^^^^
    = help: this transition corresponds to a loss of read permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `foo` at $DIR/return_invalid_shr.rs:LL:CC
+   = note: inside `foo` at tests/fail/both_borrows/return_invalid_shr.rs:LL:CC
 note: inside `main`
-  --> $DIR/return_invalid_shr.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr.rs:LL:CC
    |
 LL |     foo(&mut (1, 2));
    |     ^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.stack.stderr b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.stack.stderr
index ab67bb516ff..d8e0f52ff02 100644
--- a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to retag from <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
-  --> $DIR/return_invalid_shr_option.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC
    |
 LL |     ret
    |     ^^^
@@ -11,19 +11,19 @@ LL |     ret
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadOnly retag at offsets [0x4..0x8]
-  --> $DIR/return_invalid_shr_option.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC
    |
 LL |     let ret = Some(unsafe { &(*xraw).1 });
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x8] by a write access
-  --> $DIR/return_invalid_shr_option.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC
    |
 LL |     unsafe { *xraw = (42, 23) }; // unfreeze
    |              ^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `foo` at $DIR/return_invalid_shr_option.rs:LL:CC
+   = note: inside `foo` at tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC
 note: inside `main`
-  --> $DIR/return_invalid_shr_option.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC
    |
 LL |     match foo(&mut (1, 2)) {
    |           ^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.tree.stderr b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.tree.stderr
index e7703729251..7a7d8f20fa8 100644
--- a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_option.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: reborrow through <TAG> at ALLOC[0x4] is forbidden
-  --> $DIR/return_invalid_shr_option.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC
    |
 LL |     ret
    |     ^^^ reborrow through <TAG> at ALLOC[0x4] is forbidden
@@ -7,20 +7,20 @@ LL |     ret
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Disabled which forbids this reborrow (acting as a child read access)
 help: the accessed tag <TAG> was created here, in the initial state Frozen
-  --> $DIR/return_invalid_shr_option.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC
    |
 LL |     let ret = Some(unsafe { &(*xraw).1 });
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x0..0x8]
-  --> $DIR/return_invalid_shr_option.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC
    |
 LL |     unsafe { *xraw = (42, 23) }; // unfreeze
    |              ^^^^^^^^^^^^^^^^
    = help: this transition corresponds to a loss of read permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `foo` at $DIR/return_invalid_shr_option.rs:LL:CC
+   = note: inside `foo` at tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC
 note: inside `main`
-  --> $DIR/return_invalid_shr_option.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC
    |
 LL |     match foo(&mut (1, 2)) {
    |           ^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.stack.stderr b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.stack.stderr
index 22a55f0d37c..38b8758964b 100644
--- a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to retag from <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
-  --> $DIR/return_invalid_shr_tuple.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC
    |
 LL |     ret
    |     ^^^
@@ -11,19 +11,19 @@ LL |     ret
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadOnly retag at offsets [0x4..0x8]
-  --> $DIR/return_invalid_shr_tuple.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC
    |
 LL |     let ret = (unsafe { &(*xraw).1 },);
    |               ^^^^^^^^^^^^^^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x8] by a write access
-  --> $DIR/return_invalid_shr_tuple.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC
    |
 LL |     unsafe { *xraw = (42, 23) }; // unfreeze
    |              ^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `foo` at $DIR/return_invalid_shr_tuple.rs:LL:CC
+   = note: inside `foo` at tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC
 note: inside `main`
-  --> $DIR/return_invalid_shr_tuple.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC
    |
 LL |     foo(&mut (1, 2)).0;
    |     ^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.tree.stderr b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.tree.stderr
index a5c6be3f13a..57b4f5fbe2d 100644
--- a/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/return_invalid_shr_tuple.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: reborrow through <TAG> at ALLOC[0x4] is forbidden
-  --> $DIR/return_invalid_shr_tuple.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC
    |
 LL |     ret
    |     ^^^ reborrow through <TAG> at ALLOC[0x4] is forbidden
@@ -7,20 +7,20 @@ LL |     ret
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Disabled which forbids this reborrow (acting as a child read access)
 help: the accessed tag <TAG> was created here, in the initial state Frozen
-  --> $DIR/return_invalid_shr_tuple.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC
    |
 LL |     let ret = (unsafe { &(*xraw).1 },);
    |               ^^^^^^^^^^^^^^^^^^^^^^^^
 help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x0..0x8]
-  --> $DIR/return_invalid_shr_tuple.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC
    |
 LL |     unsafe { *xraw = (42, 23) }; // unfreeze
    |              ^^^^^^^^^^^^^^^^
    = help: this transition corresponds to a loss of read permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `foo` at $DIR/return_invalid_shr_tuple.rs:LL:CC
+   = note: inside `foo` at tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC
 note: inside `main`
-  --> $DIR/return_invalid_shr_tuple.rs:LL:CC
+  --> tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC
    |
 LL |     foo(&mut (1, 2)).0;
    |     ^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.stack.stderr b/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.stack.stderr
index 52ac2184d49..22efda1efae 100644
--- a/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a write access using <TAG> at ALLOC[0x0], but that tag only grants SharedReadOnly permission for this location
-  --> $DIR/shr_frozen_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC
    |
 LL |         *(x as *const i32 as *mut i32) = 7;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -10,19 +10,19 @@ LL |         *(x as *const i32 as *mut i32) = 7;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadOnly retag at offsets [0x0..0x4]
-  --> $DIR/shr_frozen_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC
    |
 LL |         *(x as *const i32 as *mut i32) = 7;
    |           ^
    = note: BACKTRACE (of the first span):
-   = note: inside `unknown_code` at $DIR/shr_frozen_violation1.rs:LL:CC
+   = note: inside `unknown_code` at tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC
 note: inside `foo`
-  --> $DIR/shr_frozen_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC
    |
 LL |     unknown_code(&*x);
    |     ^^^^^^^^^^^^^^^^^
 note: inside `main`
-  --> $DIR/shr_frozen_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC
    |
 LL |     println!("{}", foo(&mut 0));
    |                    ^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.tree.stderr b/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.tree.stderr
index 45b3bceb728..2e544583cb2 100644
--- a/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation1.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/shr_frozen_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC
    |
 LL |         *(x as *const i32 as *mut i32) = 7;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
@@ -7,19 +7,19 @@ LL |         *(x as *const i32 as *mut i32) = 7;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Frozen which forbids this child write access
 help: the accessed tag <TAG> was created here, in the initial state Frozen
-  --> $DIR/shr_frozen_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC
    |
 LL | fn unknown_code(x: &i32) {
    |                 ^
    = note: BACKTRACE (of the first span):
-   = note: inside `unknown_code` at $DIR/shr_frozen_violation1.rs:LL:CC
+   = note: inside `unknown_code` at tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC
 note: inside `foo`
-  --> $DIR/shr_frozen_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC
    |
 LL |     unknown_code(&*x);
    |     ^^^^^^^^^^^^^^^^^
 note: inside `main`
-  --> $DIR/shr_frozen_violation1.rs:LL:CC
+  --> tests/fail/both_borrows/shr_frozen_violation1.rs:LL:CC
    |
 LL |     println!("{}", foo(&mut 0));
    |                    ^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation2.stack.stderr b/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation2.stack.stderr
index e05ffb3d35e..7e6d057a4b6 100644
--- a/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation2.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation2.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a read access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/shr_frozen_violation2.rs:LL:CC
+  --> tests/fail/both_borrows/shr_frozen_violation2.rs:LL:CC
    |
 LL |         let _val = *frozen;
    |                    ^^^^^^^
@@ -10,17 +10,17 @@ LL |         let _val = *frozen;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadOnly retag at offsets [0x0..0x4]
-  --> $DIR/shr_frozen_violation2.rs:LL:CC
+  --> tests/fail/both_borrows/shr_frozen_violation2.rs:LL:CC
    |
 LL |         let frozen = &*ptr;
    |                      ^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a write access
-  --> $DIR/shr_frozen_violation2.rs:LL:CC
+  --> tests/fail/both_borrows/shr_frozen_violation2.rs:LL:CC
    |
 LL |         x = 1;
    |         ^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/shr_frozen_violation2.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/shr_frozen_violation2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation2.tree.stderr b/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation2.tree.stderr
index 96c2e39edd2..17c4542e195 100644
--- a/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation2.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/shr_frozen_violation2.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: read access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/shr_frozen_violation2.rs:LL:CC
+  --> tests/fail/both_borrows/shr_frozen_violation2.rs:LL:CC
    |
 LL |         let _val = *frozen;
    |                    ^^^^^^^ read access through <TAG> at ALLOC[0x0] is forbidden
@@ -7,18 +7,18 @@ LL |         let _val = *frozen;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Disabled which forbids this child read access
 help: the accessed tag <TAG> was created here, in the initial state Frozen
-  --> $DIR/shr_frozen_violation2.rs:LL:CC
+  --> tests/fail/both_borrows/shr_frozen_violation2.rs:LL:CC
    |
 LL |         let frozen = &*ptr;
    |                      ^^^^^
 help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x0..0x4]
-  --> $DIR/shr_frozen_violation2.rs:LL:CC
+  --> tests/fail/both_borrows/shr_frozen_violation2.rs:LL:CC
    |
 LL |         x = 1;
    |         ^^^^^
    = help: this transition corresponds to a loss of read permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/shr_frozen_violation2.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/shr_frozen_violation2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/zero-sized-protected.stack.stderr b/src/tools/miri/tests/fail/both_borrows/zero-sized-protected.stack.stderr
index 672682ff294..c01fa2a86c2 100644
--- a/src/tools/miri/tests/fail/both_borrows/zero-sized-protected.stack.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/zero-sized-protected.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: entering unreachable code
-  --> $DIR/zero-sized-protected.rs:LL:CC
+  --> tests/fail/both_borrows/zero-sized-protected.rs:LL:CC
    |
 LL |     unsafe { std::hint::unreachable_unchecked() };
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ entering unreachable code
@@ -7,7 +7,7 @@ LL |     unsafe { std::hint::unreachable_unchecked() };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/zero-sized-protected.rs:LL:CC
+   = note: inside `main` at tests/fail/both_borrows/zero-sized-protected.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/both_borrows/zero-sized-protected.tree.stderr b/src/tools/miri/tests/fail/both_borrows/zero-sized-protected.tree.stderr
index e7988330589..18d1fb69395 100644
--- a/src/tools/miri/tests/fail/both_borrows/zero-sized-protected.tree.stderr
+++ b/src/tools/miri/tests/fail/both_borrows/zero-sized-protected.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: deallocation through <TAG> (root of the allocation) at ALLOC[0x0] is forbidden
-  --> $DIR/zero-sized-protected.rs:LL:CC
+  --> tests/fail/both_borrows/zero-sized-protected.rs:LL:CC
    |
 LL |     unsafe { dealloc(ptr, l) };
    |              ^^^^^^^^^^^^^^^ deallocation through <TAG> (root of the allocation) at ALLOC[0x0] is forbidden
@@ -8,19 +8,19 @@ LL |     unsafe { dealloc(ptr, l) };
    = help: the allocation of the accessed tag <TAG> (root of the allocation) also contains the strongly protected tag <TAG>
    = help: the strongly protected tag <TAG> disallows deallocations
 help: the accessed tag <TAG> was created here
-  --> $DIR/zero-sized-protected.rs:LL:CC
+  --> tests/fail/both_borrows/zero-sized-protected.rs:LL:CC
    |
 LL |     let ptr = unsafe { alloc(l) };
    |                        ^^^^^^^^
 help: the strongly protected tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/zero-sized-protected.rs:LL:CC
+  --> tests/fail/both_borrows/zero-sized-protected.rs:LL:CC
    |
 LL | fn test(_x: &mut (), ptr: *mut u8, l: Layout) {
    |         ^^
    = note: BACKTRACE (of the first span):
-   = note: inside `test` at $DIR/zero-sized-protected.rs:LL:CC
+   = note: inside `test` at tests/fail/both_borrows/zero-sized-protected.rs:LL:CC
 note: inside `main`
-  --> $DIR/zero-sized-protected.rs:LL:CC
+  --> tests/fail/both_borrows/zero-sized-protected.rs:LL:CC
    |
 LL |     unsafe { test(&mut *ptr.cast::<()>(), ptr, l) };
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/box-cell-alias.stderr b/src/tools/miri/tests/fail/box-cell-alias.stderr
index 697cee52d13..f9cc6003dc6 100644
--- a/src/tools/miri/tests/fail/box-cell-alias.stderr
+++ b/src/tools/miri/tests/fail/box-cell-alias.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to retag from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/box-cell-alias.rs:LL:CC
+  --> tests/fail/box-cell-alias.rs:LL:CC
    |
 LL |     unsafe { (*ptr).set(20) };
    |              ^^^^^^
@@ -10,19 +10,19 @@ LL |     unsafe { (*ptr).set(20) };
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x1]
-  --> $DIR/box-cell-alias.rs:LL:CC
+  --> tests/fail/box-cell-alias.rs:LL:CC
    |
 LL |     let ptr: *const Cell<u8> = &*val;
    |                                ^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x1] by a Unique retag
-  --> $DIR/box-cell-alias.rs:LL:CC
+  --> tests/fail/box-cell-alias.rs:LL:CC
    |
 LL |     let res = helper(val, ptr);
    |                      ^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `helper` at $DIR/box-cell-alias.rs:LL:CC
+   = note: inside `helper` at tests/fail/box-cell-alias.rs:LL:CC
 note: inside `main`
-  --> $DIR/box-cell-alias.rs:LL:CC
+  --> tests/fail/box-cell-alias.rs:LL:CC
    |
 LL |     let res = helper(val, ptr);
    |               ^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/branchless-select-i128-pointer.stderr b/src/tools/miri/tests/fail/branchless-select-i128-pointer.stderr
index 655e682636e..d9de23dc912 100644
--- a/src/tools/miri/tests/fail/branchless-select-i128-pointer.stderr
+++ b/src/tools/miri/tests/fail/branchless-select-i128-pointer.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered a dangling reference ($HEX[noalloc] has no provenance)
-  --> $DIR/branchless-select-i128-pointer.rs:LL:CC
+  --> tests/fail/branchless-select-i128-pointer.rs:LL:CC
    |
 LL | /             transmute::<_, &str>(
 LL | |
@@ -11,7 +11,7 @@ LL | |             )
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/branchless-select-i128-pointer.rs:LL:CC
+   = note: inside `main` at tests/fail/branchless-select-i128-pointer.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/breakpoint.stderr b/src/tools/miri/tests/fail/breakpoint.stderr
index a5666d52a2f..ca98e81f1f4 100644
--- a/src/tools/miri/tests/fail/breakpoint.stderr
+++ b/src/tools/miri/tests/fail/breakpoint.stderr
@@ -1,11 +1,11 @@
 error: abnormal termination: trace/breakpoint trap
-  --> $DIR/breakpoint.rs:LL:CC
+  --> tests/fail/breakpoint.rs:LL:CC
    |
 LL |         core::intrinsics::breakpoint()
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trace/breakpoint trap
    |
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/breakpoint.rs:LL:CC
+   = note: inside `main` at tests/fail/breakpoint.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/concurrency/read_only_atomic_cmpxchg.stderr b/src/tools/miri/tests/fail/concurrency/read_only_atomic_cmpxchg.stderr
index f3e1796f3c9..62ade0a6793 100644
--- a/src/tools/miri/tests/fail/concurrency/read_only_atomic_cmpxchg.stderr
+++ b/src/tools/miri/tests/fail/concurrency/read_only_atomic_cmpxchg.stderr
@@ -1,6 +1,6 @@
 error: Undefined Behavior: atomic store and read-modify-write operations cannot be performed on read-only memory
        see <https://doc.rust-lang.org/nightly/std/sync/atomic/index.html#atomic-accesses-to-read-only-memory> for more information
-  --> $DIR/read_only_atomic_cmpxchg.rs:LL:CC
+  --> tests/fail/concurrency/read_only_atomic_cmpxchg.rs:LL:CC
    |
 LL |     x.compare_exchange(1, 2, Ordering::Relaxed, Ordering::Relaxed).unwrap_err();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ atomic store and read-modify-write operations cannot be performed on read-only memory
@@ -9,7 +9,7 @@ see <https://doc.rust-lang.org/nightly/std/sync/atomic/index.html#atomic-accesse
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/read_only_atomic_cmpxchg.rs:LL:CC
+   = note: inside `main` at tests/fail/concurrency/read_only_atomic_cmpxchg.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/concurrency/read_only_atomic_load_acquire.stderr b/src/tools/miri/tests/fail/concurrency/read_only_atomic_load_acquire.stderr
index 2f873ce1ae7..6a3776feba6 100644
--- a/src/tools/miri/tests/fail/concurrency/read_only_atomic_load_acquire.stderr
+++ b/src/tools/miri/tests/fail/concurrency/read_only_atomic_load_acquire.stderr
@@ -1,7 +1,7 @@
 error: Undefined Behavior: non-relaxed atomic load operations cannot be performed on read-only memory
        these operations sometimes have to be implemented using read-modify-write operations, which require writeable memory
        see <https://doc.rust-lang.org/nightly/std/sync/atomic/index.html#atomic-accesses-to-read-only-memory> for more information
-  --> $DIR/read_only_atomic_load_acquire.rs:LL:CC
+  --> tests/fail/concurrency/read_only_atomic_load_acquire.rs:LL:CC
    |
 LL |     x.load(Ordering::Acquire);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ non-relaxed atomic load operations cannot be performed on read-only memory
@@ -11,7 +11,7 @@ see <https://doc.rust-lang.org/nightly/std/sync/atomic/index.html#atomic-accesse
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/read_only_atomic_load_acquire.rs:LL:CC
+   = note: inside `main` at tests/fail/concurrency/read_only_atomic_load_acquire.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/concurrency/read_only_atomic_load_large.rs b/src/tools/miri/tests/fail/concurrency/read_only_atomic_load_large.rs
index 2d1cb04907c..42c3a9619d4 100644
--- a/src/tools/miri/tests/fail/concurrency/read_only_atomic_load_large.rs
+++ b/src/tools/miri/tests/fail/concurrency/read_only_atomic_load_large.rs
@@ -1,7 +1,7 @@
 // Should not rely on the aliasing model for its failure.
 //@compile-flags: -Zmiri-disable-stacked-borrows
 // Needs atomic accesses larger than the pointer size
-//@ignore-64bit
+//@ignore-bitwidth: 64
 
 use std::sync::atomic::{AtomicI64, Ordering};
 
diff --git a/src/tools/miri/tests/fail/concurrency/read_only_atomic_load_large.stderr b/src/tools/miri/tests/fail/concurrency/read_only_atomic_load_large.stderr
index 9fab02f9631..f4cec9879b7 100644
--- a/src/tools/miri/tests/fail/concurrency/read_only_atomic_load_large.stderr
+++ b/src/tools/miri/tests/fail/concurrency/read_only_atomic_load_large.stderr
@@ -1,7 +1,7 @@
 error: Undefined Behavior: large atomic load operations cannot be performed on read-only memory
        these operations often have to be implemented using read-modify-write operations, which require writeable memory
        see <https://doc.rust-lang.org/nightly/std/sync/atomic/index.html#atomic-accesses-to-read-only-memory> for more information
-  --> $DIR/read_only_atomic_load_large.rs:LL:CC
+  --> tests/fail/concurrency/read_only_atomic_load_large.rs:LL:CC
    |
 LL |     x.load(Ordering::Relaxed);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ large atomic load operations cannot be performed on read-only memory
@@ -11,7 +11,7 @@ see <https://doc.rust-lang.org/nightly/std/sync/atomic/index.html#atomic-accesse
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/read_only_atomic_load_large.rs:LL:CC
+   = note: inside `main` at tests/fail/concurrency/read_only_atomic_load_large.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/const-ub-checks.stderr b/src/tools/miri/tests/fail/const-ub-checks.stderr
index f6ac480f069..e6b302dd28c 100644
--- a/src/tools/miri/tests/fail/const-ub-checks.stderr
+++ b/src/tools/miri/tests/fail/const-ub-checks.stderr
@@ -1,17 +1,17 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-ub-checks.rs:LL:CC
+  --> tests/fail/const-ub-checks.rs:LL:CC
    |
 LL |     ptr.read();
    |     ^^^^^^^^^^ accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required
 
 note: erroneous constant encountered
-  --> $DIR/const-ub-checks.rs:LL:CC
+  --> tests/fail/const-ub-checks.rs:LL:CC
    |
 LL |     let _x = UNALIGNED_READ;
    |              ^^^^^^^^^^^^^^
 
 note: erroneous constant encountered
-  --> $DIR/const-ub-checks.rs:LL:CC
+  --> tests/fail/const-ub-checks.rs:LL:CC
    |
 LL |     let _x = UNALIGNED_READ;
    |              ^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/coroutine-pinned-moved.stderr b/src/tools/miri/tests/fail/coroutine-pinned-moved.stderr
index b5b0cbb04e0..c2c6ce987e5 100644
--- a/src/tools/miri/tests/fail/coroutine-pinned-moved.stderr
+++ b/src/tools/miri/tests/fail/coroutine-pinned-moved.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling
-  --> $DIR/coroutine-pinned-moved.rs:LL:CC
+  --> tests/fail/coroutine-pinned-moved.rs:LL:CC
    |
 LL |         *num += 1;
    |         ^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling
@@ -7,25 +7,25 @@ LL |         *num += 1;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/coroutine-pinned-moved.rs:LL:CC
+  --> tests/fail/coroutine-pinned-moved.rs:LL:CC
    |
 LL |         let mut coroutine_iterator = Box::new(CoroutineIteratorAdapter(firstn()));
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: ALLOC was deallocated here:
-  --> $DIR/coroutine-pinned-moved.rs:LL:CC
+  --> tests/fail/coroutine-pinned-moved.rs:LL:CC
    |
 LL |     }; // *deallocate* coroutine_iterator
    |     ^
    = note: BACKTRACE (of the first span):
-   = note: inside closure at $DIR/coroutine-pinned-moved.rs:LL:CC
-note: inside `<CoroutineIteratorAdapter<{static coroutine@$DIR/coroutine-pinned-moved.rs:LL:CC}> as std::iter::Iterator>::next`
-  --> $DIR/coroutine-pinned-moved.rs:LL:CC
+   = note: inside closure at tests/fail/coroutine-pinned-moved.rs:LL:CC
+note: inside `<CoroutineIteratorAdapter<{static coroutine@tests/fail/coroutine-pinned-moved.rs:LL:CC}> as std::iter::Iterator>::next`
+  --> tests/fail/coroutine-pinned-moved.rs:LL:CC
    |
 LL |         match me.resume(()) {
    |               ^^^^^^^^^^^^^
-   = note: inside `<std::boxed::Box<CoroutineIteratorAdapter<{static coroutine@$DIR/coroutine-pinned-moved.rs:LL:CC}>> as std::iter::Iterator>::next` at RUSTLIB/alloc/src/boxed.rs:LL:CC
+   = note: inside `<std::boxed::Box<CoroutineIteratorAdapter<{static coroutine@tests/fail/coroutine-pinned-moved.rs:LL:CC}>> as std::iter::Iterator>::next` at RUSTLIB/alloc/src/boxed.rs:LL:CC
 note: inside `main`
-  --> $DIR/coroutine-pinned-moved.rs:LL:CC
+  --> tests/fail/coroutine-pinned-moved.rs:LL:CC
    |
 LL |     coroutine_iterator_2.next(); // and use moved value
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_deref.stderr b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_deref.stderr
index d7fa84e0ca1..7613552b4b0 100644
--- a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_deref.stderr
+++ b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_deref.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling
-  --> $DIR/dangling_pointer_deref.rs:LL:CC
+  --> tests/fail/dangling_pointers/dangling_pointer_deref.rs:LL:CC
    |
 LL |     let x = unsafe { *p };
    |                      ^^ memory access failed: ALLOC has been freed, so this pointer is dangling
@@ -7,17 +7,17 @@ LL |     let x = unsafe { *p };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/dangling_pointer_deref.rs:LL:CC
+  --> tests/fail/dangling_pointers/dangling_pointer_deref.rs:LL:CC
    |
 LL |         let b = Box::new(42);
    |                 ^^^^^^^^^^^^
 help: ALLOC was deallocated here:
-  --> $DIR/dangling_pointer_deref.rs:LL:CC
+  --> tests/fail/dangling_pointers/dangling_pointer_deref.rs:LL:CC
    |
 LL |     };
    |     ^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/dangling_pointer_deref.rs:LL:CC
+   = note: inside `main` at tests/fail/dangling_pointers/dangling_pointer_deref.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_deref_match_never.stderr b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_deref_match_never.stderr
index 7d38a5649a5..032cbccaf9b 100644
--- a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_deref_match_never.stderr
+++ b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_deref_match_never.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: entering unreachable code
-  --> $DIR/dangling_pointer_deref_match_never.rs:LL:CC
+  --> tests/fail/dangling_pointers/dangling_pointer_deref_match_never.rs:LL:CC
    |
 LL |         match *p {}
    |               ^^ entering unreachable code
@@ -7,7 +7,7 @@ LL |         match *p {}
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/dangling_pointer_deref_match_never.rs:LL:CC
+   = note: inside `main` at tests/fail/dangling_pointers/dangling_pointer_deref_match_never.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_offset.stderr b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_offset.stderr
index b9fbadb1f89..076d6880461 100644
--- a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_offset.stderr
+++ b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_offset.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: out-of-bounds pointer arithmetic: ALLOC has been freed, so this pointer is dangling
-  --> $DIR/dangling_pointer_offset.rs:LL:CC
+  --> tests/fail/dangling_pointers/dangling_pointer_offset.rs:LL:CC
    |
 LL |     let x = unsafe { p.offset(42) };
    |                      ^^^^^^^^^^^^ out-of-bounds pointer arithmetic: ALLOC has been freed, so this pointer is dangling
@@ -7,17 +7,17 @@ LL |     let x = unsafe { p.offset(42) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/dangling_pointer_offset.rs:LL:CC
+  --> tests/fail/dangling_pointers/dangling_pointer_offset.rs:LL:CC
    |
 LL |         let b = Box::new(42);
    |                 ^^^^^^^^^^^^
 help: ALLOC was deallocated here:
-  --> $DIR/dangling_pointer_offset.rs:LL:CC
+  --> tests/fail/dangling_pointers/dangling_pointer_offset.rs:LL:CC
    |
 LL |     };
    |     ^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/dangling_pointer_offset.rs:LL:CC
+   = note: inside `main` at tests/fail/dangling_pointers/dangling_pointer_offset.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_let.stderr b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_let.stderr
index 05e8c95166c..ffb525e3981 100644
--- a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_let.stderr
+++ b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_let.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: out-of-bounds pointer arithmetic: ALLOC has been freed, so this pointer is dangling
-  --> $DIR/dangling_pointer_project_underscore_let.rs:LL:CC
+  --> tests/fail/dangling_pointers/dangling_pointer_project_underscore_let.rs:LL:CC
    |
 LL |         let _ = (*p).1;
    |                 ^^^^^^ out-of-bounds pointer arithmetic: ALLOC has been freed, so this pointer is dangling
@@ -7,17 +7,17 @@ LL |         let _ = (*p).1;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/dangling_pointer_project_underscore_let.rs:LL:CC
+  --> tests/fail/dangling_pointers/dangling_pointer_project_underscore_let.rs:LL:CC
    |
 LL |         let b = Box::new(42);
    |                 ^^^^^^^^^^^^
 help: ALLOC was deallocated here:
-  --> $DIR/dangling_pointer_project_underscore_let.rs:LL:CC
+  --> tests/fail/dangling_pointers/dangling_pointer_project_underscore_let.rs:LL:CC
    |
 LL |     };
    |     ^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/dangling_pointer_project_underscore_let.rs:LL:CC
+   = note: inside `main` at tests/fail/dangling_pointers/dangling_pointer_project_underscore_let.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_let_type_annotation.stderr b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_let_type_annotation.stderr
index 8f7ba156a93..14dfa43b2d6 100644
--- a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_let_type_annotation.stderr
+++ b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_let_type_annotation.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: out-of-bounds pointer arithmetic: ALLOC has been freed, so this pointer is dangling
-  --> $DIR/dangling_pointer_project_underscore_let_type_annotation.rs:LL:CC
+  --> tests/fail/dangling_pointers/dangling_pointer_project_underscore_let_type_annotation.rs:LL:CC
    |
 LL |         let _: u8 = (*p).1;
    |                     ^^^^^^ out-of-bounds pointer arithmetic: ALLOC has been freed, so this pointer is dangling
@@ -7,17 +7,17 @@ LL |         let _: u8 = (*p).1;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/dangling_pointer_project_underscore_let_type_annotation.rs:LL:CC
+  --> tests/fail/dangling_pointers/dangling_pointer_project_underscore_let_type_annotation.rs:LL:CC
    |
 LL |         let b = Box::new(42);
    |                 ^^^^^^^^^^^^
 help: ALLOC was deallocated here:
-  --> $DIR/dangling_pointer_project_underscore_let_type_annotation.rs:LL:CC
+  --> tests/fail/dangling_pointers/dangling_pointer_project_underscore_let_type_annotation.rs:LL:CC
    |
 LL |     };
    |     ^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/dangling_pointer_project_underscore_let_type_annotation.rs:LL:CC
+   = note: inside `main` at tests/fail/dangling_pointers/dangling_pointer_project_underscore_let_type_annotation.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_match.stderr b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_match.stderr
index c2b5d7b23cb..ff39e147573 100644
--- a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_match.stderr
+++ b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_project_underscore_match.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: out-of-bounds pointer arithmetic: ALLOC has been freed, so this pointer is dangling
-  --> $DIR/dangling_pointer_project_underscore_match.rs:LL:CC
+  --> tests/fail/dangling_pointers/dangling_pointer_project_underscore_match.rs:LL:CC
    |
 LL |         match (*p).1 {
    |               ^^^^^^ out-of-bounds pointer arithmetic: ALLOC has been freed, so this pointer is dangling
@@ -7,17 +7,17 @@ LL |         match (*p).1 {
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/dangling_pointer_project_underscore_match.rs:LL:CC
+  --> tests/fail/dangling_pointers/dangling_pointer_project_underscore_match.rs:LL:CC
    |
 LL |         let b = Box::new(42);
    |                 ^^^^^^^^^^^^
 help: ALLOC was deallocated here:
-  --> $DIR/dangling_pointer_project_underscore_match.rs:LL:CC
+  --> tests/fail/dangling_pointers/dangling_pointer_project_underscore_match.rs:LL:CC
    |
 LL |     };
    |     ^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/dangling_pointer_project_underscore_match.rs:LL:CC
+   = note: inside `main` at tests/fail/dangling_pointers/dangling_pointer_project_underscore_match.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.stderr b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.stderr
index a5c031b9496..99194d6e072 100644
--- a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.stderr
+++ b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: out-of-bounds pointer use: expected a pointer to 4 bytes of memory, but got 0x10[noalloc] which is a dangling pointer (it has no provenance)
-  --> $DIR/dangling_pointer_to_raw_pointer.rs:LL:CC
+  --> tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.rs:LL:CC
    |
 LL |     unsafe { &(*x).0 as *const i32 }
    |              ^^^^^^^ out-of-bounds pointer use: expected a pointer to 4 bytes of memory, but got 0x10[noalloc] which is a dangling pointer (it has no provenance)
@@ -7,9 +7,9 @@ LL |     unsafe { &(*x).0 as *const i32 }
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `via_ref` at $DIR/dangling_pointer_to_raw_pointer.rs:LL:CC
+   = note: inside `via_ref` at tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.rs:LL:CC
 note: inside `main`
-  --> $DIR/dangling_pointer_to_raw_pointer.rs:LL:CC
+  --> tests/fail/dangling_pointers/dangling_pointer_to_raw_pointer.rs:LL:CC
    |
 LL |     via_ref(ptr); // this is not
    |     ^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/dangling_pointers/dangling_primitive.stderr b/src/tools/miri/tests/fail/dangling_pointers/dangling_primitive.stderr
index ee02c1040c7..2d7456c15b9 100644
--- a/src/tools/miri/tests/fail/dangling_pointers/dangling_primitive.stderr
+++ b/src/tools/miri/tests/fail/dangling_pointers/dangling_primitive.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling
-  --> $DIR/dangling_primitive.rs:LL:CC
+  --> tests/fail/dangling_pointers/dangling_primitive.rs:LL:CC
    |
 LL |         dbg!(*ptr);
    |         ^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling
@@ -7,12 +7,12 @@ LL |         dbg!(*ptr);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/dangling_primitive.rs:LL:CC
+  --> tests/fail/dangling_pointers/dangling_primitive.rs:LL:CC
    |
 LL |         let x = 0usize; // This line should appear in the helps
    |             ^
 help: ALLOC was deallocated here:
-  --> $DIR/dangling_primitive.rs:LL:CC
+  --> tests/fail/dangling_pointers/dangling_primitive.rs:LL:CC
    |
 LL |     };
    |     ^
diff --git a/src/tools/miri/tests/fail/dangling_pointers/deref-invalid-ptr.stderr b/src/tools/miri/tests/fail/dangling_pointers/deref-invalid-ptr.stderr
index d989bff4516..09a201983b1 100644
--- a/src/tools/miri/tests/fail/dangling_pointers/deref-invalid-ptr.stderr
+++ b/src/tools/miri/tests/fail/dangling_pointers/deref-invalid-ptr.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: out-of-bounds pointer use: expected a pointer to 4 bytes of memory, but got 0x10[noalloc] which is a dangling pointer (it has no provenance)
-  --> $DIR/deref-invalid-ptr.rs:LL:CC
+  --> tests/fail/dangling_pointers/deref-invalid-ptr.rs:LL:CC
    |
 LL |     let _y = unsafe { &*x as *const u32 };
    |                       ^^^ out-of-bounds pointer use: expected a pointer to 4 bytes of memory, but got 0x10[noalloc] which is a dangling pointer (it has no provenance)
@@ -7,7 +7,7 @@ LL |     let _y = unsafe { &*x as *const u32 };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/deref-invalid-ptr.rs:LL:CC
+   = note: inside `main` at tests/fail/dangling_pointers/deref-invalid-ptr.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/dangling_pointers/deref_dangling_box.stderr b/src/tools/miri/tests/fail/dangling_pointers/deref_dangling_box.stderr
index eb4482f5cae..82802f02b99 100644
--- a/src/tools/miri/tests/fail/dangling_pointers/deref_dangling_box.stderr
+++ b/src/tools/miri/tests/fail/dangling_pointers/deref_dangling_box.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered a dangling box (0x18[noalloc] has no provenance)
-  --> $DIR/deref_dangling_box.rs:LL:CC
+  --> tests/fail/dangling_pointers/deref_dangling_box.rs:LL:CC
    |
 LL |     let _val = unsafe { addr_of_mut!(**outer) };
    |                         ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (0x18[noalloc] has no provenance)
diff --git a/src/tools/miri/tests/fail/dangling_pointers/deref_dangling_ref.stderr b/src/tools/miri/tests/fail/dangling_pointers/deref_dangling_ref.stderr
index c0d989dc1a0..364d193b0c5 100644
--- a/src/tools/miri/tests/fail/dangling_pointers/deref_dangling_ref.stderr
+++ b/src/tools/miri/tests/fail/dangling_pointers/deref_dangling_ref.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered a dangling reference (0x18[noalloc] has no provenance)
-  --> $DIR/deref_dangling_ref.rs:LL:CC
+  --> tests/fail/dangling_pointers/deref_dangling_ref.rs:LL:CC
    |
 LL |     let _val = unsafe { addr_of_mut!(**outer) };
    |                         ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (0x18[noalloc] has no provenance)
diff --git a/src/tools/miri/tests/fail/dangling_pointers/dyn_size.stderr b/src/tools/miri/tests/fail/dangling_pointers/dyn_size.stderr
index 7d43857b9bf..f3596347f61 100644
--- a/src/tools/miri/tests/fail/dangling_pointers/dyn_size.stderr
+++ b/src/tools/miri/tests/fail/dangling_pointers/dyn_size.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
-  --> $DIR/dyn_size.rs:LL:CC
+  --> tests/fail/dangling_pointers/dyn_size.rs:LL:CC
    |
 LL |     let _ptr = unsafe { &*ptr };
    |                         ^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
@@ -7,7 +7,7 @@ LL |     let _ptr = unsafe { &*ptr };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/dyn_size.rs:LL:CC
+   = note: inside `main` at tests/fail/dangling_pointers/dyn_size.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/dangling_pointers/null_pointer_deref.stderr b/src/tools/miri/tests/fail/dangling_pointers/null_pointer_deref.stderr
index 1b97265eb32..d87a8bc59e9 100644
--- a/src/tools/miri/tests/fail/dangling_pointers/null_pointer_deref.stderr
+++ b/src/tools/miri/tests/fail/dangling_pointers/null_pointer_deref.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: expected a pointer to 4 bytes of memory, but got a null pointer
-  --> $DIR/null_pointer_deref.rs:LL:CC
+  --> tests/fail/dangling_pointers/null_pointer_deref.rs:LL:CC
    |
 LL |     let x: i32 = unsafe { *std::ptr::null() };
    |                           ^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got a null pointer
@@ -7,7 +7,7 @@ LL |     let x: i32 = unsafe { *std::ptr::null() };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/null_pointer_deref.rs:LL:CC
+   = note: inside `main` at tests/fail/dangling_pointers/null_pointer_deref.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/dangling_pointers/null_pointer_write.stderr b/src/tools/miri/tests/fail/dangling_pointers/null_pointer_write.stderr
index 3d75e7a0254..39d861a6388 100644
--- a/src/tools/miri/tests/fail/dangling_pointers/null_pointer_write.stderr
+++ b/src/tools/miri/tests/fail/dangling_pointers/null_pointer_write.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: expected a pointer to 4 bytes of memory, but got a null pointer
-  --> $DIR/null_pointer_write.rs:LL:CC
+  --> tests/fail/dangling_pointers/null_pointer_write.rs:LL:CC
    |
 LL |     unsafe { *std::ptr::null_mut() = 0i32 };
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got a null pointer
@@ -7,7 +7,7 @@ LL |     unsafe { *std::ptr::null_mut() = 0i32 };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/null_pointer_write.rs:LL:CC
+   = note: inside `main` at tests/fail/dangling_pointers/null_pointer_write.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_project.stderr b/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_project.stderr
index 4bfac8f9657..27a437c7483 100644
--- a/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_project.stderr
+++ b/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_project.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: out-of-bounds pointer arithmetic: expected a pointer to 8 bytes of memory, but got ALLOC which is only 4 bytes from the end of the allocation
-  --> $DIR/out_of_bounds_project.rs:LL:CC
+  --> tests/fail/dangling_pointers/out_of_bounds_project.rs:LL:CC
    |
 LL |         let _field = addr_of!((*ptr).2);
    |                      ^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: expected a pointer to 8 bytes of memory, but got ALLOC which is only 4 bytes from the end of the allocation
@@ -7,7 +7,7 @@ LL |         let _field = addr_of!((*ptr).2);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/out_of_bounds_project.rs:LL:CC
+  --> tests/fail/dangling_pointers/out_of_bounds_project.rs:LL:CC
    |
 LL |     let v = 0u32;
    |         ^
diff --git a/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_read.stderr b/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_read.stderr
index 8a774c21bb7..813bcef54f1 100644
--- a/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_read.stderr
+++ b/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_read.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: expected a pointer to 2 bytes of memory, but got ALLOC+0x5 which is at or beyond the end of the allocation of size 4 bytes
-  --> $DIR/out_of_bounds_read.rs:LL:CC
+  --> tests/fail/dangling_pointers/out_of_bounds_read.rs:LL:CC
    |
 LL |     let x = unsafe { *v.as_ptr().wrapping_byte_add(5) };
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 2 bytes of memory, but got ALLOC+0x5 which is at or beyond the end of the allocation of size 4 bytes
@@ -7,12 +7,12 @@ LL |     let x = unsafe { *v.as_ptr().wrapping_byte_add(5) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/out_of_bounds_read.rs:LL:CC
+  --> tests/fail/dangling_pointers/out_of_bounds_read.rs:LL:CC
    |
 LL |     let v: Vec<u16> = vec![1, 2];
    |                       ^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/out_of_bounds_read.rs:LL:CC
+   = note: inside `main` at tests/fail/dangling_pointers/out_of_bounds_read.rs:LL:CC
    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
diff --git a/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_write.stderr b/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_write.stderr
index 6ae9f05d173..1056a739a43 100644
--- a/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_write.stderr
+++ b/src/tools/miri/tests/fail/dangling_pointers/out_of_bounds_write.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: expected a pointer to 2 bytes of memory, but got ALLOC+0x5 which is at or beyond the end of the allocation of size 4 bytes
-  --> $DIR/out_of_bounds_write.rs:LL:CC
+  --> tests/fail/dangling_pointers/out_of_bounds_write.rs:LL:CC
    |
 LL |     unsafe { *v.as_mut_ptr().wrapping_byte_add(5) = 0 };
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 2 bytes of memory, but got ALLOC+0x5 which is at or beyond the end of the allocation of size 4 bytes
@@ -7,12 +7,12 @@ LL |     unsafe { *v.as_mut_ptr().wrapping_byte_add(5) = 0 };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/out_of_bounds_write.rs:LL:CC
+  --> tests/fail/dangling_pointers/out_of_bounds_write.rs:LL:CC
    |
 LL |     let mut v: Vec<u16> = vec![1, 2];
    |                           ^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/out_of_bounds_write.rs:LL:CC
+   = note: inside `main` at tests/fail/dangling_pointers/out_of_bounds_write.rs:LL:CC
    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
diff --git a/src/tools/miri/tests/fail/dangling_pointers/stack_temporary.stderr b/src/tools/miri/tests/fail/dangling_pointers/stack_temporary.stderr
index d5c53e4ad64..c617dfdb3a6 100644
--- a/src/tools/miri/tests/fail/dangling_pointers/stack_temporary.stderr
+++ b/src/tools/miri/tests/fail/dangling_pointers/stack_temporary.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling
-  --> $DIR/stack_temporary.rs:LL:CC
+  --> tests/fail/dangling_pointers/stack_temporary.rs:LL:CC
    |
 LL |         let val = *x;
    |                   ^^ memory access failed: ALLOC has been freed, so this pointer is dangling
@@ -7,17 +7,17 @@ LL |         let val = *x;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/stack_temporary.rs:LL:CC
+  --> tests/fail/dangling_pointers/stack_temporary.rs:LL:CC
    |
 LL |         let x = make_ref(&mut 0); // The temporary storing "0" is deallocated at the ";"!
    |                               ^
 help: ALLOC was deallocated here:
-  --> $DIR/stack_temporary.rs:LL:CC
+  --> tests/fail/dangling_pointers/stack_temporary.rs:LL:CC
    |
 LL |         let x = make_ref(&mut 0); // The temporary storing "0" is deallocated at the ";"!
    |                                 ^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/stack_temporary.rs:LL:CC
+   = note: inside `main` at tests/fail/dangling_pointers/stack_temporary.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/dangling_pointers/storage_dead_dangling.stderr b/src/tools/miri/tests/fail/dangling_pointers/storage_dead_dangling.stderr
index 2d4fbafd8b7..9061121494d 100644
--- a/src/tools/miri/tests/fail/dangling_pointers/storage_dead_dangling.stderr
+++ b/src/tools/miri/tests/fail/dangling_pointers/storage_dead_dangling.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: out-of-bounds pointer use: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance)
-  --> $DIR/storage_dead_dangling.rs:LL:CC
+  --> tests/fail/dangling_pointers/storage_dead_dangling.rs:LL:CC
    |
 LL |     let _ref = unsafe { &mut *(LEAK as *mut i32) };
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance)
@@ -7,9 +7,9 @@ LL |     let _ref = unsafe { &mut *(LEAK as *mut i32) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `evil` at $DIR/storage_dead_dangling.rs:LL:CC
+   = note: inside `evil` at tests/fail/dangling_pointers/storage_dead_dangling.rs:LL:CC
 note: inside `main`
-  --> $DIR/storage_dead_dangling.rs:LL:CC
+  --> tests/fail/dangling_pointers/storage_dead_dangling.rs:LL:CC
    |
 LL |     evil();
    |     ^^^^^^
diff --git a/src/tools/miri/tests/fail/dangling_pointers/wild_pointer_deref.stderr b/src/tools/miri/tests/fail/dangling_pointers/wild_pointer_deref.stderr
index 1d8eed3d30a..3e7aac4724d 100644
--- a/src/tools/miri/tests/fail/dangling_pointers/wild_pointer_deref.stderr
+++ b/src/tools/miri/tests/fail/dangling_pointers/wild_pointer_deref.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: expected a pointer to 4 bytes of memory, but got 0x2c[noalloc] which is a dangling pointer (it has no provenance)
-  --> $DIR/wild_pointer_deref.rs:LL:CC
+  --> tests/fail/dangling_pointers/wild_pointer_deref.rs:LL:CC
    |
 LL |     let x = unsafe { *p };
    |                      ^^ memory access failed: expected a pointer to 4 bytes of memory, but got 0x2c[noalloc] which is a dangling pointer (it has no provenance)
@@ -7,7 +7,7 @@ LL |     let x = unsafe { *p };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/wild_pointer_deref.rs:LL:CC
+   = note: inside `main` at tests/fail/dangling_pointers/wild_pointer_deref.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/alloc_read_race.stderr b/src/tools/miri/tests/fail/data_race/alloc_read_race.stderr
index 59ed5fe9cf2..e6ee9ce81fd 100644
--- a/src/tools/miri/tests/fail/data_race/alloc_read_race.stderr
+++ b/src/tools/miri/tests/fail/data_race/alloc_read_race.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) creating a new allocation on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/alloc_read_race.rs:LL:CC
+  --> tests/fail/data_race/alloc_read_race.rs:LL:CC
    |
 LL |             *pointer.load(Ordering::Relaxed)
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) creating a new allocation on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/alloc_read_race.rs:LL:CC
+  --> tests/fail/data_race/alloc_read_race.rs:LL:CC
    |
 LL |             pointer.store(Box::into_raw(Box::new_uninit()), Ordering::Relaxed);
    |                                         ^^^^^^^^^^^^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/alloc_read_race.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/alloc_read_race.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/alloc_write_race.stderr b/src/tools/miri/tests/fail/data_race/alloc_write_race.stderr
index 9770684fc52..97b54609ade 100644
--- a/src/tools/miri/tests/fail/data_race/alloc_write_race.stderr
+++ b/src/tools/miri/tests/fail/data_race/alloc_write_race.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) creating a new allocation on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/alloc_write_race.rs:LL:CC
+  --> tests/fail/data_race/alloc_write_race.rs:LL:CC
    |
 LL |             *pointer.load(Ordering::Relaxed) = 2;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) creating a new allocation on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/alloc_write_race.rs:LL:CC
+  --> tests/fail/data_race/alloc_write_race.rs:LL:CC
    |
 LL |                 .store(Box::into_raw(Box::<usize>::new_uninit()) as *mut usize, Ordering::Relaxed);
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/alloc_write_race.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/alloc_write_race.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race1.stderr b/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race1.stderr
index a1132ed2067..d3d6ed2e311 100644
--- a/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race1.stderr
+++ b/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race1.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) atomic load on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/atomic_read_na_write_race1.rs:LL:CC
+  --> tests/fail/data_race/atomic_read_na_write_race1.rs:LL:CC
    |
 LL |             (&*c.0).load(Ordering::SeqCst)
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) atomic load on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/atomic_read_na_write_race1.rs:LL:CC
+  --> tests/fail/data_race/atomic_read_na_write_race1.rs:LL:CC
    |
 LL |             *(c.0 as *mut usize) = 32;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/atomic_read_na_write_race1.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/atomic_read_na_write_race1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race2.stderr b/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race2.stderr
index 865357cb0ef..ea535ddac4f 100644
--- a/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race2.stderr
+++ b/src/tools/miri/tests/fail/data_race/atomic_read_na_write_race2.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) atomic load on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/atomic_read_na_write_race2.rs:LL:CC
+  --> tests/fail/data_race/atomic_read_na_write_race2.rs:LL:CC
    |
 LL |             *atomic_ref.get_mut() = 32;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) atomic load on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/atomic_read_na_write_race2.rs:LL:CC
+  --> tests/fail/data_race/atomic_read_na_write_race2.rs:LL:CC
    |
 LL |             atomic_ref.load(Ordering::SeqCst)
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/atomic_read_na_write_race2.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/atomic_read_na_write_race2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race1.stderr b/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race1.stderr
index 355ea48f117..fe65eca4bc6 100644
--- a/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race1.stderr
+++ b/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race1.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) atomic store on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/atomic_write_na_read_race1.rs:LL:CC
+  --> tests/fail/data_race/atomic_write_na_read_race1.rs:LL:CC
    |
 LL |             *atomic_ref.get_mut()
    |             ^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) atomic store on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/atomic_write_na_read_race1.rs:LL:CC
+  --> tests/fail/data_race/atomic_write_na_read_race1.rs:LL:CC
    |
 LL |             atomic_ref.store(32, Ordering::SeqCst)
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/atomic_write_na_read_race1.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/atomic_write_na_read_race1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race2.stderr b/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race2.stderr
index 500cd09a333..4393cc3c093 100644
--- a/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race2.stderr
+++ b/src/tools/miri/tests/fail/data_race/atomic_write_na_read_race2.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) atomic store on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/atomic_write_na_read_race2.rs:LL:CC
+  --> tests/fail/data_race/atomic_write_na_read_race2.rs:LL:CC
    |
 LL |             (&*c.0).store(32, Ordering::SeqCst);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) atomic store on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/atomic_write_na_read_race2.rs:LL:CC
+  --> tests/fail/data_race/atomic_write_na_read_race2.rs:LL:CC
    |
 LL |             let _val = *(c.0 as *mut usize);
    |                        ^^^^^^^^^^^^^^^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/atomic_write_na_read_race2.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/atomic_write_na_read_race2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race1.stderr b/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race1.stderr
index 0b870f13bb2..5a7f90447f0 100644
--- a/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race1.stderr
+++ b/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race1.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) atomic store on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/atomic_write_na_write_race1.rs:LL:CC
+  --> tests/fail/data_race/atomic_write_na_write_race1.rs:LL:CC
    |
 LL |             (&*c.0).store(64, Ordering::SeqCst);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) atomic store on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/atomic_write_na_write_race1.rs:LL:CC
+  --> tests/fail/data_race/atomic_write_na_write_race1.rs:LL:CC
    |
 LL |             *(c.0 as *mut usize) = 32;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/atomic_write_na_write_race1.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/atomic_write_na_write_race1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race2.stderr b/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race2.stderr
index dbbf6bf1ef5..9ee4f16d0d5 100644
--- a/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race2.stderr
+++ b/src/tools/miri/tests/fail/data_race/atomic_write_na_write_race2.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) atomic store on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/atomic_write_na_write_race2.rs:LL:CC
+  --> tests/fail/data_race/atomic_write_na_write_race2.rs:LL:CC
    |
 LL |             *atomic_ref.get_mut() = 32;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) atomic store on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/atomic_write_na_write_race2.rs:LL:CC
+  --> tests/fail/data_race/atomic_write_na_write_race2.rs:LL:CC
    |
 LL |             atomic_ref.store(64, Ordering::SeqCst);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/atomic_write_na_write_race2.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/atomic_write_na_write_race2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/dangling_thread_async_race.stderr b/src/tools/miri/tests/fail/data_race/dangling_thread_async_race.stderr
index 1b02880b998..1051a1c51f2 100644
--- a/src/tools/miri/tests/fail/data_race/dangling_thread_async_race.stderr
+++ b/src/tools/miri/tests/fail/data_race/dangling_thread_async_race.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/dangling_thread_async_race.rs:LL:CC
+  --> tests/fail/data_race/dangling_thread_async_race.rs:LL:CC
    |
 LL |             *c.0 = 64;
    |             ^^^^^^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/dangling_thread_async_race.rs:LL:CC
+  --> tests/fail/data_race/dangling_thread_async_race.rs:LL:CC
    |
 LL |             *c.0 = 32;
    |             ^^^^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/dangling_thread_async_race.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/dangling_thread_async_race.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/dangling_thread_race.stderr b/src/tools/miri/tests/fail/data_race/dangling_thread_race.stderr
index 7f6ba5ee040..23a99ff6c8a 100644
--- a/src/tools/miri/tests/fail/data_race/dangling_thread_race.stderr
+++ b/src/tools/miri/tests/fail/data_race/dangling_thread_race.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `main` at ALLOC. (2) just happened here
-  --> $DIR/dangling_thread_race.rs:LL:CC
+  --> tests/fail/data_race/dangling_thread_race.rs:LL:CC
    |
 LL |         *c.0 = 64;
    |         ^^^^^^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `main` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/dangling_thread_race.rs:LL:CC
+  --> tests/fail/data_race/dangling_thread_race.rs:LL:CC
    |
 LL |             *c.0 = 32;
    |             ^^^^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/dangling_thread_race.rs:LL:CC
+   = note: inside `main` at tests/fail/data_race/dangling_thread_race.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/dealloc_read_race1.stderr b/src/tools/miri/tests/fail/data_race/dealloc_read_race1.stderr
index a4a22a8d71e..8eb4ebbcf72 100644
--- a/src/tools/miri/tests/fail/data_race/dealloc_read_race1.stderr
+++ b/src/tools/miri/tests/fail/data_race/dealloc_read_race1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) deallocation on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/dealloc_read_race1.rs:LL:CC
+  --> tests/fail/data_race/dealloc_read_race1.rs:LL:CC
    |
 LL | /             __rust_dealloc(
 LL | |
@@ -10,14 +10,14 @@ LL | |             );
    | |_____________^ Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) deallocation on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/dealloc_read_race1.rs:LL:CC
+  --> tests/fail/data_race/dealloc_read_race1.rs:LL:CC
    |
 LL |             let _val = *ptr.0;
    |                        ^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/dealloc_read_race1.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/dealloc_read_race1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/dealloc_read_race2.stderr b/src/tools/miri/tests/fail/data_race/dealloc_read_race2.stderr
index dbf9acd23b6..1a2b048572a 100644
--- a/src/tools/miri/tests/fail/data_race/dealloc_read_race2.stderr
+++ b/src/tools/miri/tests/fail/data_race/dealloc_read_race2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling
-  --> $DIR/dealloc_read_race2.rs:LL:CC
+  --> tests/fail/data_race/dealloc_read_race2.rs:LL:CC
    |
 LL |             *ptr.0
    |             ^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling
@@ -7,12 +7,12 @@ LL |             *ptr.0
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/dealloc_read_race2.rs:LL:CC
+  --> tests/fail/data_race/dealloc_read_race2.rs:LL:CC
    |
 LL |     let pointer: *mut usize = Box::into_raw(Box::new(0usize));
    |                                             ^^^^^^^^^^^^^^^^
 help: ALLOC was deallocated here:
-  --> $DIR/dealloc_read_race2.rs:LL:CC
+  --> tests/fail/data_race/dealloc_read_race2.rs:LL:CC
    |
 LL | /             __rust_dealloc(
 LL | |                 ptr.0 as *mut _,
@@ -21,7 +21,7 @@ LL | |                 std::mem::align_of::<usize>(),
 LL | |             )
    | |_____________^
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/dealloc_read_race2.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/dealloc_read_race2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/dealloc_read_race_stack.stderr b/src/tools/miri/tests/fail/data_race/dealloc_read_race_stack.stderr
index e36376d0c75..ce9719b1d46 100644
--- a/src/tools/miri/tests/fail/data_race/dealloc_read_race_stack.stderr
+++ b/src/tools/miri/tests/fail/data_race/dealloc_read_race_stack.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) deallocation on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/dealloc_read_race_stack.rs:LL:CC
+  --> tests/fail/data_race/dealloc_read_race_stack.rs:LL:CC
    |
 LL |             }
    |             ^ Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) deallocation on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/dealloc_read_race_stack.rs:LL:CC
+  --> tests/fail/data_race/dealloc_read_race_stack.rs:LL:CC
    |
 LL |             *pointer.load(Ordering::Acquire)
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/dealloc_read_race_stack.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/dealloc_read_race_stack.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/dealloc_write_race1.stderr b/src/tools/miri/tests/fail/data_race/dealloc_write_race1.stderr
index 0c6cd9bbd93..48d974241aa 100644
--- a/src/tools/miri/tests/fail/data_race/dealloc_write_race1.stderr
+++ b/src/tools/miri/tests/fail/data_race/dealloc_write_race1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) deallocation on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/dealloc_write_race1.rs:LL:CC
+  --> tests/fail/data_race/dealloc_write_race1.rs:LL:CC
    |
 LL | /             __rust_dealloc(
 LL | |
@@ -10,14 +10,14 @@ LL | |             );
    | |_____________^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) deallocation on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/dealloc_write_race1.rs:LL:CC
+  --> tests/fail/data_race/dealloc_write_race1.rs:LL:CC
    |
 LL |             *ptr.0 = 2;
    |             ^^^^^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/dealloc_write_race1.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/dealloc_write_race1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/dealloc_write_race2.stderr b/src/tools/miri/tests/fail/data_race/dealloc_write_race2.stderr
index 30093735313..077d4588266 100644
--- a/src/tools/miri/tests/fail/data_race/dealloc_write_race2.stderr
+++ b/src/tools/miri/tests/fail/data_race/dealloc_write_race2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling
-  --> $DIR/dealloc_write_race2.rs:LL:CC
+  --> tests/fail/data_race/dealloc_write_race2.rs:LL:CC
    |
 LL |             *ptr.0 = 2;
    |             ^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling
@@ -7,12 +7,12 @@ LL |             *ptr.0 = 2;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/dealloc_write_race2.rs:LL:CC
+  --> tests/fail/data_race/dealloc_write_race2.rs:LL:CC
    |
 LL |     let pointer: *mut usize = Box::into_raw(Box::new(0usize));
    |                                             ^^^^^^^^^^^^^^^^
 help: ALLOC was deallocated here:
-  --> $DIR/dealloc_write_race2.rs:LL:CC
+  --> tests/fail/data_race/dealloc_write_race2.rs:LL:CC
    |
 LL | /             __rust_dealloc(
 LL | |                 ptr.0 as *mut _,
@@ -21,7 +21,7 @@ LL | |                 std::mem::align_of::<usize>(),
 LL | |             );
    | |_____________^
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/dealloc_write_race2.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/dealloc_write_race2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/dealloc_write_race_stack.stderr b/src/tools/miri/tests/fail/data_race/dealloc_write_race_stack.stderr
index 4c16162fa1f..2b531b6440c 100644
--- a/src/tools/miri/tests/fail/data_race/dealloc_write_race_stack.stderr
+++ b/src/tools/miri/tests/fail/data_race/dealloc_write_race_stack.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) deallocation on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/dealloc_write_race_stack.rs:LL:CC
+  --> tests/fail/data_race/dealloc_write_race_stack.rs:LL:CC
    |
 LL |             }
    |             ^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) deallocation on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/dealloc_write_race_stack.rs:LL:CC
+  --> tests/fail/data_race/dealloc_write_race_stack.rs:LL:CC
    |
 LL |             *pointer.load(Ordering::Acquire) = 3;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/dealloc_write_race_stack.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/dealloc_write_race_stack.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/enable_after_join_to_main.stderr b/src/tools/miri/tests/fail/data_race/enable_after_join_to_main.stderr
index 686d9b48e53..5d5d1c8cc68 100644
--- a/src/tools/miri/tests/fail/data_race/enable_after_join_to_main.stderr
+++ b/src/tools/miri/tests/fail/data_race/enable_after_join_to_main.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/enable_after_join_to_main.rs:LL:CC
+  --> tests/fail/data_race/enable_after_join_to_main.rs:LL:CC
    |
 LL |             *c.0 = 64;
    |             ^^^^^^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/enable_after_join_to_main.rs:LL:CC
+  --> tests/fail/data_race/enable_after_join_to_main.rs:LL:CC
    |
 LL |             *c.0 = 32;
    |             ^^^^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/enable_after_join_to_main.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/enable_after_join_to_main.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/fence_after_load.stderr b/src/tools/miri/tests/fail/data_race/fence_after_load.stderr
index 776cf7c17b9..03b3c6f8f0b 100644
--- a/src/tools/miri/tests/fail/data_race/fence_after_load.stderr
+++ b/src/tools/miri/tests/fail/data_race/fence_after_load.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `main` at ALLOC. (2) just happened here
-  --> $DIR/fence_after_load.rs:LL:CC
+  --> tests/fail/data_race/fence_after_load.rs:LL:CC
    |
 LL |     unsafe { V = 2 }
    |              ^^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `main` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/fence_after_load.rs:LL:CC
+  --> tests/fail/data_race/fence_after_load.rs:LL:CC
    |
 LL |         unsafe { V = 1 }
    |                  ^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/fence_after_load.rs:LL:CC
+   = note: inside `main` at tests/fail/data_race/fence_after_load.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/local_variable_alloc_race.stderr b/src/tools/miri/tests/fail/data_race/local_variable_alloc_race.stderr
index f46eb078a51..51a4c5cea30 100644
--- a/src/tools/miri/tests/fail/data_race/local_variable_alloc_race.stderr
+++ b/src/tools/miri/tests/fail/data_race/local_variable_alloc_race.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) creating a new allocation on thread `main` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/local_variable_alloc_race.rs:LL:CC
+  --> tests/fail/data_race/local_variable_alloc_race.rs:LL:CC
    |
 LL |             *ptr = 127;
    |             ^^^^^^^^^^ Data race detected between (1) creating a new allocation on thread `main` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/local_variable_alloc_race.rs:LL:CC
+  --> tests/fail/data_race/local_variable_alloc_race.rs:LL:CC
    |
 LL |             StorageLive(val);
    |             ^^^^^^^^^^^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/local_variable_alloc_race.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/local_variable_alloc_race.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/local_variable_read_race.stderr b/src/tools/miri/tests/fail/data_race/local_variable_read_race.stderr
index d14c2fb47ff..3faffd4131e 100644
--- a/src/tools/miri/tests/fail/data_race/local_variable_read_race.stderr
+++ b/src/tools/miri/tests/fail/data_race/local_variable_read_race.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic read on thread `main` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/local_variable_read_race.rs:LL:CC
+  --> tests/fail/data_race/local_variable_read_race.rs:LL:CC
    |
 LL |             *ptr = 127;
    |             ^^^^^^^^^^ Data race detected between (1) non-atomic read on thread `main` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/local_variable_read_race.rs:LL:CC
+  --> tests/fail/data_race/local_variable_read_race.rs:LL:CC
    |
 LL |     let _val = val;
    |                ^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/local_variable_read_race.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/local_variable_read_race.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/local_variable_write_race.stderr b/src/tools/miri/tests/fail/data_race/local_variable_write_race.stderr
index d84db955a3d..24bbe227f9e 100644
--- a/src/tools/miri/tests/fail/data_race/local_variable_write_race.stderr
+++ b/src/tools/miri/tests/fail/data_race/local_variable_write_race.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `main` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/local_variable_write_race.rs:LL:CC
+  --> tests/fail/data_race/local_variable_write_race.rs:LL:CC
    |
 LL |             *ptr = 127;
    |             ^^^^^^^^^^ Data race detected between (1) non-atomic write on thread `main` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/local_variable_write_race.rs:LL:CC
+  --> tests/fail/data_race/local_variable_write_race.rs:LL:CC
    |
 LL |     let mut val: u8 = 0;
    |                       ^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/local_variable_write_race.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/local_variable_write_race.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/mixed_size_read.stderr b/src/tools/miri/tests/fail/data_race/mixed_size_read.stderr
index 5b25c666f41..31a798a89b1 100644
--- a/src/tools/miri/tests/fail/data_race/mixed_size_read.stderr
+++ b/src/tools/miri/tests/fail/data_race/mixed_size_read.stderr
@@ -1,11 +1,11 @@
 error: Undefined Behavior: Race condition detected between (1) 2-byte atomic load on thread `unnamed-ID` and (2) 1-byte atomic load on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/mixed_size_read.rs:LL:CC
+  --> tests/fail/data_race/mixed_size_read.rs:LL:CC
    |
 LL |             a8[0].load(Ordering::SeqCst);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Race condition detected between (1) 2-byte atomic load on thread `unnamed-ID` and (2) 1-byte atomic load on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/mixed_size_read.rs:LL:CC
+  --> tests/fail/data_race/mixed_size_read.rs:LL:CC
    |
 LL |             a16.load(Ordering::SeqCst);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -14,7 +14,7 @@ LL |             a16.load(Ordering::SeqCst);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/mixed_size_read.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/mixed_size_read.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/mixed_size_write.stderr b/src/tools/miri/tests/fail/data_race/mixed_size_write.stderr
index c6157b87b38..c30b48c1f32 100644
--- a/src/tools/miri/tests/fail/data_race/mixed_size_write.stderr
+++ b/src/tools/miri/tests/fail/data_race/mixed_size_write.stderr
@@ -1,11 +1,11 @@
 error: Undefined Behavior: Race condition detected between (1) 2-byte atomic store on thread `unnamed-ID` and (2) 1-byte atomic store on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/mixed_size_write.rs:LL:CC
+  --> tests/fail/data_race/mixed_size_write.rs:LL:CC
    |
 LL |             a8[0].store(1, Ordering::SeqCst);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Race condition detected between (1) 2-byte atomic store on thread `unnamed-ID` and (2) 1-byte atomic store on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/mixed_size_write.rs:LL:CC
+  --> tests/fail/data_race/mixed_size_write.rs:LL:CC
    |
 LL |             a16.store(1, Ordering::SeqCst);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -14,7 +14,7 @@ LL |             a16.store(1, Ordering::SeqCst);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/mixed_size_write.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/mixed_size_write.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/read_read_race1.stderr b/src/tools/miri/tests/fail/data_race/read_read_race1.stderr
index 37ef46335d4..e97c4a4fdcb 100644
--- a/src/tools/miri/tests/fail/data_race/read_read_race1.stderr
+++ b/src/tools/miri/tests/fail/data_race/read_read_race1.stderr
@@ -1,11 +1,11 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) atomic load on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/read_read_race1.rs:LL:CC
+  --> tests/fail/data_race/read_read_race1.rs:LL:CC
    |
 LL |             a.load(Ordering::SeqCst);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) atomic load on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/read_read_race1.rs:LL:CC
+  --> tests/fail/data_race/read_read_race1.rs:LL:CC
    |
 LL |             unsafe { ptr.read() };
    |                      ^^^^^^^^^^
@@ -14,7 +14,7 @@ LL |             unsafe { ptr.read() };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/read_read_race1.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/read_read_race1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/read_read_race2.stderr b/src/tools/miri/tests/fail/data_race/read_read_race2.stderr
index e0cabf62a25..d64032db7b3 100644
--- a/src/tools/miri/tests/fail/data_race/read_read_race2.stderr
+++ b/src/tools/miri/tests/fail/data_race/read_read_race2.stderr
@@ -1,11 +1,11 @@
 error: Undefined Behavior: Data race detected between (1) atomic load on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/read_read_race2.rs:LL:CC
+  --> tests/fail/data_race/read_read_race2.rs:LL:CC
    |
 LL |             unsafe { ptr.read() };
    |                      ^^^^^^^^^^ Data race detected between (1) atomic load on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/read_read_race2.rs:LL:CC
+  --> tests/fail/data_race/read_read_race2.rs:LL:CC
    |
 LL |             a.load(Ordering::SeqCst);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -14,7 +14,7 @@ LL |             a.load(Ordering::SeqCst);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/read_read_race2.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/read_read_race2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/read_write_race.stderr b/src/tools/miri/tests/fail/data_race/read_write_race.stderr
index 8558db4bfdc..eac5a0c8a6c 100644
--- a/src/tools/miri/tests/fail/data_race/read_write_race.stderr
+++ b/src/tools/miri/tests/fail/data_race/read_write_race.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/read_write_race.rs:LL:CC
+  --> tests/fail/data_race/read_write_race.rs:LL:CC
    |
 LL |             *c.0 = 64;
    |             ^^^^^^^^^ Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/read_write_race.rs:LL:CC
+  --> tests/fail/data_race/read_write_race.rs:LL:CC
    |
 LL |             let _val = *c.0;
    |                        ^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/read_write_race.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/read_write_race.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/read_write_race_stack.stderr b/src/tools/miri/tests/fail/data_race/read_write_race_stack.stderr
index 7ca249a917b..9af78bc79a3 100644
--- a/src/tools/miri/tests/fail/data_race/read_write_race_stack.stderr
+++ b/src/tools/miri/tests/fail/data_race/read_write_race_stack.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/read_write_race_stack.rs:LL:CC
+  --> tests/fail/data_race/read_write_race_stack.rs:LL:CC
    |
 LL |             stack_var
    |             ^^^^^^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/read_write_race_stack.rs:LL:CC
+  --> tests/fail/data_race/read_write_race_stack.rs:LL:CC
    |
 LL |             *pointer.load(Ordering::Acquire) = 3;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/read_write_race_stack.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/read_write_race_stack.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/relax_acquire_race.stderr b/src/tools/miri/tests/fail/data_race/relax_acquire_race.stderr
index b5e6895302f..a358d8da364 100644
--- a/src/tools/miri/tests/fail/data_race/relax_acquire_race.stderr
+++ b/src/tools/miri/tests/fail/data_race/relax_acquire_race.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/relax_acquire_race.rs:LL:CC
+  --> tests/fail/data_race/relax_acquire_race.rs:LL:CC
    |
 LL |                 *c.0
    |                 ^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/relax_acquire_race.rs:LL:CC
+  --> tests/fail/data_race/relax_acquire_race.rs:LL:CC
    |
 LL |             *c.0 = 1;
    |             ^^^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/relax_acquire_race.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/relax_acquire_race.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/release_seq_race.stderr b/src/tools/miri/tests/fail/data_race/release_seq_race.stderr
index e031c55ecb1..f47e463dd63 100644
--- a/src/tools/miri/tests/fail/data_race/release_seq_race.stderr
+++ b/src/tools/miri/tests/fail/data_race/release_seq_race.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/release_seq_race.rs:LL:CC
+  --> tests/fail/data_race/release_seq_race.rs:LL:CC
    |
 LL |                 *c.0
    |                 ^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/release_seq_race.rs:LL:CC
+  --> tests/fail/data_race/release_seq_race.rs:LL:CC
    |
 LL |             *c.0 = 1;
    |             ^^^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/release_seq_race.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/release_seq_race.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/release_seq_race_same_thread.stderr b/src/tools/miri/tests/fail/data_race/release_seq_race_same_thread.stderr
index 86183e1e43f..2d26d4cf68a 100644
--- a/src/tools/miri/tests/fail/data_race/release_seq_race_same_thread.stderr
+++ b/src/tools/miri/tests/fail/data_race/release_seq_race_same_thread.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/release_seq_race_same_thread.rs:LL:CC
+  --> tests/fail/data_race/release_seq_race_same_thread.rs:LL:CC
    |
 LL |                 *c.0
    |                 ^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/release_seq_race_same_thread.rs:LL:CC
+  --> tests/fail/data_race/release_seq_race_same_thread.rs:LL:CC
    |
 LL |             *c.0 = 1;
    |             ^^^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/release_seq_race_same_thread.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/release_seq_race_same_thread.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/rmw_race.stderr b/src/tools/miri/tests/fail/data_race/rmw_race.stderr
index 2aa27cc8c7f..4a991db32d6 100644
--- a/src/tools/miri/tests/fail/data_race/rmw_race.stderr
+++ b/src/tools/miri/tests/fail/data_race/rmw_race.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/rmw_race.rs:LL:CC
+  --> tests/fail/data_race/rmw_race.rs:LL:CC
    |
 LL |                 *c.0
    |                 ^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic read on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/rmw_race.rs:LL:CC
+  --> tests/fail/data_race/rmw_race.rs:LL:CC
    |
 LL |             *c.0 = 1;
    |             ^^^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/rmw_race.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/rmw_race.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/stack_pop_race.stderr b/src/tools/miri/tests/fail/data_race/stack_pop_race.stderr
index 683acc1abd2..643426aba99 100644
--- a/src/tools/miri/tests/fail/data_race/stack_pop_race.stderr
+++ b/src/tools/miri/tests/fail/data_race/stack_pop_race.stderr
@@ -1,20 +1,20 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) deallocation on thread `main` at ALLOC. (2) just happened here
-  --> $DIR/stack_pop_race.rs:LL:CC
+  --> tests/fail/data_race/stack_pop_race.rs:LL:CC
    |
 LL | }
    |  ^ Data race detected between (1) non-atomic read on thread `unnamed-ID` and (2) deallocation on thread `main` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/stack_pop_race.rs:LL:CC
+  --> tests/fail/data_race/stack_pop_race.rs:LL:CC
    |
 LL |         let _val = unsafe { *ptr.0 };
    |                             ^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span):
-   = note: inside `race` at $DIR/stack_pop_race.rs:LL:CC
+   = note: inside `race` at tests/fail/data_race/stack_pop_race.rs:LL:CC
 note: inside `main`
-  --> $DIR/stack_pop_race.rs:LL:CC
+  --> tests/fail/data_race/stack_pop_race.rs:LL:CC
    |
 LL |     race(0);
    |     ^^^^^^^
diff --git a/src/tools/miri/tests/fail/data_race/write_write_race.stderr b/src/tools/miri/tests/fail/data_race/write_write_race.stderr
index 37b758ab2a5..2ea54421b89 100644
--- a/src/tools/miri/tests/fail/data_race/write_write_race.stderr
+++ b/src/tools/miri/tests/fail/data_race/write_write_race.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/write_write_race.rs:LL:CC
+  --> tests/fail/data_race/write_write_race.rs:LL:CC
    |
 LL |             *c.0 = 64;
    |             ^^^^^^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/write_write_race.rs:LL:CC
+  --> tests/fail/data_race/write_write_race.rs:LL:CC
    |
 LL |             *c.0 = 32;
    |             ^^^^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/write_write_race.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/write_write_race.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/data_race/write_write_race_stack.stderr b/src/tools/miri/tests/fail/data_race/write_write_race_stack.stderr
index 2503a4f4ba8..0cd9de11318 100644
--- a/src/tools/miri/tests/fail/data_race/write_write_race_stack.stderr
+++ b/src/tools/miri/tests/fail/data_race/write_write_race_stack.stderr
@@ -1,18 +1,18 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/write_write_race_stack.rs:LL:CC
+  --> tests/fail/data_race/write_write_race_stack.rs:LL:CC
    |
 LL |             stack_var = 1usize;
    |             ^^^^^^^^^^^^^^^^^^ Data race detected between (1) non-atomic write on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/write_write_race_stack.rs:LL:CC
+  --> tests/fail/data_race/write_write_race_stack.rs:LL:CC
    |
 LL |             *pointer.load(Ordering::Acquire) = 3;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/write_write_race_stack.rs:LL:CC
+   = note: inside closure at tests/fail/data_race/write_write_race_stack.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/deny_lint.stderr b/src/tools/miri/tests/fail/deny_lint.stderr
index d1c9b481807..fe96edf9346 100644
--- a/src/tools/miri/tests/fail/deny_lint.stderr
+++ b/src/tools/miri/tests/fail/deny_lint.stderr
@@ -1,11 +1,11 @@
 error: struct `Foo` is never constructed
-  --> $DIR/deny_lint.rs:LL:CC
+  --> tests/fail/deny_lint.rs:LL:CC
    |
 LL | struct Foo;
    |        ^^^
    |
 note: the lint level is defined here
-  --> $DIR/deny_lint.rs:LL:CC
+  --> tests/fail/deny_lint.rs:LL:CC
    |
 LL | #![deny(warnings, unused)]
    |                   ^^^^^^
diff --git a/src/tools/miri/tests/fail/dyn-call-trait-mismatch.stderr b/src/tools/miri/tests/fail/dyn-call-trait-mismatch.stderr
index 019a55bcdcb..3680a84fac2 100644
--- a/src/tools/miri/tests/fail/dyn-call-trait-mismatch.stderr
+++ b/src/tools/miri/tests/fail/dyn-call-trait-mismatch.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: using vtable for trait `T1` but trait `T2` was expected
-  --> $DIR/dyn-call-trait-mismatch.rs:LL:CC
+  --> tests/fail/dyn-call-trait-mismatch.rs:LL:CC
    |
 LL |     r2.method2();
    |     ^^^^^^^^^^^^ using vtable for trait `T1` but trait `T2` was expected
@@ -7,7 +7,7 @@ LL |     r2.method2();
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/dyn-call-trait-mismatch.rs:LL:CC
+   = note: inside `main` at tests/fail/dyn-call-trait-mismatch.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/dyn-upcast-nop-wrong-trait.stderr b/src/tools/miri/tests/fail/dyn-upcast-nop-wrong-trait.stderr
index 4165d5ea15d..54d9d385e96 100644
--- a/src/tools/miri/tests/fail/dyn-upcast-nop-wrong-trait.stderr
+++ b/src/tools/miri/tests/fail/dyn-upcast-nop-wrong-trait.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: wrong trait in wide pointer vtable: expected `std::fmt::Debug + std::marker::Send + std::marker::Sync`, but encountered `std::fmt::Display`
-  --> $DIR/dyn-upcast-nop-wrong-trait.rs:LL:CC
+  --> tests/fail/dyn-upcast-nop-wrong-trait.rs:LL:CC
    |
 LL |     let ptr: *const (dyn fmt::Debug + Send + Sync) = unsafe { std::mem::transmute(ptr) };
    |                                                               ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: wrong trait in wide pointer vtable: expected `std::fmt::Debug + std::marker::Send + std::marker::Sync`, but encountered `std::fmt::Display`
@@ -7,7 +7,7 @@ LL |     let ptr: *const (dyn fmt::Debug + Send + Sync) = unsafe { std::mem::tra
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/dyn-upcast-nop-wrong-trait.rs:LL:CC
+   = note: inside `main` at tests/fail/dyn-upcast-nop-wrong-trait.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/dyn-upcast-trait-mismatch.stderr b/src/tools/miri/tests/fail/dyn-upcast-trait-mismatch.stderr
index 87b1361c3e5..2129fe66e9c 100644
--- a/src/tools/miri/tests/fail/dyn-upcast-trait-mismatch.stderr
+++ b/src/tools/miri/tests/fail/dyn-upcast-trait-mismatch.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: using vtable for trait `Baz` but trait `Bar` was expected
-  --> $DIR/dyn-upcast-trait-mismatch.rs:LL:CC
+  --> tests/fail/dyn-upcast-trait-mismatch.rs:LL:CC
    |
 LL |         let _err = baz_fake as *const dyn Foo;
    |                    ^^^^^^^^ using vtable for trait `Baz` but trait `Bar` was expected
@@ -7,7 +7,7 @@ LL |         let _err = baz_fake as *const dyn Foo;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/dyn-upcast-trait-mismatch.rs:LL:CC
+   = note: inside `main` at tests/fail/dyn-upcast-trait-mismatch.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/enum-set-discriminant-niche-variant-wrong.stderr b/src/tools/miri/tests/fail/enum-set-discriminant-niche-variant-wrong.stderr
index a48a0a993da..4e2b9c03eae 100644
--- a/src/tools/miri/tests/fail/enum-set-discriminant-niche-variant-wrong.stderr
+++ b/src/tools/miri/tests/fail/enum-set-discriminant-niche-variant-wrong.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to set discriminant of a Option<std::num::NonZero<i32>> to the niched variant, but the value does not match
-  --> $DIR/enum-set-discriminant-niche-variant-wrong.rs:LL:CC
+  --> tests/fail/enum-set-discriminant-niche-variant-wrong.rs:LL:CC
    |
 LL |             SetDiscriminant(*ptr, 1);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^ trying to set discriminant of a Option<std::num::NonZero<i32>> to the niched variant, but the value does not match
@@ -7,9 +7,9 @@ LL |             SetDiscriminant(*ptr, 1);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `set_discriminant` at $DIR/enum-set-discriminant-niche-variant-wrong.rs:LL:CC
+   = note: inside `set_discriminant` at tests/fail/enum-set-discriminant-niche-variant-wrong.rs:LL:CC
 note: inside `main`
-  --> $DIR/enum-set-discriminant-niche-variant-wrong.rs:LL:CC
+  --> tests/fail/enum-set-discriminant-niche-variant-wrong.rs:LL:CC
    |
 LL |     set_discriminant(&mut v);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/environ-gets-deallocated.rs b/src/tools/miri/tests/fail/environ-gets-deallocated.rs
index 5391a9176d0..84618abc6db 100644
--- a/src/tools/miri/tests/fail/environ-gets-deallocated.rs
+++ b/src/tools/miri/tests/fail/environ-gets-deallocated.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: Windows does not have a global environ list that the program can access directly
+//@ignore-target: windows # Windows does not have a global environ list that the program can access directly
 
 fn get_environ() -> *const *const u8 {
     extern "C" {
diff --git a/src/tools/miri/tests/fail/environ-gets-deallocated.stderr b/src/tools/miri/tests/fail/environ-gets-deallocated.stderr
index c9bda00493e..bb3fe1cec73 100644
--- a/src/tools/miri/tests/fail/environ-gets-deallocated.stderr
+++ b/src/tools/miri/tests/fail/environ-gets-deallocated.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling
-  --> $DIR/environ-gets-deallocated.rs:LL:CC
+  --> tests/fail/environ-gets-deallocated.rs:LL:CC
    |
 LL |     let _y = unsafe { *pointer };
    |                       ^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling
@@ -7,7 +7,7 @@ LL |     let _y = unsafe { *pointer };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/environ-gets-deallocated.rs:LL:CC
+   = note: inside `main` at tests/fail/environ-gets-deallocated.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/erroneous_const.stderr b/src/tools/miri/tests/fail/erroneous_const.stderr
index ab036247a31..3528620cb6a 100644
--- a/src/tools/miri/tests/fail/erroneous_const.stderr
+++ b/src/tools/miri/tests/fail/erroneous_const.stderr
@@ -1,13 +1,13 @@
 error[E0080]: evaluation of `PrintName::<i32>::VOID` failed
-  --> $DIR/erroneous_const.rs:LL:CC
+  --> tests/fail/erroneous_const.rs:LL:CC
    |
 LL |     const VOID: ! = panic!();
-   |                     ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/erroneous_const.rs:LL:CC
+   |                     ^^^^^^^^ the evaluated program panicked at 'explicit panic', tests/fail/erroneous_const.rs:LL:CC
    |
    = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 note: erroneous constant encountered
-  --> $DIR/erroneous_const.rs:LL:CC
+  --> tests/fail/erroneous_const.rs:LL:CC
    |
 LL |         let _ = PrintName::<T>::VOID;
    |                 ^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/erroneous_const2.stderr b/src/tools/miri/tests/fail/erroneous_const2.stderr
index 22274367074..76f8cbcd289 100644
--- a/src/tools/miri/tests/fail/erroneous_const2.stderr
+++ b/src/tools/miri/tests/fail/erroneous_const2.stderr
@@ -1,17 +1,17 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/erroneous_const2.rs:LL:CC
+  --> tests/fail/erroneous_const2.rs:LL:CC
    |
 LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
    |                   ^^^^^ attempt to compute `5_u32 - 6_u32`, which would overflow
 
 note: erroneous constant encountered
-  --> $DIR/erroneous_const2.rs:LL:CC
+  --> tests/fail/erroneous_const2.rs:LL:CC
    |
 LL |     println!("{}", FOO);
    |                    ^^^
 
 note: erroneous constant encountered
-  --> $DIR/erroneous_const2.rs:LL:CC
+  --> tests/fail/erroneous_const2.rs:LL:CC
    |
 LL |     println!("{}", FOO);
    |                    ^^^
@@ -19,7 +19,7 @@ LL |     println!("{}", FOO);
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 note: erroneous constant encountered
-  --> $DIR/erroneous_const2.rs:LL:CC
+  --> tests/fail/erroneous_const2.rs:LL:CC
    |
 LL |     println!("{}", FOO);
    |                    ^^^
diff --git a/src/tools/miri/tests/fail/extern-type-field-offset.stderr b/src/tools/miri/tests/fail/extern-type-field-offset.stderr
index c07b63e0c03..1ed440c7a33 100644
--- a/src/tools/miri/tests/fail/extern-type-field-offset.stderr
+++ b/src/tools/miri/tests/fail/extern-type-field-offset.stderr
@@ -1,5 +1,5 @@
 warning: reborrow of reference to `extern type`
-  --> $DIR/extern-type-field-offset.rs:LL:CC
+  --> tests/fail/extern-type-field-offset.rs:LL:CC
    |
 LL |     let x: &Newtype = unsafe { &*(&buf as *const _ as *const Newtype) };
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reborrow of a reference to `extern type` is not properly supported
@@ -7,17 +7,17 @@ LL |     let x: &Newtype = unsafe { &*(&buf as *const _ as *const Newtype) };
    = help: `extern type` are not compatible with the Stacked Borrows aliasing model implemented by Miri; Miri may miss bugs in this code
    = help: try running with `MIRIFLAGS=-Zmiri-tree-borrows` to use the more permissive but also even more experimental Tree Borrows aliasing checks instead
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/extern-type-field-offset.rs:LL:CC
+   = note: inside `main` at tests/fail/extern-type-field-offset.rs:LL:CC
 
 error: unsupported operation: `extern type` field does not have a known offset
-  --> $DIR/extern-type-field-offset.rs:LL:CC
+  --> tests/fail/extern-type-field-offset.rs:LL:CC
    |
 LL |     let _field = &x.a;
    |                  ^^^^ `extern type` field does not have a known offset
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/extern-type-field-offset.rs:LL:CC
+   = note: inside `main` at tests/fail/extern-type-field-offset.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/extern_static.stderr b/src/tools/miri/tests/fail/extern_static.stderr
index c7ab128e2fe..c0bedbbcbf9 100644
--- a/src/tools/miri/tests/fail/extern_static.stderr
+++ b/src/tools/miri/tests/fail/extern_static.stderr
@@ -1,12 +1,12 @@
 error: unsupported operation: extern static `FOO` is not supported by Miri
-  --> $DIR/extern_static.rs:LL:CC
+  --> tests/fail/extern_static.rs:LL:CC
    |
 LL |     let _val = std::ptr::addr_of!(FOO);
    |                                   ^^^ extern static `FOO` is not supported by Miri
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/extern_static.rs:LL:CC
+   = note: inside `main` at tests/fail/extern_static.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/extern_static_in_const.stderr b/src/tools/miri/tests/fail/extern_static_in_const.stderr
index aa524c06469..067a2a2b643 100644
--- a/src/tools/miri/tests/fail/extern_static_in_const.stderr
+++ b/src/tools/miri/tests/fail/extern_static_in_const.stderr
@@ -1,12 +1,12 @@
 error: unsupported operation: extern static `E` is not supported by Miri
-  --> $DIR/extern_static_in_const.rs:LL:CC
+  --> tests/fail/extern_static_in_const.rs:LL:CC
    |
 LL |     let _val = X;
    |                ^ extern static `E` is not supported by Miri
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/extern_static_in_const.rs:LL:CC
+   = note: inside `main` at tests/fail/extern_static_in_const.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/extern_static_wrong_size.rs b/src/tools/miri/tests/fail/extern_static_wrong_size.rs
index fee3c38c25e..56c3ddd3516 100644
--- a/src/tools/miri/tests/fail/extern_static_wrong_size.rs
+++ b/src/tools/miri/tests/fail/extern_static_wrong_size.rs
@@ -1,4 +1,4 @@
-//@ only-target-linux: we need a specific extern supported on this target
+//@only-target: linux # we need a specific extern supported on this target
 //@normalize-stderr-test: "[48] bytes" -> "N bytes"
 
 extern "C" {
diff --git a/src/tools/miri/tests/fail/extern_static_wrong_size.stderr b/src/tools/miri/tests/fail/extern_static_wrong_size.stderr
index 3c013a5d15d..1af84e23682 100644
--- a/src/tools/miri/tests/fail/extern_static_wrong_size.stderr
+++ b/src/tools/miri/tests/fail/extern_static_wrong_size.stderr
@@ -1,12 +1,12 @@
 error: unsupported operation: extern static `environ` has been declared as `extern_static_wrong_size::environ` with a size of 1 bytes and alignment of 1 bytes, but Miri emulates it via an extern static shim with a size of N bytes and alignment of N bytes
-  --> $DIR/extern_static_wrong_size.rs:LL:CC
+  --> tests/fail/extern_static_wrong_size.rs:LL:CC
    |
 LL |     let _val = unsafe { environ };
    |                         ^^^^^^^ extern static `environ` has been declared as `extern_static_wrong_size::environ` with a size of 1 bytes and alignment of 1 bytes, but Miri emulates it via an extern static shim with a size of N bytes and alignment of N bytes
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/extern_static_wrong_size.rs:LL:CC
+   = note: inside `main` at tests/fail/extern_static_wrong_size.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.stack.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.stack.stderr
index 609426bb289..d9ab782986f 100644
--- a/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.stack.stderr
+++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: not granting access to tag <TAG> because that would remove [Unique for <TAG>] which is strongly protected
-  --> $DIR/arg_inplace_mutate.rs:LL:CC
+  --> tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC
    |
 LL |     unsafe { ptr.write(S(0)) };
    |              ^^^^^^^^^^^^^^^ not granting access to tag <TAG> because that would remove [Unique for <TAG>] which is strongly protected
@@ -7,7 +7,7 @@ LL |     unsafe { ptr.write(S(0)) };
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x4]
-  --> $DIR/arg_inplace_mutate.rs:LL:CC
+  --> tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC
    |
 LL | /     mir! {
 LL | |         let _unit: ();
@@ -18,14 +18,14 @@ LL | |         }
 LL | |     }
    | |_____^
 help: <TAG> is this argument
-  --> $DIR/arg_inplace_mutate.rs:LL:CC
+  --> tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC
    |
 LL |     unsafe { ptr.write(S(0)) };
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `callee` at $DIR/arg_inplace_mutate.rs:LL:CC
+   = note: inside `callee` at tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC
 note: inside `main`
-  --> $DIR/arg_inplace_mutate.rs:LL:CC
+  --> tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC
    |
 LL |             Call(_unit = callee(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.tree.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.tree.stderr
index c187d24e5e8..677952b39da 100644
--- a/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.tree.stderr
+++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_mutate.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> (root of the allocation) at ALLOC[0x0] is forbidden
-  --> $DIR/arg_inplace_mutate.rs:LL:CC
+  --> tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC
    |
 LL |     unsafe { ptr.write(S(0)) };
    |              ^^^^^^^^^^^^^^^ write access through <TAG> (root of the allocation) at ALLOC[0x0] is forbidden
@@ -9,7 +9,7 @@ LL |     unsafe { ptr.write(S(0)) };
    = help: this foreign write access would cause the protected tag <TAG> (currently Active) to become Disabled
    = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
-  --> $DIR/arg_inplace_mutate.rs:LL:CC
+  --> tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC
    |
 LL | /     mir! {
 LL | |         let _unit: ();
@@ -20,20 +20,20 @@ LL | |         }
 LL | |     }
    | |_____^
 help: the protected tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/arg_inplace_mutate.rs:LL:CC
+  --> tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC
    |
 LL |     unsafe { ptr.write(S(0)) };
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: the protected tag <TAG> later transitioned to Active due to a child write access at offsets [0x0..0x4]
-  --> $DIR/arg_inplace_mutate.rs:LL:CC
+  --> tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC
    |
 LL |     unsafe { ptr.write(S(0)) };
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference
    = note: BACKTRACE (of the first span):
-   = note: inside `callee` at $DIR/arg_inplace_mutate.rs:LL:CC
+   = note: inside `callee` at tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC
 note: inside `main`
-  --> $DIR/arg_inplace_mutate.rs:LL:CC
+  --> tests/fail/function_calls/arg_inplace_mutate.rs:LL:CC
    |
 LL |             Call(_unit = callee(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_after.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_after.stderr
index 2cd9966bbf5..7fd71c60847 100644
--- a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_after.stderr
+++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_after.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
-  --> $DIR/arg_inplace_observe_after.rs:LL:CC
+  --> tests/fail/function_calls/arg_inplace_observe_after.rs:LL:CC
    |
 LL |             _observe = non_copy.0;
    |             ^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
@@ -7,7 +7,7 @@ LL |             _observe = non_copy.0;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/arg_inplace_observe_after.rs:LL:CC
+   = note: inside `main` at tests/fail/function_calls/arg_inplace_observe_after.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.none.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.none.stderr
index 1c73577f5cd..032bbfa8f18 100644
--- a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.none.stderr
+++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.none.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
-  --> $DIR/arg_inplace_observe_during.rs:LL:CC
+  --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC
    |
 LL |     unsafe { ptr.read() };
    |              ^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
@@ -7,9 +7,9 @@ LL |     unsafe { ptr.read() };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `change_arg` at $DIR/arg_inplace_observe_during.rs:LL:CC
+   = note: inside `change_arg` at tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC
 note: inside `main`
-  --> $DIR/arg_inplace_observe_during.rs:LL:CC
+  --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC
    |
 LL |             Call(_unit = change_arg(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.stack.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.stack.stderr
index 68b7c0307c8..efdd6129d74 100644
--- a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.stack.stderr
+++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: not granting access to tag <TAG> because that would remove [Unique for <TAG>] which is strongly protected
-  --> $DIR/arg_inplace_observe_during.rs:LL:CC
+  --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC
    |
 LL |     unsafe { ptr.read() };
    |              ^^^^^^^^^^ not granting access to tag <TAG> because that would remove [Unique for <TAG>] which is strongly protected
@@ -7,7 +7,7 @@ LL |     unsafe { ptr.read() };
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x4]
-  --> $DIR/arg_inplace_observe_during.rs:LL:CC
+  --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC
    |
 LL | /     mir! {
 LL | |         let _unit: ();
@@ -18,14 +18,14 @@ LL | |
 LL | |     }
    | |_____^
 help: <TAG> is this argument
-  --> $DIR/arg_inplace_observe_during.rs:LL:CC
+  --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC
    |
 LL |     x.0 = 0;
    |     ^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `change_arg` at $DIR/arg_inplace_observe_during.rs:LL:CC
+   = note: inside `change_arg` at tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC
 note: inside `main`
-  --> $DIR/arg_inplace_observe_during.rs:LL:CC
+  --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC
    |
 LL |             Call(_unit = change_arg(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr
index 64888cce613..5746ad1e13d 100644
--- a/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr
+++ b/src/tools/miri/tests/fail/function_calls/arg_inplace_observe_during.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: read access through <TAG> (root of the allocation) at ALLOC[0x0] is forbidden
-  --> $DIR/arg_inplace_observe_during.rs:LL:CC
+  --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC
    |
 LL |     unsafe { ptr.read() };
    |              ^^^^^^^^^^ read access through <TAG> (root of the allocation) at ALLOC[0x0] is forbidden
@@ -9,7 +9,7 @@ LL |     unsafe { ptr.read() };
    = help: this foreign read access would cause the protected tag <TAG> (currently Active) to become Disabled
    = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
-  --> $DIR/arg_inplace_observe_during.rs:LL:CC
+  --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC
    |
 LL | /     mir! {
 LL | |         let _unit: ();
@@ -20,20 +20,20 @@ LL | |
 LL | |     }
    | |_____^
 help: the protected tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/arg_inplace_observe_during.rs:LL:CC
+  --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC
    |
 LL |     x.0 = 0;
    |     ^^^^^^^
 help: the protected tag <TAG> later transitioned to Active due to a child write access at offsets [0x0..0x4]
-  --> $DIR/arg_inplace_observe_during.rs:LL:CC
+  --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC
    |
 LL |     x.0 = 0;
    |     ^^^^^^^
    = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference
    = note: BACKTRACE (of the first span):
-   = note: inside `change_arg` at $DIR/arg_inplace_observe_during.rs:LL:CC
+   = note: inside `change_arg` at tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC
 note: inside `main`
-  --> $DIR/arg_inplace_observe_during.rs:LL:CC
+  --> tests/fail/function_calls/arg_inplace_observe_during.rs:LL:CC
    |
 LL |             Call(_unit = change_arg(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/function_calls/check_arg_abi.stderr b/src/tools/miri/tests/fail/function_calls/check_arg_abi.stderr
index 2f24425ed1d..bf1fbb7721f 100644
--- a/src/tools/miri/tests/fail/function_calls/check_arg_abi.stderr
+++ b/src/tools/miri/tests/fail/function_calls/check_arg_abi.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: calling a function with ABI C using caller ABI Rust
-  --> $DIR/check_arg_abi.rs:LL:CC
+  --> tests/fail/function_calls/check_arg_abi.rs:LL:CC
    |
 LL |         let _ = malloc(0);
    |                 ^^^^^^^^^ calling a function with ABI C using caller ABI Rust
@@ -7,7 +7,7 @@ LL |         let _ = malloc(0);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/check_arg_abi.rs:LL:CC
+   = note: inside `main` at tests/fail/function_calls/check_arg_abi.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_calls/check_arg_count_abort.stderr b/src/tools/miri/tests/fail/function_calls/check_arg_count_abort.stderr
index d475801f41c..687d0538b3c 100644
--- a/src/tools/miri/tests/fail/function_calls/check_arg_count_abort.stderr
+++ b/src/tools/miri/tests/fail/function_calls/check_arg_count_abort.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: incorrect number of arguments: got 1, expected 0
-  --> $DIR/check_arg_count_abort.rs:LL:CC
+  --> tests/fail/function_calls/check_arg_count_abort.rs:LL:CC
    |
 LL |         abort(1);
    |         ^^^^^^^^ incorrect number of arguments: got 1, expected 0
@@ -7,7 +7,7 @@ LL |         abort(1);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/check_arg_count_abort.rs:LL:CC
+   = note: inside `main` at tests/fail/function_calls/check_arg_count_abort.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_calls/check_arg_count_too_few_args.stderr b/src/tools/miri/tests/fail/function_calls/check_arg_count_too_few_args.stderr
index ad952804ecc..d778eae64fa 100644
--- a/src/tools/miri/tests/fail/function_calls/check_arg_count_too_few_args.stderr
+++ b/src/tools/miri/tests/fail/function_calls/check_arg_count_too_few_args.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: incorrect number of arguments: got 0, expected 1
-  --> $DIR/check_arg_count_too_few_args.rs:LL:CC
+  --> tests/fail/function_calls/check_arg_count_too_few_args.rs:LL:CC
    |
 LL |         let _ = malloc();
    |                 ^^^^^^^^ incorrect number of arguments: got 0, expected 1
@@ -7,7 +7,7 @@ LL |         let _ = malloc();
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/check_arg_count_too_few_args.rs:LL:CC
+   = note: inside `main` at tests/fail/function_calls/check_arg_count_too_few_args.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_calls/check_arg_count_too_many_args.stderr b/src/tools/miri/tests/fail/function_calls/check_arg_count_too_many_args.stderr
index 3b1df8a9d42..dfec2a86287 100644
--- a/src/tools/miri/tests/fail/function_calls/check_arg_count_too_many_args.stderr
+++ b/src/tools/miri/tests/fail/function_calls/check_arg_count_too_many_args.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: incorrect number of arguments: got 2, expected 1
-  --> $DIR/check_arg_count_too_many_args.rs:LL:CC
+  --> tests/fail/function_calls/check_arg_count_too_many_args.rs:LL:CC
    |
 LL |         let _ = malloc(1, 2);
    |                 ^^^^^^^^^^^^ incorrect number of arguments: got 2, expected 1
@@ -7,7 +7,7 @@ LL |         let _ = malloc(1, 2);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/check_arg_count_too_many_args.rs:LL:CC
+   = note: inside `main` at tests/fail/function_calls/check_arg_count_too_many_args.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_calls/check_callback_abi.stderr b/src/tools/miri/tests/fail/function_calls/check_callback_abi.stderr
index 890fed09e48..6b0692e1c6e 100644
--- a/src/tools/miri/tests/fail/function_calls/check_callback_abi.stderr
+++ b/src/tools/miri/tests/fail/function_calls/check_callback_abi.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: calling a function with calling convention C using calling convention Rust
-  --> $DIR/check_callback_abi.rs:LL:CC
+  --> tests/fail/function_calls/check_callback_abi.rs:LL:CC
    |
 LL | /         std::intrinsics::catch_unwind(
 LL | |
@@ -12,7 +12,7 @@ LL | |         );
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/check_callback_abi.rs:LL:CC
+   = note: inside `main` at tests/fail/function_calls/check_callback_abi.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.cache.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.cache.stderr
index 2feba7d8e34..e4302ad1d3a 100644
--- a/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.cache.stderr
+++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.cache.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: calling a function with calling convention Rust using calling convention C
-  --> $DIR/exported_symbol_abi_mismatch.rs:LL:CC
+  --> tests/fail/function_calls/exported_symbol_abi_mismatch.rs:LL:CC
    |
 LL |             foo();
    |             ^^^^^ calling a function with calling convention Rust using calling convention C
@@ -7,7 +7,7 @@ LL |             foo();
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/exported_symbol_abi_mismatch.rs:LL:CC
+   = note: inside `main` at tests/fail/function_calls/exported_symbol_abi_mismatch.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.fn_ptr.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.fn_ptr.stderr
index 0537508babd..9f40c48b338 100644
--- a/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.fn_ptr.stderr
+++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.fn_ptr.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: calling a function with calling convention Rust using calling convention C
-  --> $DIR/exported_symbol_abi_mismatch.rs:LL:CC
+  --> tests/fail/function_calls/exported_symbol_abi_mismatch.rs:LL:CC
    |
 LL |         std::mem::transmute::<unsafe fn(), unsafe extern "C" fn()>(foo)();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling a function with calling convention Rust using calling convention C
@@ -7,7 +7,7 @@ LL |         std::mem::transmute::<unsafe fn(), unsafe extern "C" fn()>(foo)();
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/exported_symbol_abi_mismatch.rs:LL:CC
+   = note: inside `main` at tests/fail/function_calls/exported_symbol_abi_mismatch.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.no_cache.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.no_cache.stderr
index 2feba7d8e34..e4302ad1d3a 100644
--- a/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.no_cache.stderr
+++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_abi_mismatch.no_cache.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: calling a function with calling convention Rust using calling convention C
-  --> $DIR/exported_symbol_abi_mismatch.rs:LL:CC
+  --> tests/fail/function_calls/exported_symbol_abi_mismatch.rs:LL:CC
    |
 LL |             foo();
    |             ^^^^^ calling a function with calling convention Rust using calling convention C
@@ -7,7 +7,7 @@ LL |             foo();
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/exported_symbol_abi_mismatch.rs:LL:CC
+   = note: inside `main` at tests/fail/function_calls/exported_symbol_abi_mismatch.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr
index a11a2b95689..5f306cc8ab1 100644
--- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr
+++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr
@@ -1,9 +1,9 @@
-thread 'main' panicked at $DIR/exported_symbol_bad_unwind1.rs:LL:CC:
+thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind1.rs:LL:CC:
 explicit panic
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 error: Undefined Behavior: unwinding past a stack frame that does not allow unwinding
-  --> $DIR/exported_symbol_bad_unwind1.rs:LL:CC
+  --> tests/fail/function_calls/exported_symbol_bad_unwind1.rs:LL:CC
    |
 LL |     unsafe { unwind() }
    |              ^^^^^^^^ unwinding past a stack frame that does not allow unwinding
@@ -11,7 +11,7 @@ LL |     unsafe { unwind() }
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/exported_symbol_bad_unwind1.rs:LL:CC
+   = note: inside `main` at tests/fail/function_calls/exported_symbol_bad_unwind1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr
index 12425cc4892..aef45042e8b 100644
--- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr
+++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at $DIR/exported_symbol_bad_unwind2.rs:LL:CC:
+thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
 explicit panic
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
@@ -21,14 +21,14 @@ LL |     ABORT();
    = note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC
    = note: inside `core::panicking::panic_cannot_unwind` at RUSTLIB/core/src/panicking.rs:LL:CC
 note: inside `nounwind`
-  --> $DIR/exported_symbol_bad_unwind2.rs:LL:CC
+  --> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC
    |
 LL | / extern "C-unwind" fn nounwind() {
 LL | |     panic!();
 LL | | }
    | |_^
 note: inside `main`
-  --> $DIR/exported_symbol_bad_unwind2.rs:LL:CC
+  --> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC
    |
 LL |     unsafe { nounwind() }
    | ^
diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr
index 12425cc4892..aef45042e8b 100644
--- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr
+++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at $DIR/exported_symbol_bad_unwind2.rs:LL:CC:
+thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
 explicit panic
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
@@ -21,14 +21,14 @@ LL |     ABORT();
    = note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC
    = note: inside `core::panicking::panic_cannot_unwind` at RUSTLIB/core/src/panicking.rs:LL:CC
 note: inside `nounwind`
-  --> $DIR/exported_symbol_bad_unwind2.rs:LL:CC
+  --> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC
    |
 LL | / extern "C-unwind" fn nounwind() {
 LL | |     panic!();
 LL | | }
    | |_^
 note: inside `main`
-  --> $DIR/exported_symbol_bad_unwind2.rs:LL:CC
+  --> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC
    |
 LL |     unsafe { nounwind() }
    | ^
diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr
index f9e299bf5d2..a81e8226e5a 100644
--- a/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr
+++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr
@@ -1,9 +1,9 @@
-thread 'main' panicked at $DIR/exported_symbol_bad_unwind2.rs:LL:CC:
+thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
 explicit panic
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 error: Undefined Behavior: unwinding past a stack frame that does not allow unwinding
-  --> $DIR/exported_symbol_bad_unwind2.rs:LL:CC
+  --> tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC
    |
 LL |     unsafe { nounwind() }
    | ^ unwinding past a stack frame that does not allow unwinding
@@ -11,7 +11,7 @@ LL |     unsafe { nounwind() }
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/exported_symbol_bad_unwind2.rs:LL:CC
+   = note: inside `main` at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_clashing.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_clashing.stderr
index 2f561ed88e3..e9e580ffc86 100644
--- a/src/tools/miri/tests/fail/function_calls/exported_symbol_clashing.stderr
+++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_clashing.stderr
@@ -1,21 +1,21 @@
 error: multiple definitions of symbol `foo`
-  --> $DIR/exported_symbol_clashing.rs:LL:CC
+  --> tests/fail/function_calls/exported_symbol_clashing.rs:LL:CC
    |
 LL |     unsafe { foo() }
    |              ^^^^^ multiple definitions of symbol `foo`
    |
 help: it's first defined here, in crate `exported_symbol_clashing`
-  --> $DIR/exported_symbol_clashing.rs:LL:CC
+  --> tests/fail/function_calls/exported_symbol_clashing.rs:LL:CC
    |
 LL | fn foo() {}
    | ^^^^^^^^
 help: then it's defined here again, in crate `exported_symbol_clashing`
-  --> $DIR/exported_symbol_clashing.rs:LL:CC
+  --> tests/fail/function_calls/exported_symbol_clashing.rs:LL:CC
    |
 LL | fn bar() {}
    | ^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/exported_symbol_clashing.rs:LL:CC
+   = note: inside `main` at tests/fail/function_calls/exported_symbol_clashing.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_shim_clashing.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_shim_clashing.stderr
index d51156b3c33..fb9cc47c7a8 100644
--- a/src/tools/miri/tests/fail/function_calls/exported_symbol_shim_clashing.stderr
+++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_shim_clashing.stderr
@@ -1,11 +1,11 @@
 error: found `malloc` symbol definition that clashes with a built-in shim
-  --> $DIR/exported_symbol_shim_clashing.rs:LL:CC
+  --> tests/fail/function_calls/exported_symbol_shim_clashing.rs:LL:CC
    |
 LL |         malloc(0);
    |         ^^^^^^^^^ found `malloc` symbol definition that clashes with a built-in shim
    |
 help: the `malloc` symbol is defined here
-  --> $DIR/exported_symbol_shim_clashing.rs:LL:CC
+  --> tests/fail/function_calls/exported_symbol_shim_clashing.rs:LL:CC
    |
 LL | / extern "C" fn malloc(_: usize) -> *mut std::ffi::c_void {
 LL | |
@@ -13,7 +13,7 @@ LL | |     unreachable!()
 LL | | }
    | |_^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/exported_symbol_shim_clashing.rs:LL:CC
+   = note: inside `main` at tests/fail/function_calls/exported_symbol_shim_clashing.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_wrong_arguments.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_wrong_arguments.stderr
index 69b710b3d3b..1ff9aa36f1e 100644
--- a/src/tools/miri/tests/fail/function_calls/exported_symbol_wrong_arguments.stderr
+++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_wrong_arguments.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: calling a function with more arguments than it expected
-  --> $DIR/exported_symbol_wrong_arguments.rs:LL:CC
+  --> tests/fail/function_calls/exported_symbol_wrong_arguments.rs:LL:CC
    |
 LL |     unsafe { foo(1) }
    |              ^^^^^^ calling a function with more arguments than it expected
@@ -7,7 +7,7 @@ LL |     unsafe { foo(1) }
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/exported_symbol_wrong_arguments.rs:LL:CC
+   = note: inside `main` at tests/fail/function_calls/exported_symbol_wrong_arguments.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_calls/exported_symbol_wrong_type.stderr b/src/tools/miri/tests/fail/function_calls/exported_symbol_wrong_type.stderr
index 96b483059b0..29c87e8c437 100644
--- a/src/tools/miri/tests/fail/function_calls/exported_symbol_wrong_type.stderr
+++ b/src/tools/miri/tests/fail/function_calls/exported_symbol_wrong_type.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempt to call an exported symbol that is not defined as a function
-  --> $DIR/exported_symbol_wrong_type.rs:LL:CC
+  --> tests/fail/function_calls/exported_symbol_wrong_type.rs:LL:CC
    |
 LL |     unsafe { FOO() }
    |              ^^^^^ attempt to call an exported symbol that is not defined as a function
@@ -7,7 +7,7 @@ LL |     unsafe { FOO() }
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/exported_symbol_wrong_type.rs:LL:CC
+   = note: inside `main` at tests/fail/function_calls/exported_symbol_wrong_type.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.none.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.none.stderr
index e8b766d0b0e..9da2c3589da 100644
--- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.none.stderr
+++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.none.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
-  --> $DIR/return_pointer_aliasing_read.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC
    |
 LL |     unsafe { ptr.read() };
    |              ^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
@@ -7,9 +7,9 @@ LL |     unsafe { ptr.read() };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `myfun` at $DIR/return_pointer_aliasing_read.rs:LL:CC
+   = note: inside `myfun` at tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC
 note: inside `main`
-  --> $DIR/return_pointer_aliasing_read.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC
    |
 LL |             Call(*ptr = myfun(ptr), ReturnTo(after_call), UnwindContinue())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.stack.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.stack.stderr
index 941470e9295..b009b0901c4 100644
--- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.stack.stderr
+++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: not granting access to tag <TAG> because that would remove [Unique for <TAG>] which is strongly protected
-  --> $DIR/return_pointer_aliasing_read.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC
    |
 LL |     unsafe { ptr.read() };
    |              ^^^^^^^^^^ not granting access to tag <TAG> because that would remove [Unique for <TAG>] which is strongly protected
@@ -7,7 +7,7 @@ LL |     unsafe { ptr.read() };
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x4]
-  --> $DIR/return_pointer_aliasing_read.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC
    |
 LL | /     mir! {
 LL | |         {
@@ -18,14 +18,14 @@ LL | |         }
 LL | |     }
    | |_____^
 help: <TAG> is this argument
-  --> $DIR/return_pointer_aliasing_read.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC
    |
 LL |     unsafe { ptr.read() };
    |     ^^^^^^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `myfun` at $DIR/return_pointer_aliasing_read.rs:LL:CC
+   = note: inside `myfun` at tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC
 note: inside `main`
-  --> $DIR/return_pointer_aliasing_read.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC
    |
 LL |             Call(*ptr = myfun(ptr), ReturnTo(after_call), UnwindContinue())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.tree.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.tree.stderr
index 715ee330619..6d2cbe9b7cd 100644
--- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.tree.stderr
+++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_read.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: read access through <TAG> (root of the allocation) at ALLOC[0x0] is forbidden
-  --> $DIR/return_pointer_aliasing_read.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC
    |
 LL |     unsafe { ptr.read() };
    |              ^^^^^^^^^^ read access through <TAG> (root of the allocation) at ALLOC[0x0] is forbidden
@@ -9,7 +9,7 @@ LL |     unsafe { ptr.read() };
    = help: this foreign read access would cause the protected tag <TAG> (currently Active) to become Disabled
    = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
-  --> $DIR/return_pointer_aliasing_read.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC
    |
 LL | /     mir! {
 LL | |         {
@@ -20,20 +20,20 @@ LL | |         }
 LL | |     }
    | |_____^
 help: the protected tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/return_pointer_aliasing_read.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC
    |
 LL |     unsafe { ptr.read() };
    |     ^^^^^^^^^^^^^^^^^^^^^
 help: the protected tag <TAG> later transitioned to Active due to a child write access at offsets [0x0..0x4]
-  --> $DIR/return_pointer_aliasing_read.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC
    |
 LL |     unsafe { ptr.read() };
    |     ^^^^^^^^^^^^^^^^^^^^^
    = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference
    = note: BACKTRACE (of the first span):
-   = note: inside `myfun` at $DIR/return_pointer_aliasing_read.rs:LL:CC
+   = note: inside `myfun` at tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC
 note: inside `main`
-  --> $DIR/return_pointer_aliasing_read.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_read.rs:LL:CC
    |
 LL |             Call(*ptr = myfun(ptr), ReturnTo(after_call), UnwindContinue())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.stack.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.stack.stderr
index 51cb270dd2e..54f9a7aebd6 100644
--- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.stack.stderr
+++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: not granting access to tag <TAG> because that would remove [Unique for <TAG>] which is strongly protected
-  --> $DIR/return_pointer_aliasing_write.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC
    |
 LL |     unsafe { ptr.write(0) };
    |              ^^^^^^^^^^^^ not granting access to tag <TAG> because that would remove [Unique for <TAG>] which is strongly protected
@@ -7,7 +7,7 @@ LL |     unsafe { ptr.write(0) };
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x4]
-  --> $DIR/return_pointer_aliasing_write.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC
    |
 LL | /     mir! {
 LL | |         {
@@ -18,14 +18,14 @@ LL | |         }
 LL | |     }
    | |_____^
 help: <TAG> is this argument
-  --> $DIR/return_pointer_aliasing_write.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC
    |
 LL |     unsafe { ptr.write(0) };
    |     ^^^^^^^^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `myfun` at $DIR/return_pointer_aliasing_write.rs:LL:CC
+   = note: inside `myfun` at tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC
 note: inside `main`
-  --> $DIR/return_pointer_aliasing_write.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC
    |
 LL |             Call(*ptr = myfun(ptr), ReturnTo(after_call), UnwindContinue())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.tree.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.tree.stderr
index 66ca1027edc..693534be2e0 100644
--- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.tree.stderr
+++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> (root of the allocation) at ALLOC[0x0] is forbidden
-  --> $DIR/return_pointer_aliasing_write.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC
    |
 LL |     unsafe { ptr.write(0) };
    |              ^^^^^^^^^^^^ write access through <TAG> (root of the allocation) at ALLOC[0x0] is forbidden
@@ -9,7 +9,7 @@ LL |     unsafe { ptr.write(0) };
    = help: this foreign write access would cause the protected tag <TAG> (currently Active) to become Disabled
    = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
-  --> $DIR/return_pointer_aliasing_write.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC
    |
 LL | /     mir! {
 LL | |         {
@@ -20,20 +20,20 @@ LL | |         }
 LL | |     }
    | |_____^
 help: the protected tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/return_pointer_aliasing_write.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC
    |
 LL |     unsafe { ptr.write(0) };
    |     ^^^^^^^^^^^^^^^^^^^^^^^
 help: the protected tag <TAG> later transitioned to Active due to a child write access at offsets [0x0..0x4]
-  --> $DIR/return_pointer_aliasing_write.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC
    |
 LL |     unsafe { ptr.write(0) };
    |     ^^^^^^^^^^^^^^^^^^^^^^^
    = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference
    = note: BACKTRACE (of the first span):
-   = note: inside `myfun` at $DIR/return_pointer_aliasing_write.rs:LL:CC
+   = note: inside `myfun` at tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC
 note: inside `main`
-  --> $DIR/return_pointer_aliasing_write.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_write.rs:LL:CC
    |
 LL |             Call(*ptr = myfun(ptr), ReturnTo(after_call), UnwindContinue())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.stack.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.stack.stderr
index 7e527a440d1..520937beaeb 100644
--- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.stack.stderr
+++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.stack.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: not granting access to tag <TAG> because that would remove [Unique for <TAG>] which is strongly protected
-  --> $DIR/return_pointer_aliasing_write_tail_call.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC
    |
 LL |     unsafe { ptr.write(0) };
    |              ^^^^^^^^^^^^ not granting access to tag <TAG> because that would remove [Unique for <TAG>] which is strongly protected
@@ -7,7 +7,7 @@ LL |     unsafe { ptr.write(0) };
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x4]
-  --> $DIR/return_pointer_aliasing_write_tail_call.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC
    |
 LL | /     mir! {
 LL | |         {
@@ -18,14 +18,14 @@ LL | |         }
 LL | |     }
    | |_____^
 help: <TAG> is this argument
-  --> $DIR/return_pointer_aliasing_write_tail_call.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC
    |
 LL |     unsafe { ptr.write(0) };
    |     ^^^^^^^^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `myfun2` at $DIR/return_pointer_aliasing_write_tail_call.rs:LL:CC
+   = note: inside `myfun2` at tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC
 note: inside `main`
-  --> $DIR/return_pointer_aliasing_write_tail_call.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC
    |
 LL |             Call(*ptr = myfun(ptr), ReturnTo(after_call), UnwindContinue())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.tree.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.tree.stderr
index b1f2cab031e..a879189d0c1 100644
--- a/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.tree.stderr
+++ b/src/tools/miri/tests/fail/function_calls/return_pointer_aliasing_write_tail_call.tree.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> (root of the allocation) at ALLOC[0x0] is forbidden
-  --> $DIR/return_pointer_aliasing_write_tail_call.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC
    |
 LL |     unsafe { ptr.write(0) };
    |              ^^^^^^^^^^^^ write access through <TAG> (root of the allocation) at ALLOC[0x0] is forbidden
@@ -9,7 +9,7 @@ LL |     unsafe { ptr.write(0) };
    = help: this foreign write access would cause the protected tag <TAG> (currently Active) to become Disabled
    = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
-  --> $DIR/return_pointer_aliasing_write_tail_call.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC
    |
 LL | /     mir! {
 LL | |         {
@@ -20,20 +20,20 @@ LL | |         }
 LL | |     }
    | |_____^
 help: the protected tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/return_pointer_aliasing_write_tail_call.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC
    |
 LL |     unsafe { ptr.write(0) };
    |     ^^^^^^^^^^^^^^^^^^^^^^^
 help: the protected tag <TAG> later transitioned to Active due to a child write access at offsets [0x0..0x4]
-  --> $DIR/return_pointer_aliasing_write_tail_call.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC
    |
 LL |     unsafe { ptr.write(0) };
    |     ^^^^^^^^^^^^^^^^^^^^^^^
    = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference
    = note: BACKTRACE (of the first span):
-   = note: inside `myfun2` at $DIR/return_pointer_aliasing_write_tail_call.rs:LL:CC
+   = note: inside `myfun2` at tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC
 note: inside `main`
-  --> $DIR/return_pointer_aliasing_write_tail_call.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_aliasing_write_tail_call.rs:LL:CC
    |
 LL |             Call(*ptr = myfun(ptr), ReturnTo(after_call), UnwindContinue())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr b/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr
index 83efc9974e8..db876cb5ce6 100644
--- a/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr
+++ b/src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr
@@ -1,9 +1,9 @@
-thread 'main' panicked at $DIR/return_pointer_on_unwind.rs:LL:CC:
+thread 'main' panicked at tests/fail/function_calls/return_pointer_on_unwind.rs:LL:CC:
 explicit panic
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
-  --> $DIR/return_pointer_on_unwind.rs:LL:CC
+  --> tests/fail/function_calls/return_pointer_on_unwind.rs:LL:CC
    |
 LL |     dbg!(x.0);
    |     ^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
diff --git a/src/tools/miri/tests/fail/function_calls/simd_feature_flag_difference.rs b/src/tools/miri/tests/fail/function_calls/simd_feature_flag_difference.rs
index e98a3abadf5..200f1062a3e 100644
--- a/src/tools/miri/tests/fail/function_calls/simd_feature_flag_difference.rs
+++ b/src/tools/miri/tests/fail/function_calls/simd_feature_flag_difference.rs
@@ -1,4 +1,4 @@
-//@only-target-x86_64
+//@only-target: x86_64
 #![allow(improper_ctypes_definitions)]
 use std::arch::x86_64::*;
 use std::mem::transmute;
diff --git a/src/tools/miri/tests/fail/function_calls/simd_feature_flag_difference.stderr b/src/tools/miri/tests/fail/function_calls/simd_feature_flag_difference.stderr
index 2544421c7e8..1d5b331be6c 100644
--- a/src/tools/miri/tests/fail/function_calls/simd_feature_flag_difference.stderr
+++ b/src/tools/miri/tests/fail/function_calls/simd_feature_flag_difference.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: calling a function that requires unavailable target features: avx
-  --> $DIR/simd_feature_flag_difference.rs:LL:CC
+  --> tests/fail/function_calls/simd_feature_flag_difference.rs:LL:CC
    |
 LL |     unsafe { foo(0.0, x) }
    |              ^^^^^^^^^^^ calling a function that requires unavailable target features: avx
@@ -7,9 +7,9 @@ LL |     unsafe { foo(0.0, x) }
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `bar` at $DIR/simd_feature_flag_difference.rs:LL:CC
+   = note: inside `bar` at tests/fail/function_calls/simd_feature_flag_difference.rs:LL:CC
 note: inside `main`
-  --> $DIR/simd_feature_flag_difference.rs:LL:CC
+  --> tests/fail/function_calls/simd_feature_flag_difference.rs:LL:CC
    |
 LL |     let copy = bar(input);
    |                ^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/function_calls/target_feature.rs b/src/tools/miri/tests/fail/function_calls/target_feature.rs
index 84e01eb4803..32207ffae48 100644
--- a/src/tools/miri/tests/fail/function_calls/target_feature.rs
+++ b/src/tools/miri/tests/fail/function_calls/target_feature.rs
@@ -1,5 +1,5 @@
-//@only-target-x86_64: uses x86 target features
-//@ignore-target-x86_64-apple-darwin: that target actually has ssse3
+//@only-target: x86_64 # uses x86 target features
+//@ignore-target: x86_64-apple-darwin # that target actually has ssse3
 
 fn main() {
     assert!(!is_x86_feature_detected!("ssse3"));
diff --git a/src/tools/miri/tests/fail/function_calls/target_feature.stderr b/src/tools/miri/tests/fail/function_calls/target_feature.stderr
index 4d3cf6e9d3b..937bd4a5951 100644
--- a/src/tools/miri/tests/fail/function_calls/target_feature.stderr
+++ b/src/tools/miri/tests/fail/function_calls/target_feature.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: calling a function that requires unavailable target features: ssse3
-  --> $DIR/target_feature.rs:LL:CC
+  --> tests/fail/function_calls/target_feature.rs:LL:CC
    |
 LL |         ssse3_fn();
    |         ^^^^^^^^^^ calling a function that requires unavailable target features: ssse3
@@ -7,7 +7,7 @@ LL |         ssse3_fn();
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/target_feature.rs:LL:CC
+   = note: inside `main` at tests/fail/function_calls/target_feature.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_calls/target_feature_wasm.rs b/src/tools/miri/tests/fail/function_calls/target_feature_wasm.rs
index bd400e8824a..28d3d4a6054 100644
--- a/src/tools/miri/tests/fail/function_calls/target_feature_wasm.rs
+++ b/src/tools/miri/tests/fail/function_calls/target_feature_wasm.rs
@@ -1,4 +1,4 @@
-//@only-target-wasm: tests WASM-specific behavior
+//@only-target: wasm # tests WASM-specific behavior
 //@compile-flags: -C target-feature=-simd128
 
 fn main() {
diff --git a/src/tools/miri/tests/fail/function_calls/target_feature_wasm.stderr b/src/tools/miri/tests/fail/function_calls/target_feature_wasm.stderr
index dc0aca77f9e..9cc81546531 100644
--- a/src/tools/miri/tests/fail/function_calls/target_feature_wasm.stderr
+++ b/src/tools/miri/tests/fail/function_calls/target_feature_wasm.stderr
@@ -1,11 +1,11 @@
 error: abnormal termination: calling a function that requires unavailable target features: simd128
-  --> $DIR/target_feature_wasm.rs:LL:CC
+  --> tests/fail/function_calls/target_feature_wasm.rs:LL:CC
    |
 LL |     simd128_fn();
    |     ^^^^^^^^^^^^ calling a function that requires unavailable target features: simd128
    |
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/target_feature_wasm.rs:LL:CC
+   = note: inside `main` at tests/fail/function_calls/target_feature_wasm.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_array_vs_struct.stderr b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_array_vs_struct.stderr
index 2b2a898ce73..521cececc37 100644
--- a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_array_vs_struct.stderr
+++ b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_array_vs_struct.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: calling a function with argument of type S passing data of type [i32; 4]
-  --> $DIR/abi_mismatch_array_vs_struct.rs:LL:CC
+  --> tests/fail/function_pointers/abi_mismatch_array_vs_struct.rs:LL:CC
    |
 LL |     g(Default::default())
    |     ^^^^^^^^^^^^^^^^^^^^^ calling a function with argument of type S passing data of type [i32; 4]
@@ -9,7 +9,7 @@ LL |     g(Default::default())
    = help: this means these two types are not *guaranteed* to be ABI-compatible across all targets
    = help: if you think this code should be accepted anyway, please report an issue with Miri
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/abi_mismatch_array_vs_struct.rs:LL:CC
+   = note: inside `main` at tests/fail/function_pointers/abi_mismatch_array_vs_struct.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_int_vs_float.stderr b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_int_vs_float.stderr
index 752e17116d1..20704299257 100644
--- a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_int_vs_float.stderr
+++ b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_int_vs_float.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: calling a function with argument of type f32 passing data of type i32
-  --> $DIR/abi_mismatch_int_vs_float.rs:LL:CC
+  --> tests/fail/function_pointers/abi_mismatch_int_vs_float.rs:LL:CC
    |
 LL |     g(42)
    |     ^^^^^ calling a function with argument of type f32 passing data of type i32
@@ -9,7 +9,7 @@ LL |     g(42)
    = help: this means these two types are not *guaranteed* to be ABI-compatible across all targets
    = help: if you think this code should be accepted anyway, please report an issue with Miri
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/abi_mismatch_int_vs_float.rs:LL:CC
+   = note: inside `main` at tests/fail/function_pointers/abi_mismatch_int_vs_float.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_raw_pointer.stderr b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_raw_pointer.stderr
index 907a8e50c41..3e3d07e1484 100644
--- a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_raw_pointer.stderr
+++ b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_raw_pointer.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: calling a function with argument of type *const [i32] passing data of type *const i32
-  --> $DIR/abi_mismatch_raw_pointer.rs:LL:CC
+  --> tests/fail/function_pointers/abi_mismatch_raw_pointer.rs:LL:CC
    |
 LL |     g(&42 as *const i32)
    |     ^^^^^^^^^^^^^^^^^^^^ calling a function with argument of type *const [i32] passing data of type *const i32
@@ -9,7 +9,7 @@ LL |     g(&42 as *const i32)
    = help: this means these two types are not *guaranteed* to be ABI-compatible across all targets
    = help: if you think this code should be accepted anyway, please report an issue with Miri
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/abi_mismatch_raw_pointer.rs:LL:CC
+   = note: inside `main` at tests/fail/function_pointers/abi_mismatch_raw_pointer.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_repr_C.stderr b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_repr_C.stderr
index 8ec19db813a..6b92824494a 100644
--- a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_repr_C.stderr
+++ b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_repr_C.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: calling a function with argument of type S2 passing data of type S1
-  --> $DIR/abi_mismatch_repr_C.rs:LL:CC
+  --> tests/fail/function_pointers/abi_mismatch_repr_C.rs:LL:CC
    |
 LL |     fnptr(S1(NonZero::new(1).unwrap()));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling a function with argument of type S2 passing data of type S1
@@ -9,7 +9,7 @@ LL |     fnptr(S1(NonZero::new(1).unwrap()));
    = help: this means these two types are not *guaranteed* to be ABI-compatible across all targets
    = help: if you think this code should be accepted anyway, please report an issue with Miri
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/abi_mismatch_repr_C.rs:LL:CC
+   = note: inside `main` at tests/fail/function_pointers/abi_mismatch_repr_C.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_return_type.stderr b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_return_type.stderr
index 3793590f842..51539b078ae 100644
--- a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_return_type.stderr
+++ b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_return_type.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: calling a function with return type u32 passing return place of type ()
-  --> $DIR/abi_mismatch_return_type.rs:LL:CC
+  --> tests/fail/function_pointers/abi_mismatch_return_type.rs:LL:CC
    |
 LL |     g()
    |     ^^^ calling a function with return type u32 passing return place of type ()
@@ -9,7 +9,7 @@ LL |     g()
    = help: this means these two types are not *guaranteed* to be ABI-compatible across all targets
    = help: if you think this code should be accepted anyway, please report an issue with Miri
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/abi_mismatch_return_type.rs:LL:CC
+   = note: inside `main` at tests/fail/function_pointers/abi_mismatch_return_type.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_simple.stderr b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_simple.stderr
index 0c533c14173..16a83b8e342 100644
--- a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_simple.stderr
+++ b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_simple.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: calling a function with argument of type (i32, i32) passing data of type i32
-  --> $DIR/abi_mismatch_simple.rs:LL:CC
+  --> tests/fail/function_pointers/abi_mismatch_simple.rs:LL:CC
    |
 LL |     g(42)
    |     ^^^^^ calling a function with argument of type (i32, i32) passing data of type i32
@@ -9,7 +9,7 @@ LL |     g(42)
    = help: this means these two types are not *guaranteed* to be ABI-compatible across all targets
    = help: if you think this code should be accepted anyway, please report an issue with Miri
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/abi_mismatch_simple.rs:LL:CC
+   = note: inside `main` at tests/fail/function_pointers/abi_mismatch_simple.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_too_few_args.stderr b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_too_few_args.stderr
index 2e50d054e77..760826805c7 100644
--- a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_too_few_args.stderr
+++ b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_too_few_args.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: calling a function with fewer arguments than it requires
-  --> $DIR/abi_mismatch_too_few_args.rs:LL:CC
+  --> tests/fail/function_pointers/abi_mismatch_too_few_args.rs:LL:CC
    |
 LL |     g()
    |     ^^^ calling a function with fewer arguments than it requires
@@ -7,7 +7,7 @@ LL |     g()
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/abi_mismatch_too_few_args.rs:LL:CC
+   = note: inside `main` at tests/fail/function_pointers/abi_mismatch_too_few_args.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_too_many_args.stderr b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_too_many_args.stderr
index facfe9d31f2..9552250546b 100644
--- a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_too_many_args.stderr
+++ b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_too_many_args.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: calling a function with more arguments than it expected
-  --> $DIR/abi_mismatch_too_many_args.rs:LL:CC
+  --> tests/fail/function_pointers/abi_mismatch_too_many_args.rs:LL:CC
    |
 LL |     g(42)
    |     ^^^^^ calling a function with more arguments than it expected
@@ -7,7 +7,7 @@ LL |     g(42)
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/abi_mismatch_too_many_args.rs:LL:CC
+   = note: inside `main` at tests/fail/function_pointers/abi_mismatch_too_many_args.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_vector.stderr b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_vector.stderr
index ef4b60b83b1..021be890d25 100644
--- a/src/tools/miri/tests/fail/function_pointers/abi_mismatch_vector.stderr
+++ b/src/tools/miri/tests/fail/function_pointers/abi_mismatch_vector.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: calling a function with argument of type std::simd::Simd<u32, 8> passing data of type std::simd::Simd<u64, 4>
-  --> $DIR/abi_mismatch_vector.rs:LL:CC
+  --> tests/fail/function_pointers/abi_mismatch_vector.rs:LL:CC
    |
 LL |     g(Default::default())
    |     ^^^^^^^^^^^^^^^^^^^^^ calling a function with argument of type std::simd::Simd<u32, 8> passing data of type std::simd::Simd<u64, 4>
@@ -9,7 +9,7 @@ LL |     g(Default::default())
    = help: this means these two types are not *guaranteed* to be ABI-compatible across all targets
    = help: if you think this code should be accepted anyway, please report an issue with Miri
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/abi_mismatch_vector.rs:LL:CC
+   = note: inside `main` at tests/fail/function_pointers/abi_mismatch_vector.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_pointers/cast_box_int_to_fn_ptr.stderr b/src/tools/miri/tests/fail/function_pointers/cast_box_int_to_fn_ptr.stderr
index f95a62535d8..6112e92c939 100644
--- a/src/tools/miri/tests/fail/function_pointers/cast_box_int_to_fn_ptr.stderr
+++ b/src/tools/miri/tests/fail/function_pointers/cast_box_int_to_fn_ptr.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: using ALLOC as function pointer but it does not point to a function
-  --> $DIR/cast_box_int_to_fn_ptr.rs:LL:CC
+  --> tests/fail/function_pointers/cast_box_int_to_fn_ptr.rs:LL:CC
    |
 LL |     (*g)(42)
    |     ^^^^^^^^ using ALLOC as function pointer but it does not point to a function
@@ -7,7 +7,7 @@ LL |     (*g)(42)
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/cast_box_int_to_fn_ptr.rs:LL:CC
+   = note: inside `main` at tests/fail/function_pointers/cast_box_int_to_fn_ptr.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_pointers/cast_int_to_fn_ptr.stderr b/src/tools/miri/tests/fail/function_pointers/cast_int_to_fn_ptr.stderr
index 347afa77053..f2d9933188d 100644
--- a/src/tools/miri/tests/fail/function_pointers/cast_int_to_fn_ptr.stderr
+++ b/src/tools/miri/tests/fail/function_pointers/cast_int_to_fn_ptr.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: out-of-bounds pointer use: expected a pointer to some allocation, but got 0x2a[noalloc] which is a dangling pointer (it has no provenance)
-  --> $DIR/cast_int_to_fn_ptr.rs:LL:CC
+  --> tests/fail/function_pointers/cast_int_to_fn_ptr.rs:LL:CC
    |
 LL |     g(42)
    |     ^^^^^ out-of-bounds pointer use: expected a pointer to some allocation, but got 0x2a[noalloc] which is a dangling pointer (it has no provenance)
@@ -7,7 +7,7 @@ LL |     g(42)
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/cast_int_to_fn_ptr.rs:LL:CC
+   = note: inside `main` at tests/fail/function_pointers/cast_int_to_fn_ptr.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_pointers/deref_fn_ptr.stderr b/src/tools/miri/tests/fail/function_pointers/deref_fn_ptr.stderr
index b5cee95d66d..f7cc82b80df 100644
--- a/src/tools/miri/tests/fail/function_pointers/deref_fn_ptr.stderr
+++ b/src/tools/miri/tests/fail/function_pointers/deref_fn_ptr.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: accessing ALLOC which contains a function
-  --> $DIR/deref_fn_ptr.rs:LL:CC
+  --> tests/fail/function_pointers/deref_fn_ptr.rs:LL:CC
    |
 LL |         *std::mem::transmute::<fn(), *const u8>(f)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ accessing ALLOC which contains a function
@@ -7,7 +7,7 @@ LL |         *std::mem::transmute::<fn(), *const u8>(f)
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/deref_fn_ptr.rs:LL:CC
+   = note: inside `main` at tests/fail/function_pointers/deref_fn_ptr.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_pointers/execute_memory.stderr b/src/tools/miri/tests/fail/function_pointers/execute_memory.stderr
index 4370e6d6a29..e0573184282 100644
--- a/src/tools/miri/tests/fail/function_pointers/execute_memory.stderr
+++ b/src/tools/miri/tests/fail/function_pointers/execute_memory.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: using ALLOC as function pointer but it does not point to a function
-  --> $DIR/execute_memory.rs:LL:CC
+  --> tests/fail/function_pointers/execute_memory.rs:LL:CC
    |
 LL |         f()
    |         ^^^ using ALLOC as function pointer but it does not point to a function
@@ -7,7 +7,7 @@ LL |         f()
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/execute_memory.rs:LL:CC
+   = note: inside `main` at tests/fail/function_pointers/execute_memory.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/function_pointers/fn_ptr_offset.stderr b/src/tools/miri/tests/fail/function_pointers/fn_ptr_offset.stderr
index e66ab681860..4ed09683c63 100644
--- a/src/tools/miri/tests/fail/function_pointers/fn_ptr_offset.stderr
+++ b/src/tools/miri/tests/fail/function_pointers/fn_ptr_offset.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: using ALLOC+0x1 as function pointer but it does not point to a function
-  --> $DIR/fn_ptr_offset.rs:LL:CC
+  --> tests/fail/function_pointers/fn_ptr_offset.rs:LL:CC
    |
 LL |     x();
    |     ^^^ using ALLOC+0x1 as function pointer but it does not point to a function
@@ -7,7 +7,7 @@ LL |     x();
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/fn_ptr_offset.rs:LL:CC
+   = note: inside `main` at tests/fail/function_pointers/fn_ptr_offset.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsic_fallback_is_spec.stderr b/src/tools/miri/tests/fail/intrinsic_fallback_is_spec.stderr
index db3941a32a5..a36b0fca802 100644
--- a/src/tools/miri/tests/fail/intrinsic_fallback_is_spec.stderr
+++ b/src/tools/miri/tests/fail/intrinsic_fallback_is_spec.stderr
@@ -1,12 +1,12 @@
 error: unsupported operation: Miri can only use intrinsic fallback bodies that exactly reflect the specification: they fully check for UB and are as non-deterministic as possible. After verifying that `ptr_guaranteed_cmp` does so, add the `#[miri::intrinsic_fallback_is_spec]` attribute to it; also ping @rust-lang/miri when you do that
-  --> $DIR/intrinsic_fallback_is_spec.rs:LL:CC
+  --> tests/fail/intrinsic_fallback_is_spec.rs:LL:CC
    |
 LL |     ptr_guaranteed_cmp::<()>(std::ptr::null(), std::ptr::null());
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Miri can only use intrinsic fallback bodies that exactly reflect the specification: they fully check for UB and are as non-deterministic as possible. After verifying that `ptr_guaranteed_cmp` does so, add the `#[miri::intrinsic_fallback_is_spec]` attribute to it; also ping @rust-lang/miri when you do that
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/intrinsic_fallback_is_spec.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsic_fallback_is_spec.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/assume.stderr b/src/tools/miri/tests/fail/intrinsics/assume.stderr
index 7fa6f7b5bfc..eadbd2c0d58 100644
--- a/src/tools/miri/tests/fail/intrinsics/assume.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/assume.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `assume` called with `false`
-  --> $DIR/assume.rs:LL:CC
+  --> tests/fail/intrinsics/assume.rs:LL:CC
    |
 LL |         std::intrinsics::assume(x > 42);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `assume` called with `false`
@@ -7,7 +7,7 @@ LL |         std::intrinsics::assume(x > 42);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/assume.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/assume.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/copy_overflow.stderr b/src/tools/miri/tests/fail/intrinsics/copy_overflow.stderr
index b7c92cf4a57..c50c7c1ef43 100644
--- a/src/tools/miri/tests/fail/intrinsics/copy_overflow.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/copy_overflow.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: overflow computing total size of `copy`
-  --> $DIR/copy_overflow.rs:LL:CC
+  --> tests/fail/intrinsics/copy_overflow.rs:LL:CC
    |
 LL |         (&mut y as *mut i32).copy_from(&x, 1usize << (mem::size_of::<usize>() * 8 - 1));
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflow computing total size of `copy`
@@ -7,7 +7,7 @@ LL |         (&mut y as *mut i32).copy_from(&x, 1usize << (mem::size_of::<usize>
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/copy_overflow.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/copy_overflow.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/copy_overlapping.stderr b/src/tools/miri/tests/fail/intrinsics/copy_overlapping.stderr
index e9ea262caf7..fef5a0a82a0 100644
--- a/src/tools/miri/tests/fail/intrinsics/copy_overlapping.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/copy_overlapping.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `copy_nonoverlapping` called on overlapping ranges
-  --> $DIR/copy_overlapping.rs:LL:CC
+  --> tests/fail/intrinsics/copy_overlapping.rs:LL:CC
    |
 LL |         copy_nonoverlapping(a, b, 2);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `copy_nonoverlapping` called on overlapping ranges
@@ -7,7 +7,7 @@ LL |         copy_nonoverlapping(a, b, 2);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/copy_overlapping.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/copy_overlapping.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/copy_unaligned.stderr b/src/tools/miri/tests/fail/intrinsics/copy_unaligned.stderr
index d190f3de6b8..2d0edd4e6cb 100644
--- a/src/tools/miri/tests/fail/intrinsics/copy_unaligned.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/copy_unaligned.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: accessing memory with alignment ALIGN, but alignment ALIGN is required
-  --> $DIR/copy_unaligned.rs:LL:CC
+  --> tests/fail/intrinsics/copy_unaligned.rs:LL:CC
    |
 LL |         copy_nonoverlapping(&data[5], ptr, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ accessing memory with alignment ALIGN, but alignment ALIGN is required
@@ -7,7 +7,7 @@ LL |         copy_nonoverlapping(&data[5], ptr, 0);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/copy_unaligned.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/copy_unaligned.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/ctlz_nonzero.stderr b/src/tools/miri/tests/fail/intrinsics/ctlz_nonzero.stderr
index 9889daaa851..5ad3b8ad2a8 100644
--- a/src/tools/miri/tests/fail/intrinsics/ctlz_nonzero.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/ctlz_nonzero.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `ctlz_nonzero` called on 0
-  --> $DIR/ctlz_nonzero.rs:LL:CC
+  --> tests/fail/intrinsics/ctlz_nonzero.rs:LL:CC
    |
 LL |         ctlz_nonzero(0u8);
    |         ^^^^^^^^^^^^^^^^^ `ctlz_nonzero` called on 0
@@ -7,7 +7,7 @@ LL |         ctlz_nonzero(0u8);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/ctlz_nonzero.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/ctlz_nonzero.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/cttz_nonzero.stderr b/src/tools/miri/tests/fail/intrinsics/cttz_nonzero.stderr
index 0f75657e170..d0263ac1e45 100644
--- a/src/tools/miri/tests/fail/intrinsics/cttz_nonzero.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/cttz_nonzero.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `cttz_nonzero` called on 0
-  --> $DIR/cttz_nonzero.rs:LL:CC
+  --> tests/fail/intrinsics/cttz_nonzero.rs:LL:CC
    |
 LL |         cttz_nonzero(0u8);
    |         ^^^^^^^^^^^^^^^^^ `cttz_nonzero` called on 0
@@ -7,7 +7,7 @@ LL |         cttz_nonzero(0u8);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/cttz_nonzero.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/cttz_nonzero.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/div-by-zero.stderr b/src/tools/miri/tests/fail/intrinsics/div-by-zero.stderr
index 9f66e63ca5c..e276874ba25 100644
--- a/src/tools/miri/tests/fail/intrinsics/div-by-zero.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/div-by-zero.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: dividing by zero
-  --> $DIR/div-by-zero.rs:LL:CC
+  --> tests/fail/intrinsics/div-by-zero.rs:LL:CC
    |
 LL |         let _n = unchecked_div(1i64, 0);
    |                  ^^^^^^^^^^^^^^^^^^^^^^ dividing by zero
@@ -7,7 +7,7 @@ LL |         let _n = unchecked_div(1i64, 0);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/div-by-zero.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/div-by-zero.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/exact_div1.stderr b/src/tools/miri/tests/fail/intrinsics/exact_div1.stderr
index ca6125ab899..f133baecfa2 100644
--- a/src/tools/miri/tests/fail/intrinsics/exact_div1.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/exact_div1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: calculating the remainder with a divisor of zero
-  --> $DIR/exact_div1.rs:LL:CC
+  --> tests/fail/intrinsics/exact_div1.rs:LL:CC
    |
 LL |     unsafe { std::intrinsics::exact_div(2, 0) };
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calculating the remainder with a divisor of zero
@@ -7,7 +7,7 @@ LL |     unsafe { std::intrinsics::exact_div(2, 0) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/exact_div1.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/exact_div1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/exact_div2.stderr b/src/tools/miri/tests/fail/intrinsics/exact_div2.stderr
index 306e9bdc238..315417fe8df 100644
--- a/src/tools/miri/tests/fail/intrinsics/exact_div2.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/exact_div2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: exact_div: 2_u16 cannot be divided by 3_u16 without remainder
-  --> $DIR/exact_div2.rs:LL:CC
+  --> tests/fail/intrinsics/exact_div2.rs:LL:CC
    |
 LL |     unsafe { std::intrinsics::exact_div(2u16, 3) };
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ exact_div: 2_u16 cannot be divided by 3_u16 without remainder
@@ -7,7 +7,7 @@ LL |     unsafe { std::intrinsics::exact_div(2u16, 3) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/exact_div2.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/exact_div2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/exact_div3.stderr b/src/tools/miri/tests/fail/intrinsics/exact_div3.stderr
index cbcb093a4e6..42f52540a4c 100644
--- a/src/tools/miri/tests/fail/intrinsics/exact_div3.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/exact_div3.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: exact_div: -19_i8 cannot be divided by 2_i8 without remainder
-  --> $DIR/exact_div3.rs:LL:CC
+  --> tests/fail/intrinsics/exact_div3.rs:LL:CC
    |
 LL |     unsafe { std::intrinsics::exact_div(-19i8, 2) };
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ exact_div: -19_i8 cannot be divided by 2_i8 without remainder
@@ -7,7 +7,7 @@ LL |     unsafe { std::intrinsics::exact_div(-19i8, 2) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/exact_div3.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/exact_div3.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/exact_div4.stderr b/src/tools/miri/tests/fail/intrinsics/exact_div4.stderr
index 1b903bc97ae..723ed4e49ed 100644
--- a/src/tools/miri/tests/fail/intrinsics/exact_div4.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/exact_div4.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: overflow in signed remainder (dividing MIN by -1)
-  --> $DIR/exact_div4.rs:LL:CC
+  --> tests/fail/intrinsics/exact_div4.rs:LL:CC
    |
 LL |     unsafe { std::intrinsics::exact_div(i64::MIN, -1) };
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflow in signed remainder (dividing MIN by -1)
@@ -7,7 +7,7 @@ LL |     unsafe { std::intrinsics::exact_div(i64::MIN, -1) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/exact_div4.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/exact_div4.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/fast_math_both.stderr b/src/tools/miri/tests/fail/intrinsics/fast_math_both.stderr
index feba0c5991c..7579a81e3e1 100644
--- a/src/tools/miri/tests/fail/intrinsics/fast_math_both.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/fast_math_both.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `fsub_fast` intrinsic called with non-finite value as both parameters
-  --> $DIR/fast_math_both.rs:LL:CC
+  --> tests/fail/intrinsics/fast_math_both.rs:LL:CC
    |
 LL | ...: f32 = core::intrinsics::fsub_fast(f32::NAN, f32::NAN);
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `fsub_fast` intrinsic called with non-finite value as both parameters
@@ -7,7 +7,7 @@ LL | ...: f32 = core::intrinsics::fsub_fast(f32::NAN, f32::NAN);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/fast_math_both.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/fast_math_both.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/fast_math_first.stderr b/src/tools/miri/tests/fail/intrinsics/fast_math_first.stderr
index b26b5a37215..8295ec1089f 100644
--- a/src/tools/miri/tests/fail/intrinsics/fast_math_first.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/fast_math_first.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `frem_fast` intrinsic called with non-finite value as first parameter
-  --> $DIR/fast_math_first.rs:LL:CC
+  --> tests/fail/intrinsics/fast_math_first.rs:LL:CC
    |
 LL | ...   let _x: f32 = core::intrinsics::frem_fast(f32::NAN, 3.2);
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `frem_fast` intrinsic called with non-finite value as first parameter
@@ -7,7 +7,7 @@ LL | ...   let _x: f32 = core::intrinsics::frem_fast(f32::NAN, 3.2);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/fast_math_first.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/fast_math_first.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/fast_math_result.stderr b/src/tools/miri/tests/fail/intrinsics/fast_math_result.stderr
index 5b24d225026..8ddbd4cc19e 100644
--- a/src/tools/miri/tests/fail/intrinsics/fast_math_result.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/fast_math_result.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `fdiv_fast` intrinsic produced non-finite value as result
-  --> $DIR/fast_math_result.rs:LL:CC
+  --> tests/fail/intrinsics/fast_math_result.rs:LL:CC
    |
 LL |         let _x: f32 = core::intrinsics::fdiv_fast(1.0, 0.0);
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `fdiv_fast` intrinsic produced non-finite value as result
@@ -7,7 +7,7 @@ LL |         let _x: f32 = core::intrinsics::fdiv_fast(1.0, 0.0);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/fast_math_result.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/fast_math_result.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/fast_math_second.stderr b/src/tools/miri/tests/fail/intrinsics/fast_math_second.stderr
index cb46aa97a8d..0fde006b3bd 100644
--- a/src/tools/miri/tests/fail/intrinsics/fast_math_second.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/fast_math_second.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `fmul_fast` intrinsic called with non-finite value as second parameter
-  --> $DIR/fast_math_second.rs:LL:CC
+  --> tests/fail/intrinsics/fast_math_second.rs:LL:CC
    |
 LL | ...f32 = core::intrinsics::fmul_fast(3.4f32, f32::INFINITY);
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `fmul_fast` intrinsic called with non-finite value as second parameter
@@ -7,7 +7,7 @@ LL | ...f32 = core::intrinsics::fmul_fast(3.4f32, f32::INFINITY);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/fast_math_second.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/fast_math_second.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_inf1.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_inf1.stderr
index 2de8f3420b7..bcc8ff667ff 100644
--- a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_inf1.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_inf1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on +Inf_f32 which cannot be represented in target type `i32`
-  --> $DIR/float_to_int_32_inf1.rs:LL:CC
+  --> tests/fail/intrinsics/float_to_int_32_inf1.rs:LL:CC
    |
 LL |         float_to_int_unchecked::<f32, i32>(f32::INFINITY);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on +Inf_f32 which cannot be represented in target type `i32`
@@ -7,7 +7,7 @@ LL |         float_to_int_unchecked::<f32, i32>(f32::INFINITY);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/float_to_int_32_inf1.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/float_to_int_32_inf1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_infneg1.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_infneg1.stderr
index 53ed208bdee..9ac910c8d2f 100644
--- a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_infneg1.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_infneg1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on -Inf_f32 which cannot be represented in target type `i32`
-  --> $DIR/float_to_int_32_infneg1.rs:LL:CC
+  --> tests/fail/intrinsics/float_to_int_32_infneg1.rs:LL:CC
    |
 LL |         float_to_int_unchecked::<f32, i32>(f32::NEG_INFINITY);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on -Inf_f32 which cannot be represented in target type `i32`
@@ -7,7 +7,7 @@ LL |         float_to_int_unchecked::<f32, i32>(f32::NEG_INFINITY);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/float_to_int_32_infneg1.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/float_to_int_32_infneg1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_nan.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_nan.stderr
index afda7124c11..b377b701361 100644
--- a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_nan.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_nan.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on NaN_f32 which cannot be represented in target type `u32`
-  --> $DIR/float_to_int_32_nan.rs:LL:CC
+  --> tests/fail/intrinsics/float_to_int_32_nan.rs:LL:CC
    |
 LL |         float_to_int_unchecked::<f32, u32>(f32::NAN);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on NaN_f32 which cannot be represented in target type `u32`
@@ -7,7 +7,7 @@ LL |         float_to_int_unchecked::<f32, u32>(f32::NAN);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/float_to_int_32_nan.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/float_to_int_32_nan.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_nanneg.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_nanneg.stderr
index 8ba46de8641..2a0dcdfaeef 100644
--- a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_nanneg.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_nanneg.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on NaN_f32 which cannot be represented in target type `u32`
-  --> $DIR/float_to_int_32_nanneg.rs:LL:CC
+  --> tests/fail/intrinsics/float_to_int_32_nanneg.rs:LL:CC
    |
 LL |         float_to_int_unchecked::<f32, u32>(-f32::NAN);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on NaN_f32 which cannot be represented in target type `u32`
@@ -7,7 +7,7 @@ LL |         float_to_int_unchecked::<f32, u32>(-f32::NAN);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/float_to_int_32_nanneg.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/float_to_int_32_nanneg.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_neg.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_neg.stderr
index 9f4b2af2167..45be75e2f02 100644
--- a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_neg.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_neg.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on -1f32 which cannot be represented in target type `u32`
-  --> $DIR/float_to_int_32_neg.rs:LL:CC
+  --> tests/fail/intrinsics/float_to_int_32_neg.rs:LL:CC
    |
 LL |         float_to_int_unchecked::<f32, u32>(-1.000000001f32);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on -1f32 which cannot be represented in target type `u32`
@@ -7,7 +7,7 @@ LL |         float_to_int_unchecked::<f32, u32>(-1.000000001f32);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/float_to_int_32_neg.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/float_to_int_32_neg.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_big1.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_big1.stderr
index a8e56ddb59b..8597dc0b072 100644
--- a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_big1.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_big1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on 2.14748365E+9f32 which cannot be represented in target type `i32`
-  --> $DIR/float_to_int_32_too_big1.rs:LL:CC
+  --> tests/fail/intrinsics/float_to_int_32_too_big1.rs:LL:CC
    |
 LL |         float_to_int_unchecked::<f32, i32>(2147483648.0f32);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on 2.14748365E+9f32 which cannot be represented in target type `i32`
@@ -7,7 +7,7 @@ LL |         float_to_int_unchecked::<f32, i32>(2147483648.0f32);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/float_to_int_32_too_big1.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/float_to_int_32_too_big1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_big2.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_big2.stderr
index a966e2e639c..d79004e6429 100644
--- a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_big2.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_big2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on 4.2949673E+9f32 which cannot be represented in target type `u32`
-  --> $DIR/float_to_int_32_too_big2.rs:LL:CC
+  --> tests/fail/intrinsics/float_to_int_32_too_big2.rs:LL:CC
    |
 LL |         float_to_int_unchecked::<f32, u32>((u32::MAX - 127) as f32);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on 4.2949673E+9f32 which cannot be represented in target type `u32`
@@ -7,7 +7,7 @@ LL |         float_to_int_unchecked::<f32, u32>((u32::MAX - 127) as f32);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/float_to_int_32_too_big2.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/float_to_int_32_too_big2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_small1.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_small1.stderr
index 6115b381ebe..6a1d48f4807 100644
--- a/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_small1.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_32_too_small1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on -2.1474839E+9f32 which cannot be represented in target type `i32`
-  --> $DIR/float_to_int_32_too_small1.rs:LL:CC
+  --> tests/fail/intrinsics/float_to_int_32_too_small1.rs:LL:CC
    |
 LL |         float_to_int_unchecked::<f32, i32>(-2147483904.0f32);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on -2.1474839E+9f32 which cannot be represented in target type `i32`
@@ -7,7 +7,7 @@ LL |         float_to_int_unchecked::<f32, i32>(-2147483904.0f32);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/float_to_int_32_too_small1.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/float_to_int_32_too_small1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_inf1.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_inf1.stderr
index 5db9fb1417c..d77544cb37f 100644
--- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_inf1.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_inf1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on +Inf_f64 which cannot be represented in target type `u128`
-  --> $DIR/float_to_int_64_inf1.rs:LL:CC
+  --> tests/fail/intrinsics/float_to_int_64_inf1.rs:LL:CC
    |
 LL |         float_to_int_unchecked::<f64, u128>(f64::INFINITY);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on +Inf_f64 which cannot be represented in target type `u128`
@@ -7,7 +7,7 @@ LL |         float_to_int_unchecked::<f64, u128>(f64::INFINITY);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/float_to_int_64_inf1.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/float_to_int_64_inf1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_infneg1.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_infneg1.stderr
index 3e8dadb79e4..c6f9eb41138 100644
--- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_infneg1.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_infneg1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on -Inf_f64 which cannot be represented in target type `u128`
-  --> $DIR/float_to_int_64_infneg1.rs:LL:CC
+  --> tests/fail/intrinsics/float_to_int_64_infneg1.rs:LL:CC
    |
 LL |         float_to_int_unchecked::<f64, u128>(f64::NEG_INFINITY);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on -Inf_f64 which cannot be represented in target type `u128`
@@ -7,7 +7,7 @@ LL |         float_to_int_unchecked::<f64, u128>(f64::NEG_INFINITY);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/float_to_int_64_infneg1.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/float_to_int_64_infneg1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_infneg2.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_infneg2.stderr
index cb59974bf45..fc80f1679ce 100644
--- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_infneg2.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_infneg2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on -Inf_f64 which cannot be represented in target type `i128`
-  --> $DIR/float_to_int_64_infneg2.rs:LL:CC
+  --> tests/fail/intrinsics/float_to_int_64_infneg2.rs:LL:CC
    |
 LL |         float_to_int_unchecked::<f64, i128>(f64::NEG_INFINITY);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on -Inf_f64 which cannot be represented in target type `i128`
@@ -7,7 +7,7 @@ LL |         float_to_int_unchecked::<f64, i128>(f64::NEG_INFINITY);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/float_to_int_64_infneg2.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/float_to_int_64_infneg2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_nan.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_nan.stderr
index 68697060515..01059ed5a73 100644
--- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_nan.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_nan.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on NaN_f64 which cannot be represented in target type `u32`
-  --> $DIR/float_to_int_64_nan.rs:LL:CC
+  --> tests/fail/intrinsics/float_to_int_64_nan.rs:LL:CC
    |
 LL |         float_to_int_unchecked::<f64, u32>(f64::NAN);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on NaN_f64 which cannot be represented in target type `u32`
@@ -7,7 +7,7 @@ LL |         float_to_int_unchecked::<f64, u32>(f64::NAN);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/float_to_int_64_nan.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/float_to_int_64_nan.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_neg.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_neg.stderr
index 505a6463cd3..f17d502d51c 100644
--- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_neg.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_neg.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on -1.0000000000000999f64 which cannot be represented in target type `u128`
-  --> $DIR/float_to_int_64_neg.rs:LL:CC
+  --> tests/fail/intrinsics/float_to_int_64_neg.rs:LL:CC
    |
 LL |         float_to_int_unchecked::<f64, u128>(-1.0000000000001f64);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on -1.0000000000000999f64 which cannot be represented in target type `u128`
@@ -7,7 +7,7 @@ LL |         float_to_int_unchecked::<f64, u128>(-1.0000000000001f64);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/float_to_int_64_neg.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/float_to_int_64_neg.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big1.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big1.stderr
index bcfd394686b..9379be3f82f 100644
--- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big1.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on 2147483648f64 which cannot be represented in target type `i32`
-  --> $DIR/float_to_int_64_too_big1.rs:LL:CC
+  --> tests/fail/intrinsics/float_to_int_64_too_big1.rs:LL:CC
    |
 LL |         float_to_int_unchecked::<f64, i32>(2147483648.0f64);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on 2147483648f64 which cannot be represented in target type `i32`
@@ -7,7 +7,7 @@ LL |         float_to_int_unchecked::<f64, i32>(2147483648.0f64);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/float_to_int_64_too_big1.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/float_to_int_64_too_big1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big2.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big2.stderr
index ac6139d7e7d..1c0a0e0e88b 100644
--- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big2.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on 9.2233720368547758E+18f64 which cannot be represented in target type `i64`
-  --> $DIR/float_to_int_64_too_big2.rs:LL:CC
+  --> tests/fail/intrinsics/float_to_int_64_too_big2.rs:LL:CC
    |
 LL |         float_to_int_unchecked::<f64, i64>(9223372036854775808.0f64);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on 9.2233720368547758E+18f64 which cannot be represented in target type `i64`
@@ -7,7 +7,7 @@ LL |         float_to_int_unchecked::<f64, i64>(9223372036854775808.0f64);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/float_to_int_64_too_big2.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/float_to_int_64_too_big2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big3.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big3.stderr
index e289b4c0fc0..54ff73d5961 100644
--- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big3.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big3.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on 1.8446744073709552E+19f64 which cannot be represented in target type `u64`
-  --> $DIR/float_to_int_64_too_big3.rs:LL:CC
+  --> tests/fail/intrinsics/float_to_int_64_too_big3.rs:LL:CC
    |
 LL |         float_to_int_unchecked::<f64, u64>(18446744073709551616.0f64);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on 1.8446744073709552E+19f64 which cannot be represented in target type `u64`
@@ -7,7 +7,7 @@ LL |         float_to_int_unchecked::<f64, u64>(18446744073709551616.0f64);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/float_to_int_64_too_big3.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/float_to_int_64_too_big3.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big4.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big4.stderr
index 657c72daa6f..b622867c097 100644
--- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big4.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big4.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on 3.4028236692093846E+38f64 which cannot be represented in target type `u128`
-  --> $DIR/float_to_int_64_too_big4.rs:LL:CC
+  --> tests/fail/intrinsics/float_to_int_64_too_big4.rs:LL:CC
    |
 LL |         float_to_int_unchecked::<f64, u128>(u128::MAX as f64);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on 3.4028236692093846E+38f64 which cannot be represented in target type `u128`
@@ -7,7 +7,7 @@ LL |         float_to_int_unchecked::<f64, u128>(u128::MAX as f64);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/float_to_int_64_too_big4.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/float_to_int_64_too_big4.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big5.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big5.stderr
index 2a61b5fe15f..ffb8b0d1743 100644
--- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big5.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big5.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on 2.4028236692093845E+38f64 which cannot be represented in target type `i128`
-  --> $DIR/float_to_int_64_too_big5.rs:LL:CC
+  --> tests/fail/intrinsics/float_to_int_64_too_big5.rs:LL:CC
    |
 LL |         float_to_int_unchecked::<f64, i128>(240282366920938463463374607431768211455.0f64);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on 2.4028236692093845E+38f64 which cannot be represented in target type `i128`
@@ -7,7 +7,7 @@ LL |         float_to_int_unchecked::<f64, i128>(2402823669209384634633746074317
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/float_to_int_64_too_big5.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/float_to_int_64_too_big5.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big6.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big6.stderr
index 1b4b76ced18..8c5d81e01c2 100644
--- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big6.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big6.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on 1.7976931348623157E+308f64 which cannot be represented in target type `u128`
-  --> $DIR/float_to_int_64_too_big6.rs:LL:CC
+  --> tests/fail/intrinsics/float_to_int_64_too_big6.rs:LL:CC
    |
 LL |         float_to_int_unchecked::<f64, u128>(f64::MAX);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on 1.7976931348623157E+308f64 which cannot be represented in target type `u128`
@@ -7,7 +7,7 @@ LL |         float_to_int_unchecked::<f64, u128>(f64::MAX);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/float_to_int_64_too_big6.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/float_to_int_64_too_big6.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big7.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big7.stderr
index 47df8d90c06..237540e2a64 100644
--- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big7.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_big7.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on -1.7976931348623157E+308f64 which cannot be represented in target type `i128`
-  --> $DIR/float_to_int_64_too_big7.rs:LL:CC
+  --> tests/fail/intrinsics/float_to_int_64_too_big7.rs:LL:CC
    |
 LL |         float_to_int_unchecked::<f64, i128>(f64::MIN);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on -1.7976931348623157E+308f64 which cannot be represented in target type `i128`
@@ -7,7 +7,7 @@ LL |         float_to_int_unchecked::<f64, i128>(f64::MIN);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/float_to_int_64_too_big7.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/float_to_int_64_too_big7.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small1.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small1.stderr
index c5eb405ee95..d1b9076d14b 100644
--- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small1.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on -2147483649f64 which cannot be represented in target type `i32`
-  --> $DIR/float_to_int_64_too_small1.rs:LL:CC
+  --> tests/fail/intrinsics/float_to_int_64_too_small1.rs:LL:CC
    |
 LL |         float_to_int_unchecked::<f64, i32>(-2147483649.0f64);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on -2147483649f64 which cannot be represented in target type `i32`
@@ -7,7 +7,7 @@ LL |         float_to_int_unchecked::<f64, i32>(-2147483649.0f64);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/float_to_int_64_too_small1.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/float_to_int_64_too_small1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small2.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small2.stderr
index e7d12a18a2a..bc167cd0693 100644
--- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small2.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on -9.2233720368547778E+18f64 which cannot be represented in target type `i64`
-  --> $DIR/float_to_int_64_too_small2.rs:LL:CC
+  --> tests/fail/intrinsics/float_to_int_64_too_small2.rs:LL:CC
    |
 LL |         float_to_int_unchecked::<f64, i64>(-9223372036854777856.0f64);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on -9.2233720368547778E+18f64 which cannot be represented in target type `i64`
@@ -7,7 +7,7 @@ LL |         float_to_int_unchecked::<f64, i64>(-9223372036854777856.0f64);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/float_to_int_64_too_small2.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/float_to_int_64_too_small2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small3.stderr b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small3.stderr
index 3d8366c725b..60c637b02de 100644
--- a/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small3.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/float_to_int_64_too_small3.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `float_to_int_unchecked` intrinsic called on -2.4028236692093845E+38f64 which cannot be represented in target type `i128`
-  --> $DIR/float_to_int_64_too_small3.rs:LL:CC
+  --> tests/fail/intrinsics/float_to_int_64_too_small3.rs:LL:CC
    |
 LL |         float_to_int_unchecked::<f64, i128>(-240282366920938463463374607431768211455.0f64);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `float_to_int_unchecked` intrinsic called on -2.4028236692093845E+38f64 which cannot be represented in target type `i128`
@@ -7,7 +7,7 @@ LL |         float_to_int_unchecked::<f64, i128>(-240282366920938463463374607431
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/float_to_int_64_too_small3.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/float_to_int_64_too_small3.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/intrinsic_target_feature.rs b/src/tools/miri/tests/fail/intrinsics/intrinsic_target_feature.rs
index eb5a16360ff..947af681bb4 100644
--- a/src/tools/miri/tests/fail/intrinsics/intrinsic_target_feature.rs
+++ b/src/tools/miri/tests/fail/intrinsics/intrinsic_target_feature.rs
@@ -2,12 +2,7 @@
 // Any new targets that are added to CI should be ignored here.
 // We cannot use `cfg`-based tricks here since the output would be
 // different for non-x86 targets.
-//@ignore-target-aarch64
-//@ignore-target-arm
-//@ignore-target-avr
-//@ignore-target-s390x
-//@ignore-target-thumbv7em
-//@ignore-target-wasm
+//@only-target: x86_64 i686
 // Explicitly disable SSE4.1 because it is enabled by default on macOS
 //@compile-flags: -C target-feature=-sse4.1
 
diff --git a/src/tools/miri/tests/fail/intrinsics/intrinsic_target_feature.stderr b/src/tools/miri/tests/fail/intrinsics/intrinsic_target_feature.stderr
index 8e83d20854f..a846fc5dec3 100644
--- a/src/tools/miri/tests/fail/intrinsics/intrinsic_target_feature.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/intrinsic_target_feature.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempted to call intrinsic `llvm.x86.sse41.dpps` that requires missing target feature sse4.1
-  --> $DIR/intrinsic_target_feature.rs:LL:CC
+  --> tests/fail/intrinsics/intrinsic_target_feature.rs:LL:CC
    |
 LL |         dpps(_mm_setzero_ps(), _mm_setzero_ps(), 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempted to call intrinsic `llvm.x86.sse41.dpps` that requires missing target feature sse4.1
@@ -7,7 +7,7 @@ LL |         dpps(_mm_setzero_ps(), _mm_setzero_ps(), 0);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/intrinsic_target_feature.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/intrinsic_target_feature.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_data.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_data.stderr
index 6478dcc2507..16708ec275e 100644
--- a/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_data.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_data.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
-  --> $DIR/ptr_metadata_uninit_slice_data.rs:LL:CC
+  --> tests/fail/intrinsics/ptr_metadata_uninit_slice_data.rs:LL:CC
    |
 LL |             RET = PtrMetadata(*p);
    |             ^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
@@ -7,9 +7,9 @@ LL |             RET = PtrMetadata(*p);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `deref_meta` at $DIR/ptr_metadata_uninit_slice_data.rs:LL:CC
+   = note: inside `deref_meta` at tests/fail/intrinsics/ptr_metadata_uninit_slice_data.rs:LL:CC
 note: inside `main`
-  --> $DIR/ptr_metadata_uninit_slice_data.rs:LL:CC
+  --> tests/fail/intrinsics/ptr_metadata_uninit_slice_data.rs:LL:CC
    |
 LL |         let _meta = deref_meta(p.as_ptr().cast());
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_len.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_len.stderr
index 84023cf7937..ed7acfaa1e0 100644
--- a/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_len.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_slice_len.stderr
@@ -1,5 +1,5 @@
 warning: integer-to-pointer cast
-  --> $DIR/ptr_metadata_uninit_slice_len.rs:LL:CC
+  --> tests/fail/intrinsics/ptr_metadata_uninit_slice_len.rs:LL:CC
    |
 LL |         (*p.as_mut_ptr().cast::<[*const i32; 2]>())[0] = 4 as *const i32;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ integer-to-pointer cast
@@ -10,10 +10,10 @@ LL |         (*p.as_mut_ptr().cast::<[*const i32; 2]>())[0] = 4 as *const i32;
    = help: you can then set `MIRIFLAGS=-Zmiri-strict-provenance` to ensure you are not relying on `with_exposed_provenance` semantics
    = help: alternatively, `MIRIFLAGS=-Zmiri-permissive-provenance` disables this warning
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/ptr_metadata_uninit_slice_len.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/ptr_metadata_uninit_slice_len.rs:LL:CC
 
 error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
-  --> $DIR/ptr_metadata_uninit_slice_len.rs:LL:CC
+  --> tests/fail/intrinsics/ptr_metadata_uninit_slice_len.rs:LL:CC
    |
 LL |             RET = PtrMetadata(*p);
    |             ^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
@@ -21,9 +21,9 @@ LL |             RET = PtrMetadata(*p);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `deref_meta` at $DIR/ptr_metadata_uninit_slice_len.rs:LL:CC
+   = note: inside `deref_meta` at tests/fail/intrinsics/ptr_metadata_uninit_slice_len.rs:LL:CC
 note: inside `main`
-  --> $DIR/ptr_metadata_uninit_slice_len.rs:LL:CC
+  --> tests/fail/intrinsics/ptr_metadata_uninit_slice_len.rs:LL:CC
    |
 LL |         let _meta = deref_meta(p.as_ptr().cast());
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_thin.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_thin.stderr
index 0e218de0eeb..4e0b8d9a429 100644
--- a/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_thin.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/ptr_metadata_uninit_thin.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
-  --> $DIR/ptr_metadata_uninit_thin.rs:LL:CC
+  --> tests/fail/intrinsics/ptr_metadata_uninit_thin.rs:LL:CC
    |
 LL |             RET = PtrMetadata(*p);
    |             ^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
@@ -7,9 +7,9 @@ LL |             RET = PtrMetadata(*p);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `deref_meta` at $DIR/ptr_metadata_uninit_thin.rs:LL:CC
+   = note: inside `deref_meta` at tests/fail/intrinsics/ptr_metadata_uninit_thin.rs:LL:CC
 note: inside `main`
-  --> $DIR/ptr_metadata_uninit_thin.rs:LL:CC
+  --> tests/fail/intrinsics/ptr_metadata_uninit_thin.rs:LL:CC
    |
 LL |         let _meta = deref_meta(p.as_ptr());
    |                     ^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_offset_from_different_ints.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_offset_from_different_ints.stderr
index bf36c54ac78..7ef66390fcd 100644
--- a/src/tools/miri/tests/fail/intrinsics/ptr_offset_from_different_ints.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/ptr_offset_from_different_ints.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: out-of-bounds `offset_from` origin: expected a pointer to the end of 1 byte of memory, but got 0xb[noalloc] which is a dangling pointer (it has no provenance)
-  --> $DIR/ptr_offset_from_different_ints.rs:LL:CC
+  --> tests/fail/intrinsics/ptr_offset_from_different_ints.rs:LL:CC
    |
 LL |         let _ = p1.byte_offset_from(p2);
    |                 ^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds `offset_from` origin: expected a pointer to the end of 1 byte of memory, but got 0xb[noalloc] which is a dangling pointer (it has no provenance)
@@ -7,7 +7,7 @@ LL |         let _ = p1.byte_offset_from(p2);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/ptr_offset_from_different_ints.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/ptr_offset_from_different_ints.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_offset_from_unsigned_neg.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_offset_from_unsigned_neg.stderr
index e436f9029d5..a0a8e97e7fa 100644
--- a/src/tools/miri/tests/fail/intrinsics/ptr_offset_from_unsigned_neg.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/ptr_offset_from_unsigned_neg.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `ptr_offset_from_unsigned` called when first pointer has smaller address than second: $ADDR < $ADDR
-  --> $DIR/ptr_offset_from_unsigned_neg.rs:LL:CC
+  --> tests/fail/intrinsics/ptr_offset_from_unsigned_neg.rs:LL:CC
    |
 LL |     let _val = unsafe { ptr1.sub_ptr(ptr2) };
    |                         ^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called when first pointer has smaller address than second: $ADDR < $ADDR
@@ -7,7 +7,7 @@ LL |     let _val = unsafe { ptr1.sub_ptr(ptr2) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/ptr_offset_from_unsigned_neg.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/ptr_offset_from_unsigned_neg.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_offset_int_plus_int.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_offset_int_plus_int.stderr
index 8d37da65061..c87ce321784 100644
--- a/src/tools/miri/tests/fail/intrinsics/ptr_offset_int_plus_int.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/ptr_offset_int_plus_int.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: out-of-bounds pointer arithmetic: expected a pointer to 1 byte of memory, but got 0x1[noalloc] which is a dangling pointer (it has no provenance)
-  --> $DIR/ptr_offset_int_plus_int.rs:LL:CC
+  --> tests/fail/intrinsics/ptr_offset_int_plus_int.rs:LL:CC
    |
 LL |         let _val = (1 as *mut u8).offset(1);
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: expected a pointer to 1 byte of memory, but got 0x1[noalloc] which is a dangling pointer (it has no provenance)
@@ -7,7 +7,7 @@ LL |         let _val = (1 as *mut u8).offset(1);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/ptr_offset_int_plus_int.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/ptr_offset_int_plus_int.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_offset_int_plus_ptr.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_offset_int_plus_ptr.stderr
index 2cd02bee2ca..78239d50137 100644
--- a/src/tools/miri/tests/fail/intrinsics/ptr_offset_int_plus_ptr.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/ptr_offset_int_plus_ptr.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: out-of-bounds pointer arithmetic: expected a pointer to $BYTES bytes of memory, but got 0x1[noalloc] which is a dangling pointer (it has no provenance)
-  --> $DIR/ptr_offset_int_plus_ptr.rs:LL:CC
+  --> tests/fail/intrinsics/ptr_offset_int_plus_ptr.rs:LL:CC
    |
 LL |         let _val = (1 as *mut u8).offset(ptr as isize);
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: expected a pointer to $BYTES bytes of memory, but got 0x1[noalloc] which is a dangling pointer (it has no provenance)
@@ -7,7 +7,7 @@ LL |         let _val = (1 as *mut u8).offset(ptr as isize);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/ptr_offset_int_plus_ptr.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/ptr_offset_int_plus_ptr.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_offset_out_of_bounds.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_offset_out_of_bounds.stderr
index c4548200f05..4f6b45b897b 100644
--- a/src/tools/miri/tests/fail/intrinsics/ptr_offset_out_of_bounds.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/ptr_offset_out_of_bounds.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: out-of-bounds pointer arithmetic: expected a pointer to 5 bytes of memory, but got ALLOC which is only 4 bytes from the end of the allocation
-  --> $DIR/ptr_offset_out_of_bounds.rs:LL:CC
+  --> tests/fail/intrinsics/ptr_offset_out_of_bounds.rs:LL:CC
    |
 LL |     let x = unsafe { x.offset(5) };
    |                      ^^^^^^^^^^^ out-of-bounds pointer arithmetic: expected a pointer to 5 bytes of memory, but got ALLOC which is only 4 bytes from the end of the allocation
@@ -7,12 +7,12 @@ LL |     let x = unsafe { x.offset(5) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/ptr_offset_out_of_bounds.rs:LL:CC
+  --> tests/fail/intrinsics/ptr_offset_out_of_bounds.rs:LL:CC
    |
 LL |     let v = [0i8; 4];
    |         ^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/ptr_offset_out_of_bounds.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/ptr_offset_out_of_bounds.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_offset_out_of_bounds_neg.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_offset_out_of_bounds_neg.stderr
index 8041e1542c6..2dd4c943e86 100644
--- a/src/tools/miri/tests/fail/intrinsics/ptr_offset_out_of_bounds_neg.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/ptr_offset_out_of_bounds_neg.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: out-of-bounds pointer arithmetic: expected a pointer to the end of 1 byte of memory, but got ALLOC which is at the beginning of the allocation
-  --> $DIR/ptr_offset_out_of_bounds_neg.rs:LL:CC
+  --> tests/fail/intrinsics/ptr_offset_out_of_bounds_neg.rs:LL:CC
    |
 LL |     let x = unsafe { x.offset(-1) };
    |                      ^^^^^^^^^^^^ out-of-bounds pointer arithmetic: expected a pointer to the end of 1 byte of memory, but got ALLOC which is at the beginning of the allocation
@@ -7,12 +7,12 @@ LL |     let x = unsafe { x.offset(-1) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/ptr_offset_out_of_bounds_neg.rs:LL:CC
+  --> tests/fail/intrinsics/ptr_offset_out_of_bounds_neg.rs:LL:CC
    |
 LL |     let v = [0i8; 4];
    |         ^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/ptr_offset_out_of_bounds_neg.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/ptr_offset_out_of_bounds_neg.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_offset_overflow.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_offset_overflow.stderr
index ee5aebc6eae..d03c9f870e2 100644
--- a/src/tools/miri/tests/fail/intrinsics/ptr_offset_overflow.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/ptr_offset_overflow.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: out-of-bounds pointer arithmetic: expected a pointer to the end of $BYTES bytes of memory, but got ALLOC which is at the beginning of the allocation
-  --> $DIR/ptr_offset_overflow.rs:LL:CC
+  --> tests/fail/intrinsics/ptr_offset_overflow.rs:LL:CC
    |
 LL |     let x = unsafe { x.offset(isize::MIN) };
    |                      ^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: expected a pointer to the end of $BYTES bytes of memory, but got ALLOC which is at the beginning of the allocation
@@ -7,12 +7,12 @@ LL |     let x = unsafe { x.offset(isize::MIN) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/ptr_offset_overflow.rs:LL:CC
+  --> tests/fail/intrinsics/ptr_offset_overflow.rs:LL:CC
    |
 LL |     let v = [0i8; 4];
    |         ^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/ptr_offset_overflow.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/ptr_offset_overflow.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/ptr_offset_unsigned_overflow.stderr b/src/tools/miri/tests/fail/intrinsics/ptr_offset_unsigned_overflow.stderr
index 43cd80a6d3e..a5f046ec403 100644
--- a/src/tools/miri/tests/fail/intrinsics/ptr_offset_unsigned_overflow.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/ptr_offset_unsigned_overflow.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: overflowing pointer arithmetic: the total offset in bytes does not fit in an `isize`
-  --> $DIR/ptr_offset_unsigned_overflow.rs:LL:CC
+  --> tests/fail/intrinsics/ptr_offset_unsigned_overflow.rs:LL:CC
    |
 LL |     unsafe { x.byte_add(!0).read() };
    |              ^^^^^^^^^^^^^^ overflowing pointer arithmetic: the total offset in bytes does not fit in an `isize`
@@ -7,7 +7,7 @@ LL |     unsafe { x.byte_add(!0).read() };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/ptr_offset_unsigned_overflow.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/ptr_offset_unsigned_overflow.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/rem-by-zero.stderr b/src/tools/miri/tests/fail/intrinsics/rem-by-zero.stderr
index 9b9fe4da139..cb5ddc80dda 100644
--- a/src/tools/miri/tests/fail/intrinsics/rem-by-zero.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/rem-by-zero.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: calculating the remainder with a divisor of zero
-  --> $DIR/rem-by-zero.rs:LL:CC
+  --> tests/fail/intrinsics/rem-by-zero.rs:LL:CC
    |
 LL |         let _n = unchecked_rem(3u32, 0);
    |                  ^^^^^^^^^^^^^^^^^^^^^^ calculating the remainder with a divisor of zero
@@ -7,7 +7,7 @@ LL |         let _n = unchecked_rem(3u32, 0);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/rem-by-zero.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/rem-by-zero.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/simd-div-by-zero.stderr b/src/tools/miri/tests/fail/intrinsics/simd-div-by-zero.stderr
index 44d3749d682..b3579758f8f 100644
--- a/src/tools/miri/tests/fail/intrinsics/simd-div-by-zero.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/simd-div-by-zero.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: dividing by zero
-  --> $DIR/simd-div-by-zero.rs:LL:CC
+  --> tests/fail/intrinsics/simd-div-by-zero.rs:LL:CC
    |
 LL |         simd_div(x, y);
    |         ^^^^^^^^^^^^^^ dividing by zero
@@ -7,7 +7,7 @@ LL |         simd_div(x, y);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/simd-div-by-zero.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/simd-div-by-zero.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/simd-div-overflow.stderr b/src/tools/miri/tests/fail/intrinsics/simd-div-overflow.stderr
index 85058b008ee..1144f8cf706 100644
--- a/src/tools/miri/tests/fail/intrinsics/simd-div-overflow.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/simd-div-overflow.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: overflow in signed division (dividing MIN by -1)
-  --> $DIR/simd-div-overflow.rs:LL:CC
+  --> tests/fail/intrinsics/simd-div-overflow.rs:LL:CC
    |
 LL |         simd_div(x, y);
    |         ^^^^^^^^^^^^^^ overflow in signed division (dividing MIN by -1)
@@ -7,7 +7,7 @@ LL |         simd_div(x, y);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/simd-div-overflow.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/simd-div-overflow.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/simd-extract.stderr b/src/tools/miri/tests/fail/intrinsics/simd-extract.stderr
index dc6b22de492..fdf08e8303f 100644
--- a/src/tools/miri/tests/fail/intrinsics/simd-extract.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/simd-extract.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `simd_extract` index 4 is out-of-bounds of vector with length 4
-  --> $DIR/simd-extract.rs:LL:CC
+  --> tests/fail/intrinsics/simd-extract.rs:LL:CC
    |
 LL |     let _x: i32 = unsafe { std::intrinsics::simd::simd_extract(v, 4) };
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `simd_extract` index 4 is out-of-bounds of vector with length 4
@@ -7,7 +7,7 @@ LL |     let _x: i32 = unsafe { std::intrinsics::simd::simd_extract(v, 4) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/simd-extract.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/simd-extract.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/simd-float-to-int.stderr b/src/tools/miri/tests/fail/intrinsics/simd-float-to-int.stderr
index d75fefe1ded..e34ebd3d7f7 100644
--- a/src/tools/miri/tests/fail/intrinsics/simd-float-to-int.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/simd-float-to-int.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `simd_cast` intrinsic called on 3.40282347E+38f32 which cannot be represented in target type `i32`
-  --> $DIR/simd-float-to-int.rs:LL:CC
+  --> tests/fail/intrinsics/simd-float-to-int.rs:LL:CC
    |
 LL |         let _x: i32x2 = f32x2::from_array([f32::MAX, f32::MIN]).to_int_unchecked();
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `simd_cast` intrinsic called on 3.40282347E+38f32 which cannot be represented in target type `i32`
@@ -7,7 +7,7 @@ LL |         let _x: i32x2 = f32x2::from_array([f32::MAX, f32::MIN]).to_int_unch
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/simd-float-to-int.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/simd-float-to-int.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/simd-gather.stderr b/src/tools/miri/tests/fail/intrinsics/simd-gather.stderr
index bc8d0b041d3..ee1c9009610 100644
--- a/src/tools/miri/tests/fail/intrinsics/simd-gather.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/simd-gather.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: expected a pointer to 1 byte of memory, but got ALLOC+0x9 which is at or beyond the end of the allocation of size 9 bytes
-  --> $DIR/simd-gather.rs:LL:CC
+  --> tests/fail/intrinsics/simd-gather.rs:LL:CC
    |
 LL |         let _result = Simd::gather_select_unchecked(&vec, Mask::splat(true), idxs, Simd::splat(0));
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access failed: expected a pointer to 1 byte of memory, but got ALLOC+0x9 which is at or beyond the end of the allocation of size 9 bytes
@@ -7,7 +7,7 @@ LL |         let _result = Simd::gather_select_unchecked(&vec, Mask::splat(true)
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/simd-gather.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/simd-gather.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/simd-reduce-invalid-bool.stderr b/src/tools/miri/tests/fail/intrinsics/simd-reduce-invalid-bool.stderr
index b6c43d34b9d..db76897faed 100644
--- a/src/tools/miri/tests/fail/intrinsics/simd-reduce-invalid-bool.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/simd-reduce-invalid-bool.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: each element of a SIMD mask must be all-0-bits or all-1-bits
-  --> $DIR/simd-reduce-invalid-bool.rs:LL:CC
+  --> tests/fail/intrinsics/simd-reduce-invalid-bool.rs:LL:CC
    |
 LL |         simd_reduce_any(x);
    |         ^^^^^^^^^^^^^^^^^^ each element of a SIMD mask must be all-0-bits or all-1-bits
@@ -7,7 +7,7 @@ LL |         simd_reduce_any(x);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/simd-reduce-invalid-bool.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/simd-reduce-invalid-bool.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/simd-rem-by-zero.stderr b/src/tools/miri/tests/fail/intrinsics/simd-rem-by-zero.stderr
index d29d22d8aef..ec136a62ff2 100644
--- a/src/tools/miri/tests/fail/intrinsics/simd-rem-by-zero.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/simd-rem-by-zero.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: calculating the remainder with a divisor of zero
-  --> $DIR/simd-rem-by-zero.rs:LL:CC
+  --> tests/fail/intrinsics/simd-rem-by-zero.rs:LL:CC
    |
 LL |         simd_rem(x, y);
    |         ^^^^^^^^^^^^^^ calculating the remainder with a divisor of zero
@@ -7,7 +7,7 @@ LL |         simd_rem(x, y);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/simd-rem-by-zero.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/simd-rem-by-zero.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/simd-scatter.stderr b/src/tools/miri/tests/fail/intrinsics/simd-scatter.stderr
index aae77edcb6b..aaacb94f458 100644
--- a/src/tools/miri/tests/fail/intrinsics/simd-scatter.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/simd-scatter.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: expected a pointer to 1 byte of memory, but got ALLOC+0x9 which is at or beyond the end of the allocation of size 9 bytes
-  --> $DIR/simd-scatter.rs:LL:CC
+  --> tests/fail/intrinsics/simd-scatter.rs:LL:CC
    |
 LL | /         Simd::from_array([-27, 82, -41, 124]).scatter_select_unchecked(
 LL | |
@@ -12,12 +12,12 @@ LL | |         );
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/simd-scatter.rs:LL:CC
+  --> tests/fail/intrinsics/simd-scatter.rs:LL:CC
    |
 LL |         let mut vec: Vec<i8> = vec![10, 11, 12, 13, 14, 15, 16, 17, 18];
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/simd-scatter.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/simd-scatter.rs:LL:CC
    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
diff --git a/src/tools/miri/tests/fail/intrinsics/simd-select-bitmask-invalid.stderr b/src/tools/miri/tests/fail/intrinsics/simd-select-bitmask-invalid.stderr
index 1f978e13bb9..9acb51d8c5f 100644
--- a/src/tools/miri/tests/fail/intrinsics/simd-select-bitmask-invalid.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/simd-select-bitmask-invalid.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: a SIMD bitmask less than 8 bits long must be filled with 0s for the remaining bits
-  --> $DIR/simd-select-bitmask-invalid.rs:LL:CC
+  --> tests/fail/intrinsics/simd-select-bitmask-invalid.rs:LL:CC
    |
 LL |         simd_select_bitmask(0b11111111u8, x, x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ a SIMD bitmask less than 8 bits long must be filled with 0s for the remaining bits
@@ -7,7 +7,7 @@ LL |         simd_select_bitmask(0b11111111u8, x, x);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/simd-select-bitmask-invalid.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/simd-select-bitmask-invalid.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/simd-select-invalid-bool.stderr b/src/tools/miri/tests/fail/intrinsics/simd-select-invalid-bool.stderr
index e0c05474831..52b497046d0 100644
--- a/src/tools/miri/tests/fail/intrinsics/simd-select-invalid-bool.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/simd-select-invalid-bool.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: each element of a SIMD mask must be all-0-bits or all-1-bits
-  --> $DIR/simd-select-invalid-bool.rs:LL:CC
+  --> tests/fail/intrinsics/simd-select-invalid-bool.rs:LL:CC
    |
 LL |         simd_select(x, x, x);
    |         ^^^^^^^^^^^^^^^^^^^^ each element of a SIMD mask must be all-0-bits or all-1-bits
@@ -7,7 +7,7 @@ LL |         simd_select(x, x, x);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/simd-select-invalid-bool.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/simd-select-invalid-bool.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/simd-shl-too-far.stderr b/src/tools/miri/tests/fail/intrinsics/simd-shl-too-far.stderr
index 475067db801..f7dfd0743f1 100644
--- a/src/tools/miri/tests/fail/intrinsics/simd-shl-too-far.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/simd-shl-too-far.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: overflowing shift by 100 in `simd_shl` in lane 0
-  --> $DIR/simd-shl-too-far.rs:LL:CC
+  --> tests/fail/intrinsics/simd-shl-too-far.rs:LL:CC
    |
 LL |         simd_shl(x, y);
    |         ^^^^^^^^^^^^^^ overflowing shift by 100 in `simd_shl` in lane 0
@@ -7,7 +7,7 @@ LL |         simd_shl(x, y);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/simd-shl-too-far.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/simd-shl-too-far.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/simd-shr-too-far.stderr b/src/tools/miri/tests/fail/intrinsics/simd-shr-too-far.stderr
index 0d6307837de..52259635d21 100644
--- a/src/tools/miri/tests/fail/intrinsics/simd-shr-too-far.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/simd-shr-too-far.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: overflowing shift by 40 in `simd_shr` in lane 1
-  --> $DIR/simd-shr-too-far.rs:LL:CC
+  --> tests/fail/intrinsics/simd-shr-too-far.rs:LL:CC
    |
 LL |         simd_shr(x, y);
    |         ^^^^^^^^^^^^^^ overflowing shift by 40 in `simd_shr` in lane 1
@@ -7,7 +7,7 @@ LL |         simd_shr(x, y);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/simd-shr-too-far.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/simd-shr-too-far.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-array.stderr b/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-array.stderr
index 15f01c1c095..20b20412e75 100644
--- a/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-array.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-array.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value at [0]: encountered 0x02, but expected a boolean
-  --> $DIR/typed-swap-invalid-array.rs:LL:CC
+  --> tests/fail/intrinsics/typed-swap-invalid-array.rs:LL:CC
    |
 LL |         typed_swap(a, b);
    |         ^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered 0x02, but expected a boolean
@@ -7,9 +7,9 @@ LL |         typed_swap(a, b);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `invalid_array` at $DIR/typed-swap-invalid-array.rs:LL:CC
+   = note: inside `invalid_array` at tests/fail/intrinsics/typed-swap-invalid-array.rs:LL:CC
 note: inside `main`
-  --> $DIR/typed-swap-invalid-array.rs:LL:CC
+  --> tests/fail/intrinsics/typed-swap-invalid-array.rs:LL:CC
    |
 LL |     invalid_array();
    |     ^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-scalar.stderr b/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-scalar.stderr
index 262ca202f9f..6062465f36a 100644
--- a/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-scalar.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/typed-swap-invalid-scalar.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered 0x02, but expected a boolean
-  --> $DIR/typed-swap-invalid-scalar.rs:LL:CC
+  --> tests/fail/intrinsics/typed-swap-invalid-scalar.rs:LL:CC
    |
 LL |         typed_swap(a, b);
    |         ^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x02, but expected a boolean
@@ -7,9 +7,9 @@ LL |         typed_swap(a, b);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `invalid_scalar` at $DIR/typed-swap-invalid-scalar.rs:LL:CC
+   = note: inside `invalid_scalar` at tests/fail/intrinsics/typed-swap-invalid-scalar.rs:LL:CC
 note: inside `main`
-  --> $DIR/typed-swap-invalid-scalar.rs:LL:CC
+  --> tests/fail/intrinsics/typed-swap-invalid-scalar.rs:LL:CC
    |
 LL |     invalid_scalar();
    |     ^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/intrinsics/unchecked_add1.stderr b/src/tools/miri/tests/fail/intrinsics/unchecked_add1.stderr
index eae9ec7a44d..f6fe453587f 100644
--- a/src/tools/miri/tests/fail/intrinsics/unchecked_add1.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/unchecked_add1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: arithmetic overflow in `unchecked_add`
-  --> $DIR/unchecked_add1.rs:LL:CC
+  --> tests/fail/intrinsics/unchecked_add1.rs:LL:CC
    |
 LL |     let _val = unsafe { 40000u16.unchecked_add(30000) };
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ arithmetic overflow in `unchecked_add`
@@ -7,7 +7,7 @@ LL |     let _val = unsafe { 40000u16.unchecked_add(30000) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unchecked_add1.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/unchecked_add1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/unchecked_add2.stderr b/src/tools/miri/tests/fail/intrinsics/unchecked_add2.stderr
index 6a0dcfcd227..0fd1e8ff91c 100644
--- a/src/tools/miri/tests/fail/intrinsics/unchecked_add2.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/unchecked_add2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: arithmetic overflow in `unchecked_add`
-  --> $DIR/unchecked_add2.rs:LL:CC
+  --> tests/fail/intrinsics/unchecked_add2.rs:LL:CC
    |
 LL |     let _val = unsafe { (-30000i16).unchecked_add(-8000) };
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ arithmetic overflow in `unchecked_add`
@@ -7,7 +7,7 @@ LL |     let _val = unsafe { (-30000i16).unchecked_add(-8000) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unchecked_add2.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/unchecked_add2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/unchecked_div1.stderr b/src/tools/miri/tests/fail/intrinsics/unchecked_div1.stderr
index 9dc4bcaee2f..f7aef4914e2 100644
--- a/src/tools/miri/tests/fail/intrinsics/unchecked_div1.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/unchecked_div1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: overflow in signed division (dividing MIN by -1)
-  --> $DIR/unchecked_div1.rs:LL:CC
+  --> tests/fail/intrinsics/unchecked_div1.rs:LL:CC
    |
 LL |         std::intrinsics::unchecked_div(i16::MIN, -1);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflow in signed division (dividing MIN by -1)
@@ -7,7 +7,7 @@ LL |         std::intrinsics::unchecked_div(i16::MIN, -1);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unchecked_div1.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/unchecked_div1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/unchecked_mul1.stderr b/src/tools/miri/tests/fail/intrinsics/unchecked_mul1.stderr
index e37d9827c8c..ad7bbaebeec 100644
--- a/src/tools/miri/tests/fail/intrinsics/unchecked_mul1.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/unchecked_mul1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: arithmetic overflow in `unchecked_mul`
-  --> $DIR/unchecked_mul1.rs:LL:CC
+  --> tests/fail/intrinsics/unchecked_mul1.rs:LL:CC
    |
 LL |     let _val = unsafe { 300u16.unchecked_mul(250u16) };
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ arithmetic overflow in `unchecked_mul`
@@ -7,7 +7,7 @@ LL |     let _val = unsafe { 300u16.unchecked_mul(250u16) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unchecked_mul1.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/unchecked_mul1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/unchecked_mul2.stderr b/src/tools/miri/tests/fail/intrinsics/unchecked_mul2.stderr
index 949077ce61d..75de5d2338d 100644
--- a/src/tools/miri/tests/fail/intrinsics/unchecked_mul2.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/unchecked_mul2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: arithmetic overflow in `unchecked_mul`
-  --> $DIR/unchecked_mul2.rs:LL:CC
+  --> tests/fail/intrinsics/unchecked_mul2.rs:LL:CC
    |
 LL |     let _val = unsafe { 1_000_000_000i32.unchecked_mul(-4) };
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ arithmetic overflow in `unchecked_mul`
@@ -7,7 +7,7 @@ LL |     let _val = unsafe { 1_000_000_000i32.unchecked_mul(-4) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unchecked_mul2.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/unchecked_mul2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/unchecked_shl.stderr b/src/tools/miri/tests/fail/intrinsics/unchecked_shl.stderr
index f30cf4479e6..fcf6e1aea0c 100644
--- a/src/tools/miri/tests/fail/intrinsics/unchecked_shl.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/unchecked_shl.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: overflowing shift by 8 in `unchecked_shl`
-  --> $DIR/unchecked_shl.rs:LL:CC
+  --> tests/fail/intrinsics/unchecked_shl.rs:LL:CC
    |
 LL |         let _n = 1i8.unchecked_shl(8);
    |                  ^^^^^^^^^^^^^^^^^^^^ overflowing shift by 8 in `unchecked_shl`
@@ -7,7 +7,7 @@ LL |         let _n = 1i8.unchecked_shl(8);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unchecked_shl.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/unchecked_shl.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/unchecked_shl2.stderr b/src/tools/miri/tests/fail/intrinsics/unchecked_shl2.stderr
index a572f34b92c..c38139e4c29 100644
--- a/src/tools/miri/tests/fail/intrinsics/unchecked_shl2.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/unchecked_shl2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: overflowing shift by -1 in `unchecked_shl`
-  --> $DIR/unchecked_shl2.rs:LL:CC
+  --> tests/fail/intrinsics/unchecked_shl2.rs:LL:CC
    |
 LL |         let _n = intrinsics::unchecked_shl(1i8, -1);
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by -1 in `unchecked_shl`
@@ -7,7 +7,7 @@ LL |         let _n = intrinsics::unchecked_shl(1i8, -1);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unchecked_shl2.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/unchecked_shl2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/unchecked_shr.stderr b/src/tools/miri/tests/fail/intrinsics/unchecked_shr.stderr
index 22e0b1a0d9e..e95227fe89f 100644
--- a/src/tools/miri/tests/fail/intrinsics/unchecked_shr.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/unchecked_shr.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: overflowing shift by 64 in `unchecked_shr`
-  --> $DIR/unchecked_shr.rs:LL:CC
+  --> tests/fail/intrinsics/unchecked_shr.rs:LL:CC
    |
 LL |         let _n = 1i64.unchecked_shr(64);
    |                  ^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 64 in `unchecked_shr`
@@ -7,7 +7,7 @@ LL |         let _n = 1i64.unchecked_shr(64);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unchecked_shr.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/unchecked_shr.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/unchecked_sub1.stderr b/src/tools/miri/tests/fail/intrinsics/unchecked_sub1.stderr
index 39bfd8a2384..fdd30186c3c 100644
--- a/src/tools/miri/tests/fail/intrinsics/unchecked_sub1.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/unchecked_sub1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: arithmetic overflow in `unchecked_sub`
-  --> $DIR/unchecked_sub1.rs:LL:CC
+  --> tests/fail/intrinsics/unchecked_sub1.rs:LL:CC
    |
 LL |     let _val = unsafe { 14u32.unchecked_sub(22) };
    |                         ^^^^^^^^^^^^^^^^^^^^^^^ arithmetic overflow in `unchecked_sub`
@@ -7,7 +7,7 @@ LL |     let _val = unsafe { 14u32.unchecked_sub(22) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unchecked_sub1.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/unchecked_sub1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/unchecked_sub2.stderr b/src/tools/miri/tests/fail/intrinsics/unchecked_sub2.stderr
index 604eba99e01..c27bb32c9da 100644
--- a/src/tools/miri/tests/fail/intrinsics/unchecked_sub2.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/unchecked_sub2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: arithmetic overflow in `unchecked_sub`
-  --> $DIR/unchecked_sub2.rs:LL:CC
+  --> tests/fail/intrinsics/unchecked_sub2.rs:LL:CC
    |
 LL |     let _val = unsafe { 30000i16.unchecked_sub(-7000) };
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ arithmetic overflow in `unchecked_sub`
@@ -7,7 +7,7 @@ LL |     let _val = unsafe { 30000i16.unchecked_sub(-7000) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unchecked_sub2.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/unchecked_sub2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.stderr b/src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.stderr
index 67fd60e572e..ffc3a3eae96 100644
--- a/src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.stderr
@@ -17,7 +17,7 @@ LL |     ABORT();
    = note: inside `std::panicking::begin_panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC
    = note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC
 note: inside `main`
-  --> $DIR/uninit_uninhabited_type.rs:LL:CC
+  --> tests/fail/intrinsics/uninit_uninhabited_type.rs:LL:CC
    |
 LL |     let _ = unsafe { std::mem::uninitialized::<!>() };
    | ^
diff --git a/src/tools/miri/tests/fail/intrinsics/write_bytes_overflow.stderr b/src/tools/miri/tests/fail/intrinsics/write_bytes_overflow.stderr
index 326c180fadb..71f53a31992 100644
--- a/src/tools/miri/tests/fail/intrinsics/write_bytes_overflow.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/write_bytes_overflow.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: overflow computing total size of `write_bytes`
-  --> $DIR/write_bytes_overflow.rs:LL:CC
+  --> tests/fail/intrinsics/write_bytes_overflow.rs:LL:CC
    |
 LL |         (&mut y as *mut i32).write_bytes(0u8, 1usize << (mem::size_of::<usize>() * 8 - 1));
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ overflow computing total size of `write_bytes`
@@ -7,7 +7,7 @@ LL |         (&mut y as *mut i32).write_bytes(0u8, 1usize << (mem::size_of::<usi
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/write_bytes_overflow.rs:LL:CC
+   = note: inside `main` at tests/fail/intrinsics/write_bytes_overflow.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/intrinsics/zero_fn_ptr.stderr b/src/tools/miri/tests/fail/intrinsics/zero_fn_ptr.stderr
index f89a1fc4bbb..49cfc473bdf 100644
--- a/src/tools/miri/tests/fail/intrinsics/zero_fn_ptr.stderr
+++ b/src/tools/miri/tests/fail/intrinsics/zero_fn_ptr.stderr
@@ -17,7 +17,7 @@ LL |     ABORT();
    = note: inside `std::panicking::begin_panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC
    = note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC
 note: inside `main`
-  --> $DIR/zero_fn_ptr.rs:LL:CC
+  --> tests/fail/intrinsics/zero_fn_ptr.rs:LL:CC
    |
 LL |     let _ = unsafe { std::mem::zeroed::<fn()>() };
    | ^
diff --git a/src/tools/miri/tests/fail/issue-miri-1112.stderr b/src/tools/miri/tests/fail/issue-miri-1112.stderr
index 7ac65c152e9..ffbbd269216 100644
--- a/src/tools/miri/tests/fail/issue-miri-1112.stderr
+++ b/src/tools/miri/tests/fail/issue-miri-1112.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered $HEX[ALLOC]<TAG>, but expected a vtable pointer
-  --> $DIR/issue-miri-1112.rs:LL:CC
+  --> tests/fail/issue-miri-1112.rs:LL:CC
    |
 LL |         let obj = std::mem::transmute::<FatPointer, *mut FunnyPointer>(obj);
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered $HEX[ALLOC]<TAG>, but expected a vtable pointer
@@ -7,9 +7,9 @@ LL |         let obj = std::mem::transmute::<FatPointer, *mut FunnyPointer>(obj)
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `FunnyPointer::from_data_ptr` at $DIR/issue-miri-1112.rs:LL:CC
+   = note: inside `FunnyPointer::from_data_ptr` at tests/fail/issue-miri-1112.rs:LL:CC
 note: inside `main`
-  --> $DIR/issue-miri-1112.rs:LL:CC
+  --> tests/fail/issue-miri-1112.rs:LL:CC
    |
 LL |         let _raw: &FunnyPointer = FunnyPointer::from_data_ptr(&hello, &meta as *const _);
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/issue-miri-3288-ice-symbolic-alignment-extern-static.stderr b/src/tools/miri/tests/fail/issue-miri-3288-ice-symbolic-alignment-extern-static.stderr
index 4064d7fe4e9..91f90959550 100644
--- a/src/tools/miri/tests/fail/issue-miri-3288-ice-symbolic-alignment-extern-static.stderr
+++ b/src/tools/miri/tests/fail/issue-miri-3288-ice-symbolic-alignment-extern-static.stderr
@@ -1,12 +1,12 @@
 error: unsupported operation: extern static `_dispatch_queue_attr_concurrent` is not supported by Miri
-  --> $DIR/issue-miri-3288-ice-symbolic-alignment-extern-static.rs:LL:CC
+  --> tests/fail/issue-miri-3288-ice-symbolic-alignment-extern-static.rs:LL:CC
    |
 LL |     let _val = *DISPATCH_QUEUE_CONCURRENT;
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^ extern static `_dispatch_queue_attr_concurrent` is not supported by Miri
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/issue-miri-3288-ice-symbolic-alignment-extern-static.rs:LL:CC
+   = note: inside `main` at tests/fail/issue-miri-3288-ice-symbolic-alignment-extern-static.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/layout_cycle.stderr b/src/tools/miri/tests/fail/layout_cycle.stderr
index cc343d6431f..9f53de35239 100644
--- a/src/tools/miri/tests/fail/layout_cycle.stderr
+++ b/src/tools/miri/tests/fail/layout_cycle.stderr
@@ -13,12 +13,12 @@ LL |     intrinsics::size_of::<T>()
    = note: BACKTRACE:
    = note: inside `std::mem::size_of::<S<S<()>>>` at RUSTLIB/core/src/mem/mod.rs:LL:CC
 note: inside `foo::<S<()>>`
-  --> $DIR/layout_cycle.rs:LL:CC
+  --> tests/fail/layout_cycle.rs:LL:CC
    |
 LL |     mem::size_of::<S<T>>()
    |     ^^^^^^^^^^^^^^^^^^^^^^
 note: inside `main`
-  --> $DIR/layout_cycle.rs:LL:CC
+  --> tests/fail/layout_cycle.rs:LL:CC
    |
 LL |     println!("{}", foo::<S<()>>());
    |                    ^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/memleak.stderr b/src/tools/miri/tests/fail/memleak.stderr
index d3032255166..89db0f1eb16 100644
--- a/src/tools/miri/tests/fail/memleak.stderr
+++ b/src/tools/miri/tests/fail/memleak.stderr
@@ -1,11 +1,11 @@
 error: memory leaked: ALLOC (Rust heap, size: 4, align: 4), allocated here:
-  --> $DIR/memleak.rs:LL:CC
+  --> tests/fail/memleak.rs:LL:CC
    |
 LL |     std::mem::forget(Box::new(42));
    |                      ^^^^^^^^^^^^
    |
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/memleak.rs:LL:CC
+   = note: inside `main` at tests/fail/memleak.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/memleak_rc.stderr b/src/tools/miri/tests/fail/memleak_rc.stderr
index 91166384adc..820e10743bc 100644
--- a/src/tools/miri/tests/fail/memleak_rc.stderr
+++ b/src/tools/miri/tests/fail/memleak_rc.stderr
@@ -7,7 +7,7 @@ LL |                 Box::leak(Box::new(RcBox { strong: Cell::new(1), weak: Cell
    = note: BACKTRACE:
    = note: inside `std::rc::Rc::<std::cell::RefCell<std::option::Option<Dummy>>>::new` at RUSTLIB/alloc/src/rc.rs:LL:CC
 note: inside `main`
-  --> $DIR/memleak_rc.rs:LL:CC
+  --> tests/fail/memleak_rc.rs:LL:CC
    |
 LL |     let x = Dummy(Rc::new(RefCell::new(None)));
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/miri_start_wrong_sig.stderr b/src/tools/miri/tests/fail/miri_start_wrong_sig.stderr
index 62171917116..4c60f3be0d2 100644
--- a/src/tools/miri/tests/fail/miri_start_wrong_sig.stderr
+++ b/src/tools/miri/tests/fail/miri_start_wrong_sig.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/miri_start_wrong_sig.rs:LL:CC
+  --> tests/fail/miri_start_wrong_sig.rs:LL:CC
    |
 LL | fn miri_start() -> isize {
    | ^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters
diff --git a/src/tools/miri/tests/fail/modifying_constants.stderr b/src/tools/miri/tests/fail/modifying_constants.stderr
index c1eca7866ad..2d8e4dfd8a5 100644
--- a/src/tools/miri/tests/fail/modifying_constants.stderr
+++ b/src/tools/miri/tests/fail/modifying_constants.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: writing to ALLOC which is read-only
-  --> $DIR/modifying_constants.rs:LL:CC
+  --> tests/fail/modifying_constants.rs:LL:CC
    |
 LL |     *y = 42;
    |     ^^^^^^^ writing to ALLOC which is read-only
@@ -7,7 +7,7 @@ LL |     *y = 42;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/modifying_constants.rs:LL:CC
+   = note: inside `main` at tests/fail/modifying_constants.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/never_match_never.stderr b/src/tools/miri/tests/fail/never_match_never.stderr
index 751894f1985..e59a028b15b 100644
--- a/src/tools/miri/tests/fail/never_match_never.stderr
+++ b/src/tools/miri/tests/fail/never_match_never.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: entering unreachable code
-  --> $DIR/never_match_never.rs:LL:CC
+  --> tests/fail/never_match_never.rs:LL:CC
    |
 LL |     unsafe { match (*ptr).1 {} }
    |                    ^^^^^^^^ entering unreachable code
@@ -7,7 +7,7 @@ LL |     unsafe { match (*ptr).1 {} }
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/never_match_never.rs:LL:CC
+   = note: inside `main` at tests/fail/never_match_never.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/never_say_never.stderr b/src/tools/miri/tests/fail/never_say_never.stderr
index 1720cc893ab..7d2952003b2 100644
--- a/src/tools/miri/tests/fail/never_say_never.stderr
+++ b/src/tools/miri/tests/fail/never_say_never.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: entering unreachable code
-  --> $DIR/never_say_never.rs:LL:CC
+  --> tests/fail/never_say_never.rs:LL:CC
    |
 LL |     f(x)
    |     ^^^^ entering unreachable code
@@ -7,7 +7,7 @@ LL |     f(x)
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/never_say_never.rs:LL:CC
+   = note: inside `main` at tests/fail/never_say_never.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/never_transmute_humans.stderr b/src/tools/miri/tests/fail/never_transmute_humans.stderr
index 6916c935995..a00c244841e 100644
--- a/src/tools/miri/tests/fail/never_transmute_humans.stderr
+++ b/src/tools/miri/tests/fail/never_transmute_humans.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: entering unreachable code
-  --> $DIR/never_transmute_humans.rs:LL:CC
+  --> tests/fail/never_transmute_humans.rs:LL:CC
    |
 LL |         std::mem::transmute::<Human, !>(Human)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ entering unreachable code
@@ -7,7 +7,7 @@ LL |         std::mem::transmute::<Human, !>(Human)
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/never_transmute_humans.rs:LL:CC
+   = note: inside `main` at tests/fail/never_transmute_humans.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/never_transmute_void.stderr b/src/tools/miri/tests/fail/never_transmute_void.stderr
index 4ca306373a1..1906a68bffe 100644
--- a/src/tools/miri/tests/fail/never_transmute_void.stderr
+++ b/src/tools/miri/tests/fail/never_transmute_void.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: entering unreachable code
-  --> $DIR/never_transmute_void.rs:LL:CC
+  --> tests/fail/never_transmute_void.rs:LL:CC
    |
 LL |         match v.0 {}
    |               ^^^ entering unreachable code
@@ -7,9 +7,9 @@ LL |         match v.0 {}
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `m::f` at $DIR/never_transmute_void.rs:LL:CC
+   = note: inside `m::f` at tests/fail/never_transmute_void.rs:LL:CC
 note: inside `main`
-  --> $DIR/never_transmute_void.rs:LL:CC
+  --> tests/fail/never_transmute_void.rs:LL:CC
    |
 LL |     m::f(v);
    |     ^^^^^^^
diff --git a/src/tools/miri/tests/fail/overlapping_assignment.stderr b/src/tools/miri/tests/fail/overlapping_assignment.stderr
index 54e104e3513..0ce2e4a0981 100644
--- a/src/tools/miri/tests/fail/overlapping_assignment.stderr
+++ b/src/tools/miri/tests/fail/overlapping_assignment.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: `copy_nonoverlapping` called on overlapping ranges
-  --> $DIR/overlapping_assignment.rs:LL:CC
+  --> tests/fail/overlapping_assignment.rs:LL:CC
    |
 LL |             *ptr1 = *ptr2;
    |             ^^^^^^^^^^^^^ `copy_nonoverlapping` called on overlapping ranges
@@ -7,9 +7,9 @@ LL |             *ptr1 = *ptr2;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `self_copy` at $DIR/overlapping_assignment.rs:LL:CC
+   = note: inside `self_copy` at tests/fail/overlapping_assignment.rs:LL:CC
 note: inside `main`
-  --> $DIR/overlapping_assignment.rs:LL:CC
+  --> tests/fail/overlapping_assignment.rs:LL:CC
    |
 LL |     self_copy(ptr, ptr);
    |     ^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/panic/bad_unwind.stderr b/src/tools/miri/tests/fail/panic/bad_unwind.stderr
index c08fe5153b1..c152d1a9605 100644
--- a/src/tools/miri/tests/fail/panic/bad_unwind.stderr
+++ b/src/tools/miri/tests/fail/panic/bad_unwind.stderr
@@ -1,9 +1,9 @@
-thread 'main' panicked at $DIR/bad_unwind.rs:LL:CC:
+thread 'main' panicked at tests/fail/panic/bad_unwind.rs:LL:CC:
 explicit panic
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 error: Undefined Behavior: unwinding past a stack frame that does not allow unwinding
-  --> $DIR/bad_unwind.rs:LL:CC
+  --> tests/fail/panic/bad_unwind.rs:LL:CC
    |
 LL |     std::panic::catch_unwind(|| unwind()).unwrap_err();
    |                                 ^^^^^^^^ unwinding past a stack frame that does not allow unwinding
@@ -11,12 +11,12 @@ LL |     std::panic::catch_unwind(|| unwind()).unwrap_err();
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside closure at $DIR/bad_unwind.rs:LL:CC
-   = note: inside `std::panicking::r#try::do_call::<{closure@$DIR/bad_unwind.rs:LL:CC}, ()>` at RUSTLIB/std/src/panicking.rs:LL:CC
-   = note: inside `std::panicking::r#try::<(), {closure@$DIR/bad_unwind.rs:LL:CC}>` at RUSTLIB/std/src/panicking.rs:LL:CC
-   = note: inside `std::panic::catch_unwind::<{closure@$DIR/bad_unwind.rs:LL:CC}, ()>` at RUSTLIB/std/src/panic.rs:LL:CC
+   = note: inside closure at tests/fail/panic/bad_unwind.rs:LL:CC
+   = note: inside `std::panicking::r#try::do_call::<{closure@tests/fail/panic/bad_unwind.rs:LL:CC}, ()>` at RUSTLIB/std/src/panicking.rs:LL:CC
+   = note: inside `std::panicking::r#try::<(), {closure@tests/fail/panic/bad_unwind.rs:LL:CC}>` at RUSTLIB/std/src/panicking.rs:LL:CC
+   = note: inside `std::panic::catch_unwind::<{closure@tests/fail/panic/bad_unwind.rs:LL:CC}, ()>` at RUSTLIB/std/src/panic.rs:LL:CC
 note: inside `main`
-  --> $DIR/bad_unwind.rs:LL:CC
+  --> tests/fail/panic/bad_unwind.rs:LL:CC
    |
 LL |     std::panic::catch_unwind(|| unwind()).unwrap_err();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/panic/double_panic.stderr b/src/tools/miri/tests/fail/panic/double_panic.stderr
index 0395fe418d9..3e00821796e 100644
--- a/src/tools/miri/tests/fail/panic/double_panic.stderr
+++ b/src/tools/miri/tests/fail/panic/double_panic.stderr
@@ -1,8 +1,8 @@
-thread 'main' panicked at $DIR/double_panic.rs:LL:CC:
+thread 'main' panicked at tests/fail/panic/double_panic.rs:LL:CC:
 first
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
-thread 'main' panicked at $DIR/double_panic.rs:LL:CC:
+thread 'main' panicked at tests/fail/panic/double_panic.rs:LL:CC:
 second
 stack backtrace:
 thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
@@ -23,7 +23,7 @@ LL |     ABORT();
    = note: inside `core::panicking::panic_nounwind_nobacktrace` at RUSTLIB/core/src/panicking.rs:LL:CC
    = note: inside `core::panicking::panic_in_cleanup` at RUSTLIB/core/src/panicking.rs:LL:CC
 note: inside `main`
-  --> $DIR/double_panic.rs:LL:CC
+  --> tests/fail/panic/double_panic.rs:LL:CC
    |
 LL | / fn main() {
 LL | |     let _foo = Foo;
diff --git a/src/tools/miri/tests/fail/panic/no_std.stderr b/src/tools/miri/tests/fail/panic/no_std.stderr
index 40f6cf1fc0b..c1cd53e310f 100644
--- a/src/tools/miri/tests/fail/panic/no_std.stderr
+++ b/src/tools/miri/tests/fail/panic/no_std.stderr
@@ -1,15 +1,15 @@
-panicked at $DIR/no_std.rs:LL:CC:
+panicked at tests/fail/panic/no_std.rs:LL:CC:
 blarg I am dead
 error: abnormal termination: the program aborted execution
-  --> $DIR/no_std.rs:LL:CC
+  --> tests/fail/panic/no_std.rs:LL:CC
    |
 LL |     core::intrinsics::abort();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ the program aborted execution
    |
    = note: BACKTRACE:
-   = note: inside `panic_handler` at $DIR/no_std.rs:LL:CC
+   = note: inside `panic_handler` at tests/fail/panic/no_std.rs:LL:CC
 note: inside `start`
-  --> $DIR/no_std.rs:LL:CC
+  --> tests/fail/panic/no_std.rs:LL:CC
    |
 LL |     panic!("blarg I am dead")
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/panic/panic_abort1.stderr b/src/tools/miri/tests/fail/panic/panic_abort1.stderr
index 6c7cac23bec..c5f04d581ca 100644
--- a/src/tools/miri/tests/fail/panic/panic_abort1.stderr
+++ b/src/tools/miri/tests/fail/panic/panic_abort1.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at $DIR/panic_abort1.rs:LL:CC:
+thread 'main' panicked at tests/fail/panic/panic_abort1.rs:LL:CC:
 panicking from libstd
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
@@ -17,7 +17,7 @@ LL |                 ABORT();
    = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
    = note: inside `std::panicking::begin_panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC
 note: inside `main`
-  --> $DIR/panic_abort1.rs:LL:CC
+  --> tests/fail/panic/panic_abort1.rs:LL:CC
    |
 LL |     std::panic!("panicking from libstd");
    | ^
diff --git a/src/tools/miri/tests/fail/panic/panic_abort2.stderr b/src/tools/miri/tests/fail/panic/panic_abort2.stderr
index 1eda5449d1b..535cddfd4d4 100644
--- a/src/tools/miri/tests/fail/panic/panic_abort2.stderr
+++ b/src/tools/miri/tests/fail/panic/panic_abort2.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at $DIR/panic_abort2.rs:LL:CC:
+thread 'main' panicked at tests/fail/panic/panic_abort2.rs:LL:CC:
 42-panicking from libstd
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
@@ -17,7 +17,7 @@ LL |                 ABORT();
    = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
    = note: inside `std::panicking::begin_panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC
 note: inside `main`
-  --> $DIR/panic_abort2.rs:LL:CC
+  --> tests/fail/panic/panic_abort2.rs:LL:CC
    |
 LL |     std::panic!("{}-panicking from libstd", 42);
    | ^
diff --git a/src/tools/miri/tests/fail/panic/panic_abort3.stderr b/src/tools/miri/tests/fail/panic/panic_abort3.stderr
index 5c7c5e17bee..e74cf342e3f 100644
--- a/src/tools/miri/tests/fail/panic/panic_abort3.stderr
+++ b/src/tools/miri/tests/fail/panic/panic_abort3.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at $DIR/panic_abort3.rs:LL:CC:
+thread 'main' panicked at tests/fail/panic/panic_abort3.rs:LL:CC:
 panicking from libcore
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
@@ -17,7 +17,7 @@ LL |                 ABORT();
    = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
    = note: inside `std::panicking::begin_panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC
 note: inside `main`
-  --> $DIR/panic_abort3.rs:LL:CC
+  --> tests/fail/panic/panic_abort3.rs:LL:CC
    |
 LL |     core::panic!("panicking from libcore");
    | ^
diff --git a/src/tools/miri/tests/fail/panic/panic_abort4.stderr b/src/tools/miri/tests/fail/panic/panic_abort4.stderr
index c8104f570f6..3983d169bdd 100644
--- a/src/tools/miri/tests/fail/panic/panic_abort4.stderr
+++ b/src/tools/miri/tests/fail/panic/panic_abort4.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at $DIR/panic_abort4.rs:LL:CC:
+thread 'main' panicked at tests/fail/panic/panic_abort4.rs:LL:CC:
 42-panicking from libcore
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
@@ -17,7 +17,7 @@ LL |                 ABORT();
    = note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
    = note: inside `std::panicking::begin_panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC
 note: inside `main`
-  --> $DIR/panic_abort4.rs:LL:CC
+  --> tests/fail/panic/panic_abort4.rs:LL:CC
    |
 LL |     core::panic!("{}-panicking from libcore", 42);
    | ^
diff --git a/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr b/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr
index 778061490f0..d93062b4bdc 100644
--- a/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr
+++ b/src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr
@@ -1,4 +1,4 @@
-thread $NAME panicked at $DIR/tls_macro_const_drop_panic.rs:LL:CC:
+thread $NAME panicked at tests/fail/panic/tls_macro_const_drop_panic.rs:LL:CC:
 ow
 fatal runtime error: thread local panicked on drop
 error: abnormal termination: the program aborted execution
diff --git a/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr b/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr
index 367e2ee1f0b..c0a2a30dbe1 100644
--- a/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr
+++ b/src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr
@@ -1,4 +1,4 @@
-thread $NAME panicked at $DIR/tls_macro_drop_panic.rs:LL:CC:
+thread $NAME panicked at tests/fail/panic/tls_macro_drop_panic.rs:LL:CC:
 ow
 fatal runtime error: thread local panicked on drop
 error: abnormal termination: the program aborted execution
diff --git a/src/tools/miri/tests/fail/panic/unwind_panic_abort.stderr b/src/tools/miri/tests/fail/panic/unwind_panic_abort.stderr
index 26afe8830cf..7291f5bce8d 100644
--- a/src/tools/miri/tests/fail/panic/unwind_panic_abort.stderr
+++ b/src/tools/miri/tests/fail/panic/unwind_panic_abort.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: unwinding past a stack frame that does not allow unwinding
-  --> $DIR/unwind_panic_abort.rs:LL:CC
+  --> tests/fail/panic/unwind_panic_abort.rs:LL:CC
    |
 LL |         miri_start_unwind(&mut 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^ unwinding past a stack frame that does not allow unwinding
@@ -7,7 +7,7 @@ LL |         miri_start_unwind(&mut 0);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unwind_panic_abort.rs:LL:CC
+   = note: inside `main` at tests/fail/panic/unwind_panic_abort.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance0.stderr b/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance0.stderr
index fc012af3ad8..24a8d787407 100644
--- a/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance0.stderr
+++ b/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance0.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered a dangling reference ($HEX[noalloc] has no provenance)
-  --> $DIR/int_copy_looses_provenance0.rs:LL:CC
+  --> tests/fail/provenance/int_copy_looses_provenance0.rs:LL:CC
    |
 LL |     let _val = unsafe { *ptr.read() };
    |                          ^^^^^^^^^^ constructing invalid value: encountered a dangling reference ($HEX[noalloc] has no provenance)
@@ -7,7 +7,7 @@ LL |     let _val = unsafe { *ptr.read() };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/int_copy_looses_provenance0.rs:LL:CC
+   = note: inside `main` at tests/fail/provenance/int_copy_looses_provenance0.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance1.stderr b/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance1.stderr
index 375262655d0..14855a723b4 100644
--- a/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance1.stderr
+++ b/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered a dangling reference ($HEX[noalloc] has no provenance)
-  --> $DIR/int_copy_looses_provenance1.rs:LL:CC
+  --> tests/fail/provenance/int_copy_looses_provenance1.rs:LL:CC
    |
 LL |     let _val = unsafe { *ptr.read() };
    |                          ^^^^^^^^^^ constructing invalid value: encountered a dangling reference ($HEX[noalloc] has no provenance)
@@ -7,7 +7,7 @@ LL |     let _val = unsafe { *ptr.read() };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/int_copy_looses_provenance1.rs:LL:CC
+   = note: inside `main` at tests/fail/provenance/int_copy_looses_provenance1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance2.stderr b/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance2.stderr
index 8402c7b5e13..2d5b9783098 100644
--- a/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance2.stderr
+++ b/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered a dangling reference ($HEX[noalloc] has no provenance)
-  --> $DIR/int_copy_looses_provenance2.rs:LL:CC
+  --> tests/fail/provenance/int_copy_looses_provenance2.rs:LL:CC
    |
 LL |     let _val = unsafe { *ptr.read() };
    |                          ^^^^^^^^^^ constructing invalid value: encountered a dangling reference ($HEX[noalloc] has no provenance)
@@ -7,7 +7,7 @@ LL |     let _val = unsafe { *ptr.read() };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/int_copy_looses_provenance2.rs:LL:CC
+   = note: inside `main` at tests/fail/provenance/int_copy_looses_provenance2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance3.stderr b/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance3.stderr
index b50e23da96a..62e3bd2e954 100644
--- a/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance3.stderr
+++ b/src/tools/miri/tests/fail/provenance/int_copy_looses_provenance3.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance)
-  --> $DIR/int_copy_looses_provenance3.rs:LL:CC
+  --> tests/fail/provenance/int_copy_looses_provenance3.rs:LL:CC
    |
 LL |     let _val = unsafe { *ptr };
    |                         ^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance)
@@ -7,7 +7,7 @@ LL |     let _val = unsafe { *ptr };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/int_copy_looses_provenance3.rs:LL:CC
+   = note: inside `main` at tests/fail/provenance/int_copy_looses_provenance3.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/provenance/pointer_partial_overwrite.stderr b/src/tools/miri/tests/fail/provenance/pointer_partial_overwrite.stderr
index 1ca35be8cb2..6bc92fffd5a 100644
--- a/src/tools/miri/tests/fail/provenance/pointer_partial_overwrite.stderr
+++ b/src/tools/miri/tests/fail/provenance/pointer_partial_overwrite.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance)
-  --> $DIR/pointer_partial_overwrite.rs:LL:CC
+  --> tests/fail/provenance/pointer_partial_overwrite.rs:LL:CC
    |
 LL |     let x = *p;
    |             ^^ memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance)
@@ -7,7 +7,7 @@ LL |     let x = *p;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/pointer_partial_overwrite.rs:LL:CC
+   = note: inside `main` at tests/fail/provenance/pointer_partial_overwrite.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/provenance/provenance_transmute.stderr b/src/tools/miri/tests/fail/provenance/provenance_transmute.stderr
index 8a1d39effbd..7403f4382de 100644
--- a/src/tools/miri/tests/fail/provenance/provenance_transmute.stderr
+++ b/src/tools/miri/tests/fail/provenance/provenance_transmute.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: expected a pointer to 1 byte of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance)
-  --> $DIR/provenance_transmute.rs:LL:CC
+  --> tests/fail/provenance/provenance_transmute.rs:LL:CC
    |
 LL |         let _val = *left_ptr;
    |                    ^^^^^^^^^ memory access failed: expected a pointer to 1 byte of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance)
@@ -7,9 +7,9 @@ LL |         let _val = *left_ptr;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `deref` at $DIR/provenance_transmute.rs:LL:CC
+   = note: inside `deref` at tests/fail/provenance/provenance_transmute.rs:LL:CC
 note: inside `main`
-  --> $DIR/provenance_transmute.rs:LL:CC
+  --> tests/fail/provenance/provenance_transmute.rs:LL:CC
    |
 LL |         deref(ptr1, ptr2.with_addr(ptr1.addr()));
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/provenance/ptr_copy_loses_partial_provenance0.stderr b/src/tools/miri/tests/fail/provenance/ptr_copy_loses_partial_provenance0.stderr
index ed38572a5f3..5ed83951c60 100644
--- a/src/tools/miri/tests/fail/provenance/ptr_copy_loses_partial_provenance0.stderr
+++ b/src/tools/miri/tests/fail/provenance/ptr_copy_loses_partial_provenance0.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance)
-  --> $DIR/ptr_copy_loses_partial_provenance0.rs:LL:CC
+  --> tests/fail/provenance/ptr_copy_loses_partial_provenance0.rs:LL:CC
    |
 LL |         let _val = *ptr;
    |                    ^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance)
@@ -7,7 +7,7 @@ LL |         let _val = *ptr;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/ptr_copy_loses_partial_provenance0.rs:LL:CC
+   = note: inside `main` at tests/fail/provenance/ptr_copy_loses_partial_provenance0.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/provenance/ptr_copy_loses_partial_provenance1.stderr b/src/tools/miri/tests/fail/provenance/ptr_copy_loses_partial_provenance1.stderr
index 2e11687175a..3675653cbe7 100644
--- a/src/tools/miri/tests/fail/provenance/ptr_copy_loses_partial_provenance1.stderr
+++ b/src/tools/miri/tests/fail/provenance/ptr_copy_loses_partial_provenance1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance)
-  --> $DIR/ptr_copy_loses_partial_provenance1.rs:LL:CC
+  --> tests/fail/provenance/ptr_copy_loses_partial_provenance1.rs:LL:CC
    |
 LL |         let _val = *ptr;
    |                    ^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance)
@@ -7,7 +7,7 @@ LL |         let _val = *ptr;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/ptr_copy_loses_partial_provenance1.rs:LL:CC
+   = note: inside `main` at tests/fail/provenance/ptr_copy_loses_partial_provenance1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/provenance/ptr_int_unexposed.stderr b/src/tools/miri/tests/fail/provenance/ptr_int_unexposed.stderr
index e21872244f6..1b6518612ef 100644
--- a/src/tools/miri/tests/fail/provenance/ptr_int_unexposed.stderr
+++ b/src/tools/miri/tests/fail/provenance/ptr_int_unexposed.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance)
-  --> $DIR/ptr_int_unexposed.rs:LL:CC
+  --> tests/fail/provenance/ptr_int_unexposed.rs:LL:CC
    |
 LL |     assert_eq!(unsafe { *ptr }, 3);
    |                         ^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance)
@@ -7,7 +7,7 @@ LL |     assert_eq!(unsafe { *ptr }, 3);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/ptr_int_unexposed.rs:LL:CC
+   = note: inside `main` at tests/fail/provenance/ptr_int_unexposed.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/provenance/ptr_invalid.stderr b/src/tools/miri/tests/fail/provenance/ptr_invalid.stderr
index bd0a9eb0d29..84347ec7a11 100644
--- a/src/tools/miri/tests/fail/provenance/ptr_invalid.stderr
+++ b/src/tools/miri/tests/fail/provenance/ptr_invalid.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance)
-  --> $DIR/ptr_invalid.rs:LL:CC
+  --> tests/fail/provenance/ptr_invalid.rs:LL:CC
    |
 LL |     let _val = unsafe { *xptr_invalid };
    |                         ^^^^^^^^^^^^^ memory access failed: expected a pointer to 4 bytes of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance)
@@ -7,7 +7,7 @@ LL |     let _val = unsafe { *xptr_invalid };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/ptr_invalid.rs:LL:CC
+   = note: inside `main` at tests/fail/provenance/ptr_invalid.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/provenance/ptr_invalid_offset.stderr b/src/tools/miri/tests/fail/provenance/ptr_invalid_offset.stderr
index 35e5c08300f..3910bc4df4b 100644
--- a/src/tools/miri/tests/fail/provenance/ptr_invalid_offset.stderr
+++ b/src/tools/miri/tests/fail/provenance/ptr_invalid_offset.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: out-of-bounds pointer arithmetic: expected a pointer to 1 byte of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance)
-  --> $DIR/ptr_invalid_offset.rs:LL:CC
+  --> tests/fail/provenance/ptr_invalid_offset.rs:LL:CC
    |
 LL |     let _ = unsafe { roundtrip.offset(1) };
    |                      ^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer arithmetic: expected a pointer to 1 byte of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance)
@@ -7,7 +7,7 @@ LL |     let _ = unsafe { roundtrip.offset(1) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/ptr_invalid_offset.rs:LL:CC
+   = note: inside `main` at tests/fail/provenance/ptr_invalid_offset.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/provenance/strict_provenance_cast.stderr b/src/tools/miri/tests/fail/provenance/strict_provenance_cast.stderr
index 8c61b66ac46..ab7d8db1a31 100644
--- a/src/tools/miri/tests/fail/provenance/strict_provenance_cast.stderr
+++ b/src/tools/miri/tests/fail/provenance/strict_provenance_cast.stderr
@@ -1,12 +1,12 @@
 error: unsupported operation: integer-to-pointer casts and `ptr::with_exposed_provenance` are not supported with `-Zmiri-strict-provenance`
-  --> $DIR/strict_provenance_cast.rs:LL:CC
+  --> tests/fail/provenance/strict_provenance_cast.rs:LL:CC
    |
 LL |     let _ptr = std::ptr::with_exposed_provenance::<i32>(addr);
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ integer-to-pointer casts and `ptr::with_exposed_provenance` are not supported with `-Zmiri-strict-provenance`
    |
    = help: use Strict Provenance APIs (https://doc.rust-lang.org/nightly/std/ptr/index.html#strict-provenance, https://crates.io/crates/sptr) instead
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/strict_provenance_cast.rs:LL:CC
+   = note: inside `main` at tests/fail/provenance/strict_provenance_cast.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/rc_as_ptr.stderr b/src/tools/miri/tests/fail/rc_as_ptr.stderr
index 83d85f8adff..0fcb0faf497 100644
--- a/src/tools/miri/tests/fail/rc_as_ptr.stderr
+++ b/src/tools/miri/tests/fail/rc_as_ptr.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: out-of-bounds pointer use: ALLOC has been freed, so this pointer is dangling
-  --> $DIR/rc_as_ptr.rs:LL:CC
+  --> tests/fail/rc_as_ptr.rs:LL:CC
    |
 LL |     assert_eq!(42, **unsafe { &*Weak::as_ptr(&weak) });
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: ALLOC has been freed, so this pointer is dangling
@@ -7,12 +7,12 @@ LL |     assert_eq!(42, **unsafe { &*Weak::as_ptr(&weak) });
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
 help: ALLOC was allocated here:
-  --> $DIR/rc_as_ptr.rs:LL:CC
+  --> tests/fail/rc_as_ptr.rs:LL:CC
    |
 LL |     let strong = Rc::new(Box::new(42));
    |                          ^^^^^^^^^^^^
 help: ALLOC was deallocated here:
-  --> $DIR/rc_as_ptr.rs:LL:CC
+  --> tests/fail/rc_as_ptr.rs:LL:CC
    |
 LL |     drop(strong);
    |     ^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/reading_half_a_pointer.stderr b/src/tools/miri/tests/fail/reading_half_a_pointer.stderr
index cba8a9f8439..92179644169 100644
--- a/src/tools/miri/tests/fail/reading_half_a_pointer.stderr
+++ b/src/tools/miri/tests/fail/reading_half_a_pointer.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: expected a pointer to 1 byte of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance)
-  --> $DIR/reading_half_a_pointer.rs:LL:CC
+  --> tests/fail/reading_half_a_pointer.rs:LL:CC
    |
 LL |         let _val = *x;
    |                    ^^ memory access failed: expected a pointer to 1 byte of memory, but got $HEX[noalloc] which is a dangling pointer (it has no provenance)
@@ -7,7 +7,7 @@ LL |         let _val = *x;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/reading_half_a_pointer.rs:LL:CC
+   = note: inside `main` at tests/fail/reading_half_a_pointer.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/rustc-error.stderr b/src/tools/miri/tests/fail/rustc-error.stderr
index 3f911c172d4..31d9946c411 100644
--- a/src/tools/miri/tests/fail/rustc-error.stderr
+++ b/src/tools/miri/tests/fail/rustc-error.stderr
@@ -1,5 +1,5 @@
 error[E0423]: expected function, found macro `println`
-  --> $DIR/rustc-error.rs:LL:CC
+  --> tests/fail/rustc-error.rs:LL:CC
    |
 LL |     println("Hello, world!");
    |     ^^^^^^^ not a function
diff --git a/src/tools/miri/tests/fail/rustc-error2.stderr b/src/tools/miri/tests/fail/rustc-error2.stderr
index de2861a019c..cfbf305d3bb 100644
--- a/src/tools/miri/tests/fail/rustc-error2.stderr
+++ b/src/tools/miri/tests/fail/rustc-error2.stderr
@@ -1,5 +1,5 @@
 error[E0433]: failed to resolve: use of undeclared crate or module `assert_mem_uninitialized_valid`
-  --> $DIR/rustc-error2.rs:LL:CC
+  --> tests/fail/rustc-error2.rs:LL:CC
    |
 LL |     fn deref(&self) -> &assert_mem_uninitialized_valid::Target {
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of undeclared crate or module `assert_mem_uninitialized_valid`
diff --git a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-decl.stderr b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-decl.stderr
index 159a02f2c03..346cc77df1b 100644
--- a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-decl.stderr
+++ b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-decl.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: bad declaration of miri_resolve_frame - should return a struct with 5 fields
-  --> $DIR/bad-backtrace-decl.rs:LL:CC
+  --> tests/fail/shims/backtrace/bad-backtrace-decl.rs:LL:CC
    |
 LL | ...   miri_resolve_frame(*frame, 0);
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad declaration of miri_resolve_frame - should return a struct with 5 fields
@@ -7,7 +7,7 @@ LL | ...   miri_resolve_frame(*frame, 0);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/bad-backtrace-decl.rs:LL:CC
+   = note: inside `main` at tests/fail/shims/backtrace/bad-backtrace-decl.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-flags.stderr b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-flags.stderr
index 504485e3b3a..a8d531c5123 100644
--- a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-flags.stderr
+++ b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-flags.stderr
@@ -1,12 +1,12 @@
 error: unsupported operation: unknown `miri_get_backtrace` flags 2
-  --> $DIR/bad-backtrace-flags.rs:LL:CC
+  --> tests/fail/shims/backtrace/bad-backtrace-flags.rs:LL:CC
    |
 LL |         miri_get_backtrace(2, std::ptr::null_mut());
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unknown `miri_get_backtrace` flags 2
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/bad-backtrace-flags.rs:LL:CC
+   = note: inside `main` at tests/fail/shims/backtrace/bad-backtrace-flags.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-ptr.stderr b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-ptr.stderr
index 523c935762f..7ae9558fad7 100644
--- a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-ptr.stderr
+++ b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-ptr.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: out-of-bounds pointer use: expected a pointer to some allocation, but got a null pointer
-  --> $DIR/bad-backtrace-ptr.rs:LL:CC
+  --> tests/fail/shims/backtrace/bad-backtrace-ptr.rs:LL:CC
    |
 LL |         miri_resolve_frame(std::ptr::null_mut(), 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: expected a pointer to some allocation, but got a null pointer
@@ -7,7 +7,7 @@ LL |         miri_resolve_frame(std::ptr::null_mut(), 0);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/bad-backtrace-ptr.rs:LL:CC
+   = note: inside `main` at tests/fail/shims/backtrace/bad-backtrace-ptr.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-resolve-flags.stderr b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-resolve-flags.stderr
index c1f0ce3d1a8..d79ae1ec414 100644
--- a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-resolve-flags.stderr
+++ b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-resolve-flags.stderr
@@ -1,12 +1,12 @@
 error: unsupported operation: unknown `miri_resolve_frame` flags 2
-  --> $DIR/bad-backtrace-resolve-flags.rs:LL:CC
+  --> tests/fail/shims/backtrace/bad-backtrace-resolve-flags.rs:LL:CC
    |
 LL |         miri_resolve_frame(buf[0], 2);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unknown `miri_resolve_frame` flags 2
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/bad-backtrace-resolve-flags.rs:LL:CC
+   = note: inside `main` at tests/fail/shims/backtrace/bad-backtrace-resolve-flags.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-resolve-names-flags.stderr b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-resolve-names-flags.stderr
index fc270593e63..ff3176a789b 100644
--- a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-resolve-names-flags.stderr
+++ b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-resolve-names-flags.stderr
@@ -1,12 +1,12 @@
 error: unsupported operation: unknown `miri_resolve_frame_names` flags 2
-  --> $DIR/bad-backtrace-resolve-names-flags.rs:LL:CC
+  --> tests/fail/shims/backtrace/bad-backtrace-resolve-names-flags.rs:LL:CC
    |
 LL | ...   miri_resolve_frame_names(buf[0], 2, std::ptr::null_mut(), std::ptr::null_mut());
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unknown `miri_resolve_frame_names` flags 2
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/bad-backtrace-resolve-names-flags.rs:LL:CC
+   = note: inside `main` at tests/fail/shims/backtrace/bad-backtrace-resolve-names-flags.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-size-flags.stderr b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-size-flags.stderr
index 2d70733334d..da287e564e3 100644
--- a/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-size-flags.stderr
+++ b/src/tools/miri/tests/fail/shims/backtrace/bad-backtrace-size-flags.stderr
@@ -1,12 +1,12 @@
 error: unsupported operation: unknown `miri_backtrace_size` flags 2
-  --> $DIR/bad-backtrace-size-flags.rs:LL:CC
+  --> tests/fail/shims/backtrace/bad-backtrace-size-flags.rs:LL:CC
    |
 LL |         miri_backtrace_size(2);
    |         ^^^^^^^^^^^^^^^^^^^^^^ unknown `miri_backtrace_size` flags 2
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/bad-backtrace-size-flags.rs:LL:CC
+   = note: inside `main` at tests/fail/shims/backtrace/bad-backtrace-size-flags.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/shims/fs/isolated_file.rs b/src/tools/miri/tests/fail/shims/fs/isolated_file.rs
index 2f27e95297b..e81f0ff4260 100644
--- a/src/tools/miri/tests/fail/shims/fs/isolated_file.rs
+++ b/src/tools/miri/tests/fail/shims/fs/isolated_file.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: File handling is not implemented yet
+//@ignore-target: windows # File handling is not implemented yet
 //@error-in-other-file: `open` not available when isolation is enabled
 
 fn main() {
diff --git a/src/tools/miri/tests/fail/shims/fs/isolated_file.stderr b/src/tools/miri/tests/fail/shims/fs/isolated_file.stderr
index ec956f83348..e611d6e28f8 100644
--- a/src/tools/miri/tests/fail/shims/fs/isolated_file.stderr
+++ b/src/tools/miri/tests/fail/shims/fs/isolated_file.stderr
@@ -19,7 +19,7 @@ LL |         let fd = cvt_r(|| unsafe { open64(path.as_ptr(), flags, opts.mode a
    = note: inside `std::fs::OpenOptions::open::<&std::path::Path>` at RUSTLIB/std/src/fs.rs:LL:CC
    = note: inside `std::fs::File::open::<&str>` at RUSTLIB/std/src/fs.rs:LL:CC
 note: inside `main`
-  --> $DIR/isolated_file.rs:LL:CC
+  --> tests/fail/shims/fs/isolated_file.rs:LL:CC
    |
 LL |     let _file = std::fs::File::open("file.txt").unwrap();
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/shims/shim_arg_size.stderr b/src/tools/miri/tests/fail/shims/shim_arg_size.stderr
index b40d02ac345..e17fe9019ff 100644
--- a/src/tools/miri/tests/fail/shims/shim_arg_size.stderr
+++ b/src/tools/miri/tests/fail/shims/shim_arg_size.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: scalar size mismatch: expected 4 bytes but got 1 bytes instead
-  --> $DIR/shim_arg_size.rs:LL:CC
+  --> tests/fail/shims/shim_arg_size.rs:LL:CC
    |
 LL |         memchr(std::ptr::null(), 0, 0);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ scalar size mismatch: expected 4 bytes but got 1 bytes instead
@@ -7,7 +7,7 @@ LL |         memchr(std::ptr::null(), 0, 0);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/shim_arg_size.rs:LL:CC
+   = note: inside `main` at tests/fail/shims/shim_arg_size.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/should-pass/cpp20_rwc_syncs.stderr b/src/tools/miri/tests/fail/should-pass/cpp20_rwc_syncs.stderr
index 966279723c4..5185845568e 100644
--- a/src/tools/miri/tests/fail/should-pass/cpp20_rwc_syncs.stderr
+++ b/src/tools/miri/tests/fail/should-pass/cpp20_rwc_syncs.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: entering unreachable code
-  --> $DIR/cpp20_rwc_syncs.rs:LL:CC
+  --> tests/fail/should-pass/cpp20_rwc_syncs.rs:LL:CC
    |
 LL |             std::hint::unreachable_unchecked();
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ entering unreachable code
@@ -7,9 +7,9 @@ LL |             std::hint::unreachable_unchecked();
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `test_cpp20_rwc_syncs` at $DIR/cpp20_rwc_syncs.rs:LL:CC
+   = note: inside `test_cpp20_rwc_syncs` at tests/fail/should-pass/cpp20_rwc_syncs.rs:LL:CC
 note: inside `main`
-  --> $DIR/cpp20_rwc_syncs.rs:LL:CC
+  --> tests/fail/should-pass/cpp20_rwc_syncs.rs:LL:CC
    |
 LL |         test_cpp20_rwc_syncs();
    |         ^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/stacked_borrows/deallocate_against_protector1.stderr b/src/tools/miri/tests/fail/stacked_borrows/deallocate_against_protector1.stderr
index 31a6722ea0c..f4cfa49c156 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/deallocate_against_protector1.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/deallocate_against_protector1.stderr
@@ -11,18 +11,18 @@ LL |                 self.1.deallocate(From::from(ptr.cast()), layout);
    = note: inside `std::ptr::drop_in_place::<std::boxed::Box<i32>> - shim(Some(std::boxed::Box<i32>))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC
    = note: inside `std::mem::drop::<std::boxed::Box<i32>>` at RUSTLIB/core/src/mem/mod.rs:LL:CC
 note: inside closure
-  --> $DIR/deallocate_against_protector1.rs:LL:CC
+  --> tests/fail/stacked_borrows/deallocate_against_protector1.rs:LL:CC
    |
 LL |         drop(unsafe { Box::from_raw(raw) });
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: inside `<{closure@$DIR/deallocate_against_protector1.rs:LL:CC} as std::ops::FnOnce<(&mut i32,)>>::call_once - shim` at RUSTLIB/core/src/ops/function.rs:LL:CC
+   = note: inside `<{closure@tests/fail/stacked_borrows/deallocate_against_protector1.rs:LL:CC} as std::ops::FnOnce<(&mut i32,)>>::call_once - shim` at RUSTLIB/core/src/ops/function.rs:LL:CC
 note: inside `inner`
-  --> $DIR/deallocate_against_protector1.rs:LL:CC
+  --> tests/fail/stacked_borrows/deallocate_against_protector1.rs:LL:CC
    |
 LL |     f(x)
    |     ^^^^
 note: inside `main`
-  --> $DIR/deallocate_against_protector1.rs:LL:CC
+  --> tests/fail/stacked_borrows/deallocate_against_protector1.rs:LL:CC
    |
 LL | /     inner(Box::leak(Box::new(0)), |x| {
 LL | |         let raw = x as *mut _;
diff --git a/src/tools/miri/tests/fail/stacked_borrows/disable_mut_does_not_merge_srw.stderr b/src/tools/miri/tests/fail/stacked_borrows/disable_mut_does_not_merge_srw.stderr
index aa26a003f22..2d0209d1a2a 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/disable_mut_does_not_merge_srw.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/disable_mut_does_not_merge_srw.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a read access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/disable_mut_does_not_merge_srw.rs:LL:CC
+  --> tests/fail/stacked_borrows/disable_mut_does_not_merge_srw.rs:LL:CC
    |
 LL |         let _val = *raw;
    |                    ^^^^
@@ -10,17 +10,17 @@ LL |         let _val = *raw;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x4]
-  --> $DIR/disable_mut_does_not_merge_srw.rs:LL:CC
+  --> tests/fail/stacked_borrows/disable_mut_does_not_merge_srw.rs:LL:CC
    |
 LL |             mutref as *mut i32
    |             ^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a write access
-  --> $DIR/disable_mut_does_not_merge_srw.rs:LL:CC
+  --> tests/fail/stacked_borrows/disable_mut_does_not_merge_srw.rs:LL:CC
    |
 LL |         *base = 1;
    |         ^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/disable_mut_does_not_merge_srw.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/disable_mut_does_not_merge_srw.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_protector.stderr b/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_protector.stderr
index 5147bcd458c..f107ea2023d 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_protector.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_protector.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: not granting access to tag <TAG> because that would remove [Unique for <TAG>] which is strongly protected
-  --> $DIR/drop_in_place_protector.rs:LL:CC
+  --> tests/fail/stacked_borrows/drop_in_place_protector.rs:LL:CC
    |
 LL |             let _val = *P;
    |                        ^^ not granting access to tag <TAG> because that would remove [Unique for <TAG>] which is strongly protected
@@ -7,21 +7,21 @@ LL |             let _val = *P;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x1]
-  --> $DIR/drop_in_place_protector.rs:LL:CC
+  --> tests/fail/stacked_borrows/drop_in_place_protector.rs:LL:CC
    |
 LL |         let x = core::ptr::addr_of_mut!(x);
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: <TAG> is this argument
-  --> $DIR/drop_in_place_protector.rs:LL:CC
+  --> tests/fail/stacked_borrows/drop_in_place_protector.rs:LL:CC
    |
 LL |         core::ptr::drop_in_place(x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `<HasDrop as std::ops::Drop>::drop` at $DIR/drop_in_place_protector.rs:LL:CC
+   = note: inside `<HasDrop as std::ops::Drop>::drop` at tests/fail/stacked_borrows/drop_in_place_protector.rs:LL:CC
    = note: inside `std::ptr::drop_in_place::<HasDrop> - shim(Some(HasDrop))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC
    = note: inside `std::ptr::drop_in_place::<(HasDrop, u8)> - shim(Some((HasDrop, u8)))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC
 note: inside `main`
-  --> $DIR/drop_in_place_protector.rs:LL:CC
+  --> tests/fail/stacked_borrows/drop_in_place_protector.rs:LL:CC
    |
 LL |         core::ptr::drop_in_place(x);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_retag.stderr b/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_retag.stderr
index 6b8465804a5..eebedf842ef 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_retag.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/drop_in_place_retag.stderr
@@ -10,14 +10,14 @@ LL | pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadOnly retag at offsets [0x0..0x1]
-  --> $DIR/drop_in_place_retag.rs:LL:CC
+  --> tests/fail/stacked_borrows/drop_in_place_retag.rs:LL:CC
    |
 LL |         let x = core::ptr::addr_of!(x);
    |                 ^^^^^^^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
    = note: inside `std::ptr::drop_in_place::<u8> - shim(None)` at RUSTLIB/core/src/ptr/mod.rs:LL:CC
 note: inside `main`
-  --> $DIR/drop_in_place_retag.rs:LL:CC
+  --> tests/fail/stacked_borrows/drop_in_place_retag.rs:LL:CC
    |
 LL |         core::ptr::drop_in_place(x.cast_mut());
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/stacked_borrows/exposed_only_ro.stderr b/src/tools/miri/tests/fail/stacked_borrows/exposed_only_ro.stderr
index 201bdcdeb97..861dd75bb22 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/exposed_only_ro.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/exposed_only_ro.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a write access using <wildcard> at ALLOC[0x0], but no exposed tags have suitable permission in the borrow stack for this location
-  --> $DIR/exposed_only_ro.rs:LL:CC
+  --> tests/fail/stacked_borrows/exposed_only_ro.rs:LL:CC
    |
 LL |     unsafe { *ptr = 0 };
    |              ^^^^^^^^
@@ -10,7 +10,7 @@ LL |     unsafe { *ptr = 0 };
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/exposed_only_ro.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/exposed_only_ro.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/fnentry_invalidation.stderr b/src/tools/miri/tests/fail/stacked_borrows/fnentry_invalidation.stderr
index 2a841aa0a8d..1a71feee7a1 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/fnentry_invalidation.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/fnentry_invalidation.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a read access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/fnentry_invalidation.rs:LL:CC
+  --> tests/fail/stacked_borrows/fnentry_invalidation.rs:LL:CC
    |
 LL |         let _oof = *z;
    |                    ^^
@@ -10,17 +10,17 @@ LL |         let _oof = *z;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x4]
-  --> $DIR/fnentry_invalidation.rs:LL:CC
+  --> tests/fail/stacked_borrows/fnentry_invalidation.rs:LL:CC
    |
 LL |     let z = &mut x as *mut i32;
    |             ^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a Unique function-entry retag inside this call
-  --> $DIR/fnentry_invalidation.rs:LL:CC
+  --> tests/fail/stacked_borrows/fnentry_invalidation.rs:LL:CC
    |
 LL |     x.do_bad();
    |     ^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/fnentry_invalidation.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/fnentry_invalidation.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/fnentry_invalidation2.stderr b/src/tools/miri/tests/fail/stacked_borrows/fnentry_invalidation2.stderr
index 42f042bfad2..0b5b005881e 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/fnentry_invalidation2.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/fnentry_invalidation2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a read access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/fnentry_invalidation2.rs:LL:CC
+  --> tests/fail/stacked_borrows/fnentry_invalidation2.rs:LL:CC
    |
 LL |         let _oof = *ptr;
    |                    ^^^^
@@ -10,17 +10,17 @@ LL |         let _oof = *ptr;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadOnly retag at offsets [0x0..0xc]
-  --> $DIR/fnentry_invalidation2.rs:LL:CC
+  --> tests/fail/stacked_borrows/fnentry_invalidation2.rs:LL:CC
    |
 LL |     let ptr = t.sli.as_ptr();
    |               ^^^^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0xc] by a Unique function-entry retag inside this call
-  --> $DIR/fnentry_invalidation2.rs:LL:CC
+  --> tests/fail/stacked_borrows/fnentry_invalidation2.rs:LL:CC
    |
 LL |     let _ = t.sli.as_mut_ptr();
    |             ^^^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/fnentry_invalidation2.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/fnentry_invalidation2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_dealloc1.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_dealloc1.stderr
index d06584d19d7..ddf8dbea31f 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/illegal_dealloc1.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_dealloc1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting deallocation using <TAG> at ALLOC, but that tag does not exist in the borrow stack for this location
-  --> $DIR/illegal_deALLOC.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_deALLOC.rs:LL:CC
    |
 LL |         dealloc(ptr2, Layout::from_size_align_unchecked(1, 1));
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempting deallocation using <TAG> at ALLOC, but that tag does not exist in the borrow stack for this location
@@ -7,17 +7,17 @@ LL |         dealloc(ptr2, Layout::from_size_align_unchecked(1, 1));
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x1]
-  --> $DIR/illegal_deALLOC.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_deALLOC.rs:LL:CC
    |
 LL |         let ptr2 = (&mut *ptr1) as *mut u8;
    |                    ^^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x1] by a write access
-  --> $DIR/illegal_deALLOC.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_deALLOC.rs:LL:CC
    |
 LL |         ptr1.write(0);
    |         ^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/illegal_deALLOC.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/illegal_deALLOC.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_read1.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_read1.stderr
index 2dfb660c53c..bc719f9f205 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/illegal_read1.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_read1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a read access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/illegal_read1.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read1.rs:LL:CC
    |
 LL |     let _val = *xref; // ...but any use of raw will invalidate our ref.
    |                ^^^^^
@@ -10,17 +10,17 @@ LL |     let _val = *xref; // ...but any use of raw will invalidate our ref.
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a Unique retag at offsets [0x0..0x4]
-  --> $DIR/illegal_read1.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read1.rs:LL:CC
    |
 LL |     let xref = unsafe { &mut *xraw }; // derived from raw, so using raw is still ok...
    |                         ^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a read access
-  --> $DIR/illegal_read1.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read1.rs:LL:CC
    |
 LL |     let _val = unsafe { *xraw };
    |                         ^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/illegal_read1.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/illegal_read1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_read2.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_read2.stderr
index ce3b920c1dc..d1bca88d05b 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/illegal_read2.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_read2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a read access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/illegal_read2.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read2.rs:LL:CC
    |
 LL |     let _val = *xref; // ...but any use of raw will invalidate our ref.
    |                ^^^^^
@@ -10,17 +10,17 @@ LL |     let _val = *xref; // ...but any use of raw will invalidate our ref.
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a Unique retag at offsets [0x0..0x4]
-  --> $DIR/illegal_read2.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read2.rs:LL:CC
    |
 LL |     let xref = unsafe { &mut *xraw }; // derived from raw, so using raw is still ok...
    |                         ^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a SharedReadOnly retag
-  --> $DIR/illegal_read2.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read2.rs:LL:CC
    |
 LL |     let shr = unsafe { &*xraw };
    |                        ^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/illegal_read2.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/illegal_read2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_read3.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_read3.stderr
index 2c81fda1411..6a6701aae19 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/illegal_read3.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_read3.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a read access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/illegal_read3.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read3.rs:LL:CC
    |
 LL |     let _val = *xref2;
    |                ^^^^^^
@@ -10,17 +10,17 @@ LL |     let _val = *xref2;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a Unique retag at offsets [0x0..0x4]
-  --> $DIR/illegal_read3.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read3.rs:LL:CC
    |
 LL |     let xref2 = &mut *xref1;
    |                 ^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a read access
-  --> $DIR/illegal_read3.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read3.rs:LL:CC
    |
 LL |     let _val = unsafe { *xref1.r };
    |                         ^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/illegal_read3.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/illegal_read3.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_read4.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_read4.stderr
index 98bfd56cd3c..0d460df3929 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/illegal_read4.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_read4.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a read access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/illegal_read4.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read4.rs:LL:CC
    |
 LL |     let _illegal = *xref2;
    |                    ^^^^^^
@@ -10,17 +10,17 @@ LL |     let _illegal = *xref2;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a Unique retag at offsets [0x0..0x4]
-  --> $DIR/illegal_read4.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read4.rs:LL:CC
    |
 LL |     let xref2 = unsafe { &mut *xraw };
    |                          ^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a read access
-  --> $DIR/illegal_read4.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read4.rs:LL:CC
    |
 LL |     let _val = unsafe { *xraw }; // use the raw again, this invalidates xref2 *even* with the special read except for uniq refs
    |                         ^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/illegal_read4.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/illegal_read4.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_read5.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_read5.stderr
index e3b18e7d4f8..9862d8a1a34 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/illegal_read5.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_read5.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a read access using <TAG> at ALLOC[$HEX], but that tag does not exist in the borrow stack for this location
-  --> $DIR/illegal_read5.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read5.rs:LL:CC
    |
 LL |     let _val = *xref; // the mutable one is dead and gone
    |                ^^^^^
@@ -10,17 +10,17 @@ LL |     let _val = *xref; // the mutable one is dead and gone
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a Unique retag at offsets [$HEX..$HEX]
-  --> $DIR/illegal_read5.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read5.rs:LL:CC
    |
 LL |     let xref: &mut i32 = &mut *refmut;
    |                          ^^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [$HEX..$HEX] by a read access
-  --> $DIR/illegal_read5.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read5.rs:LL:CC
    |
 LL |     mem::forget(unsafe { ptr::read(xshr) }); // but after reading through the shared ref
    |                          ^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/illegal_read5.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/illegal_read5.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_read6.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_read6.stderr
index 415a85bd68c..31c5ad160a9 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/illegal_read6.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_read6.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a read access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/illegal_read6.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read6.rs:LL:CC
    |
 LL |         let _val = *raw;
    |                    ^^^^
@@ -10,17 +10,17 @@ LL |         let _val = *raw;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x4]
-  --> $DIR/illegal_read6.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read6.rs:LL:CC
    |
 LL |         let raw = x as *mut _;
    |                   ^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a Unique retag
-  --> $DIR/illegal_read6.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read6.rs:LL:CC
    |
 LL |         let x = &mut *x; // kill `raw`
    |                 ^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/illegal_read6.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/illegal_read6.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_read7.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_read7.stderr
index 248ae62d5eb..4ae41dd8ee6 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/illegal_read7.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_read7.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to retag from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/illegal_read7.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read7.rs:LL:CC
    |
 LL |         let _val = *x.get_mut();
    |                     ^
@@ -10,17 +10,17 @@ LL |         let _val = *x.get_mut();
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a Unique retag at offsets [0x0..0x4]
-  --> $DIR/illegal_read7.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read7.rs:LL:CC
    |
 LL |         let x = &mut *raw;
    |                 ^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a read access
-  --> $DIR/illegal_read7.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read7.rs:LL:CC
    |
 LL |         let _val = ptr::read(raw);
    |                    ^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/illegal_read7.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/illegal_read7.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_read8.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_read8.stderr
index fd5ed383f1a..fc07c3174ba 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/illegal_read8.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_read8.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a read access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/illegal_read8.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read8.rs:LL:CC
    |
 LL |         let _fail = *y1;
    |                     ^^^
@@ -10,17 +10,17 @@ LL |         let _fail = *y1;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadOnly retag at offsets [0x0..0x4]
-  --> $DIR/illegal_read8.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read8.rs:LL:CC
    |
 LL |         let y1: &i32 = mem::transmute(&*x); // launder lifetimes
    |                        ^^^^^^^^^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a write access
-  --> $DIR/illegal_read8.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read8.rs:LL:CC
    |
 LL |         *y2 += 1;
    |         ^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/illegal_read8.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/illegal_read8.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_read_despite_exposed1.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_read_despite_exposed1.stderr
index 33fcd11ff7a..18a47bb3462 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/illegal_read_despite_exposed1.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_read_despite_exposed1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a read access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/illegal_read_despite_exposed1.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read_despite_exposed1.rs:LL:CC
    |
 LL |         let _val = *root2;
    |                    ^^^^^^
@@ -10,17 +10,17 @@ LL |         let _val = *root2;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a Unique retag at offsets [0x0..0x4]
-  --> $DIR/illegal_read_despite_exposed1.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read_despite_exposed1.rs:LL:CC
    |
 LL |         let root2 = &mut *exposed_ptr;
    |                     ^^^^^^^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a write access
-  --> $DIR/illegal_read_despite_exposed1.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read_despite_exposed1.rs:LL:CC
    |
 LL |         *exposed_ptr = 0;
    |         ^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/illegal_read_despite_exposed1.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/illegal_read_despite_exposed1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_read_despite_exposed2.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_read_despite_exposed2.stderr
index a948c5df166..245bce19938 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/illegal_read_despite_exposed2.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_read_despite_exposed2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a read access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/illegal_read_despite_exposed2.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read_despite_exposed2.rs:LL:CC
    |
 LL |         let _val = *root2;
    |                    ^^^^^^
@@ -10,17 +10,17 @@ LL |         let _val = *root2;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a Unique retag at offsets [0x0..0x4]
-  --> $DIR/illegal_read_despite_exposed2.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read_despite_exposed2.rs:LL:CC
    |
 LL |         let root2 = &mut *exposed_ptr;
    |                     ^^^^^^^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a read access
-  --> $DIR/illegal_read_despite_exposed2.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_read_despite_exposed2.rs:LL:CC
    |
 LL |         let _val = *exposed_ptr;
    |                    ^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/illegal_read_despite_exposed2.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/illegal_read_despite_exposed2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_write2.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_write2.stderr
index 65b4fc5f3fa..595d0ca7588 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/illegal_write2.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_write2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a write access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/illegal_write2.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_write2.rs:LL:CC
    |
 LL |     unsafe { *target2 = 13 };
    |              ^^^^^^^^^^^^^
@@ -10,17 +10,17 @@ LL |     unsafe { *target2 = 13 };
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x4]
-  --> $DIR/illegal_write2.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_write2.rs:LL:CC
    |
 LL |     let target2 = target as *mut _;
    |                   ^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a Unique retag
-  --> $DIR/illegal_write2.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_write2.rs:LL:CC
    |
 LL |     drop(&mut *target); // reborrow
    |          ^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/illegal_write2.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/illegal_write2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_write3.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_write3.stderr
index 08d9f33a169..6805b359367 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/illegal_write3.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_write3.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a write access using <TAG> at ALLOC[0x0], but that tag only grants SharedReadOnly permission for this location
-  --> $DIR/illegal_write3.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_write3.rs:LL:CC
    |
 LL |     unsafe { *ptr = 42 };
    |              ^^^^^^^^^
@@ -10,12 +10,12 @@ LL |     unsafe { *ptr = 42 };
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadOnly retag at offsets [0x0..0x4]
-  --> $DIR/illegal_write3.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_write3.rs:LL:CC
    |
 LL |     let ptr = r#ref as *const _ as *mut _; // raw ptr, with raw tag
    |               ^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/illegal_write3.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/illegal_write3.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_write4.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_write4.stderr
index 4ee5ec38539..0134987caf3 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/illegal_write4.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_write4.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a read access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/illegal_write4.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_write4.rs:LL:CC
    |
 LL |     let _val = *reference;
    |                ^^^^^^^^^^
@@ -10,17 +10,17 @@ LL |     let _val = *reference;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadOnly retag at offsets [0x0..0x4]
-  --> $DIR/illegal_write4.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_write4.rs:LL:CC
    |
 LL |     let reference = unsafe { &*raw }; // freeze
    |                              ^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a Unique retag
-  --> $DIR/illegal_write4.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_write4.rs:LL:CC
    |
 LL |     let _mut_ref: &mut i32 = unsafe { mem::transmute(raw) }; // &mut, with raw tag
    |                                       ^^^^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/illegal_write4.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/illegal_write4.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_write_despite_exposed1.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_write_despite_exposed1.stderr
index 70e9038bab3..42e088dc075 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/illegal_write_despite_exposed1.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_write_despite_exposed1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a read access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/illegal_write_despite_exposed1.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_write_despite_exposed1.rs:LL:CC
    |
 LL |         let _val = *root2;
    |                    ^^^^^^
@@ -10,17 +10,17 @@ LL |         let _val = *root2;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadOnly retag at offsets [0x0..0x4]
-  --> $DIR/illegal_write_despite_exposed1.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_write_despite_exposed1.rs:LL:CC
    |
 LL |         let root2 = &*exposed_ptr;
    |                     ^^^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a write access
-  --> $DIR/illegal_write_despite_exposed1.rs:LL:CC
+  --> tests/fail/stacked_borrows/illegal_write_despite_exposed1.rs:LL:CC
    |
 LL |         *exposed_ptr = 0;
    |         ^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/illegal_write_despite_exposed1.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/illegal_write_despite_exposed1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/interior_mut1.stderr b/src/tools/miri/tests/fail/stacked_borrows/interior_mut1.stderr
index f8bc1667ddb..3d43bf7e6bf 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/interior_mut1.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/interior_mut1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to retag from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/interior_mut1.rs:LL:CC
+  --> tests/fail/stacked_borrows/interior_mut1.rs:LL:CC
    |
 LL |         let _val = *inner_shr.get();
    |                     ^^^^^^^^^
@@ -10,17 +10,17 @@ LL |         let _val = *inner_shr.get();
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x4]
-  --> $DIR/interior_mut1.rs:LL:CC
+  --> tests/fail/stacked_borrows/interior_mut1.rs:LL:CC
    |
 LL |         let inner_shr = &*inner_uniq; // adds a SharedReadWrite
    |                         ^^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a write access
-  --> $DIR/interior_mut1.rs:LL:CC
+  --> tests/fail/stacked_borrows/interior_mut1.rs:LL:CC
    |
 LL |         *c.get() = UnsafeCell::new(1); // invalidates inner_shr
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/interior_mut1.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/interior_mut1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/interior_mut2.stderr b/src/tools/miri/tests/fail/stacked_borrows/interior_mut2.stderr
index a69fc6ff8ba..a7a1521bd63 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/interior_mut2.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/interior_mut2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to retag from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/interior_mut2.rs:LL:CC
+  --> tests/fail/stacked_borrows/interior_mut2.rs:LL:CC
    |
 LL |         let _val = *inner_shr.get();
    |                     ^^^^^^^^^
@@ -10,17 +10,17 @@ LL |         let _val = *inner_shr.get();
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x4]
-  --> $DIR/interior_mut2.rs:LL:CC
+  --> tests/fail/stacked_borrows/interior_mut2.rs:LL:CC
    |
 LL |         let inner_shr = &*inner_uniq;
    |                         ^^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a write access
-  --> $DIR/interior_mut2.rs:LL:CC
+  --> tests/fail/stacked_borrows/interior_mut2.rs:LL:CC
    |
 LL |         *c.get() = UnsafeCell::new(0); // now inner_shr gets invalidated
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/interior_mut2.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/interior_mut2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/invalidate_against_protector1.stderr b/src/tools/miri/tests/fail/stacked_borrows/invalidate_against_protector1.stderr
index 96cdce5a778..5956a3f6753 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/invalidate_against_protector1.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/invalidate_against_protector1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: not granting access to tag <TAG> because that would remove [Unique for <TAG>] which is strongly protected
-  --> $DIR/invalidate_against_protector1.rs:LL:CC
+  --> tests/fail/stacked_borrows/invalidate_against_protector1.rs:LL:CC
    |
 LL |     let _val = unsafe { *x };
    |                         ^^ not granting access to tag <TAG> because that would remove [Unique for <TAG>] which is strongly protected
@@ -7,19 +7,19 @@ LL |     let _val = unsafe { *x };
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x4]
-  --> $DIR/invalidate_against_protector1.rs:LL:CC
+  --> tests/fail/stacked_borrows/invalidate_against_protector1.rs:LL:CC
    |
 LL |     let xraw = &mut x as *mut _;
    |                ^^^^^^
 help: <TAG> is this argument
-  --> $DIR/invalidate_against_protector1.rs:LL:CC
+  --> tests/fail/stacked_borrows/invalidate_against_protector1.rs:LL:CC
    |
 LL | fn inner(x: *mut i32, _y: &mut i32) {
    |                       ^^
    = note: BACKTRACE (of the first span):
-   = note: inside `inner` at $DIR/invalidate_against_protector1.rs:LL:CC
+   = note: inside `inner` at tests/fail/stacked_borrows/invalidate_against_protector1.rs:LL:CC
 note: inside `main`
-  --> $DIR/invalidate_against_protector1.rs:LL:CC
+  --> tests/fail/stacked_borrows/invalidate_against_protector1.rs:LL:CC
    |
 LL |     inner(xraw, xref);
    |     ^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/stacked_borrows/load_invalid_mut.stderr b/src/tools/miri/tests/fail/stacked_borrows/load_invalid_mut.stderr
index 9d707c3f85d..733162acff7 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/load_invalid_mut.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/load_invalid_mut.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to retag from <TAG> for Unique permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/load_invalid_mut.rs:LL:CC
+  --> tests/fail/stacked_borrows/load_invalid_mut.rs:LL:CC
    |
 LL |     let _val = *xref_in_mem;
    |                ^^^^^^^^^^^^
@@ -10,17 +10,17 @@ LL |     let _val = *xref_in_mem;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a Unique retag at offsets [0x0..0x4]
-  --> $DIR/load_invalid_mut.rs:LL:CC
+  --> tests/fail/stacked_borrows/load_invalid_mut.rs:LL:CC
    |
 LL |     let xref_in_mem = Box::new(xref);
    |                       ^^^^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a read access
-  --> $DIR/load_invalid_mut.rs:LL:CC
+  --> tests/fail/stacked_borrows/load_invalid_mut.rs:LL:CC
    |
 LL |     let _val = unsafe { *xraw }; // invalidate xref
    |                         ^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/load_invalid_mut.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/load_invalid_mut.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/pass_invalid_mut.stderr b/src/tools/miri/tests/fail/stacked_borrows/pass_invalid_mut.stderr
index 0a017e18264..c910a05de1c 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/pass_invalid_mut.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/pass_invalid_mut.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to retag from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/pass_invalid_mut.rs:LL:CC
+  --> tests/fail/stacked_borrows/pass_invalid_mut.rs:LL:CC
    |
 LL |     foo(xref);
    |         ^^^^
@@ -10,17 +10,17 @@ LL |     foo(xref);
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a Unique retag at offsets [0x0..0x4]
-  --> $DIR/pass_invalid_mut.rs:LL:CC
+  --> tests/fail/stacked_borrows/pass_invalid_mut.rs:LL:CC
    |
 LL |     let xref = unsafe { &mut *xraw };
    |                         ^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a read access
-  --> $DIR/pass_invalid_mut.rs:LL:CC
+  --> tests/fail/stacked_borrows/pass_invalid_mut.rs:LL:CC
    |
 LL |     let _val = unsafe { *xraw }; // invalidate xref
    |                         ^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/pass_invalid_mut.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/pass_invalid_mut.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/pointer_smuggling.stderr b/src/tools/miri/tests/fail/stacked_borrows/pointer_smuggling.stderr
index 1fddcaf3dad..58c6cd4c318 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/pointer_smuggling.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/pointer_smuggling.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a read access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/pointer_smuggling.rs:LL:CC
+  --> tests/fail/stacked_borrows/pointer_smuggling.rs:LL:CC
    |
 LL |     let _x = unsafe { *PTR };
    |                       ^^^^
@@ -10,19 +10,19 @@ LL |     let _x = unsafe { *PTR };
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x1]
-  --> $DIR/pointer_smuggling.rs:LL:CC
+  --> tests/fail/stacked_borrows/pointer_smuggling.rs:LL:CC
    |
 LL |         PTR = x;
    |               ^
 help: <TAG> was later invalidated at offsets [0x0..0x1] by a write access
-  --> $DIR/pointer_smuggling.rs:LL:CC
+  --> tests/fail/stacked_borrows/pointer_smuggling.rs:LL:CC
    |
 LL |     *val = 2; // this invalidates any raw ptrs `fun1` might have created.
    |     ^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `fun2` at $DIR/pointer_smuggling.rs:LL:CC
+   = note: inside `fun2` at tests/fail/stacked_borrows/pointer_smuggling.rs:LL:CC
 note: inside `main`
-  --> $DIR/pointer_smuggling.rs:LL:CC
+  --> tests/fail/stacked_borrows/pointer_smuggling.rs:LL:CC
    |
 LL |     fun2(); // if they now use a raw ptr they break our reference
    |     ^^^^^^
diff --git a/src/tools/miri/tests/fail/stacked_borrows/raw_tracking.stderr b/src/tools/miri/tests/fail/stacked_borrows/raw_tracking.stderr
index 0d07d154ba5..aa320ea908c 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/raw_tracking.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/raw_tracking.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a write access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/raw_tracking.rs:LL:CC
+  --> tests/fail/stacked_borrows/raw_tracking.rs:LL:CC
    |
 LL |     unsafe { *raw1 = 13 };
    |              ^^^^^^^^^^
@@ -10,17 +10,17 @@ LL |     unsafe { *raw1 = 13 };
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadWrite retag at offsets [0x0..0x4]
-  --> $DIR/raw_tracking.rs:LL:CC
+  --> tests/fail/stacked_borrows/raw_tracking.rs:LL:CC
    |
 LL |     let raw1 = &mut l as *mut _;
    |                ^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a Unique retag
-  --> $DIR/raw_tracking.rs:LL:CC
+  --> tests/fail/stacked_borrows/raw_tracking.rs:LL:CC
    |
 LL |     let raw2 = &mut l as *mut _; // invalidates raw1
    |                ^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/raw_tracking.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/raw_tracking.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_protected_read.stderr b/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_protected_read.stderr
index 47ae4b5d46d..fd5d83211db 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_protected_read.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_protected_read.stderr
@@ -1,11 +1,11 @@
 error: Undefined Behavior: Data race detected between (1) non-atomic read on thread `main` and (2) retag write of type `i32` on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/retag_data_race_protected_read.rs:LL:CC
+  --> tests/fail/stacked_borrows/retag_data_race_protected_read.rs:LL:CC
    |
 LL |         retag(unsafe { &mut *ptr.0 });
    |                        ^^^^^^^^^^^ Data race detected between (1) non-atomic read on thread `main` and (2) retag write of type `i32` on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/retag_data_race_protected_read.rs:LL:CC
+  --> tests/fail/stacked_borrows/retag_data_race_protected_read.rs:LL:CC
    |
 LL |     unsafe { ptr.0.read() };
    |              ^^^^^^^^^^^^
@@ -15,7 +15,7 @@ LL |     unsafe { ptr.0.read() };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/retag_data_race_protected_read.rs:LL:CC
+   = note: inside closure at tests/fail/stacked_borrows/retag_data_race_protected_read.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_read.stderr b/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_read.stderr
index 9fe9fbeda44..87155ebc518 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_read.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/retag_data_race_read.stderr
@@ -1,11 +1,11 @@
 error: Undefined Behavior: Data race detected between (1) retag read on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/retag_data_race_read.rs:LL:CC
+  --> tests/fail/stacked_borrows/retag_data_race_read.rs:LL:CC
    |
 LL |         *p = 5;
    |         ^^^^^^ Data race detected between (1) retag read on thread `unnamed-ID` and (2) non-atomic write on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/retag_data_race_read.rs:LL:CC
+  --> tests/fail/stacked_borrows/retag_data_race_read.rs:LL:CC
    |
 LL |         let _r = &*p;
    |                  ^^^
@@ -15,9 +15,9 @@ LL |         let _r = &*p;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside `thread_2` at $DIR/retag_data_race_read.rs:LL:CC
+   = note: inside `thread_2` at tests/fail/stacked_borrows/retag_data_race_read.rs:LL:CC
 note: inside closure
-  --> $DIR/retag_data_race_read.rs:LL:CC
+  --> tests/fail/stacked_borrows/retag_data_race_read.rs:LL:CC
    |
 LL |     let t2 = std::thread::spawn(move || thread_2(p));
    |                                         ^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut.stderr b/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut.stderr
index 78008e92642..760ed783175 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to retag from <TAG> for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
-  --> $DIR/return_invalid_mut.rs:LL:CC
+  --> tests/fail/stacked_borrows/return_invalid_mut.rs:LL:CC
    |
 LL |     ret
    |     ^^^
@@ -10,19 +10,19 @@ LL |     ret
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a Unique retag at offsets [0x4..0x8]
-  --> $DIR/return_invalid_mut.rs:LL:CC
+  --> tests/fail/stacked_borrows/return_invalid_mut.rs:LL:CC
    |
 LL |     let ret = unsafe { &mut (*xraw).1 };
    |                        ^^^^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x8] by a read access
-  --> $DIR/return_invalid_mut.rs:LL:CC
+  --> tests/fail/stacked_borrows/return_invalid_mut.rs:LL:CC
    |
 LL |     let _val = unsafe { *xraw }; // invalidate xref
    |                         ^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `foo` at $DIR/return_invalid_mut.rs:LL:CC
+   = note: inside `foo` at tests/fail/stacked_borrows/return_invalid_mut.rs:LL:CC
 note: inside `main`
-  --> $DIR/return_invalid_mut.rs:LL:CC
+  --> tests/fail/stacked_borrows/return_invalid_mut.rs:LL:CC
    |
 LL |     foo(&mut (1, 2));
    |     ^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_option.stderr b/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_option.stderr
index b9ae34df077..3175e099620 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_option.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_option.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to retag from <TAG> for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
-  --> $DIR/return_invalid_mut_option.rs:LL:CC
+  --> tests/fail/stacked_borrows/return_invalid_mut_option.rs:LL:CC
    |
 LL |     ret
    |     ^^^
@@ -11,19 +11,19 @@ LL |     ret
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a Unique retag at offsets [0x4..0x8]
-  --> $DIR/return_invalid_mut_option.rs:LL:CC
+  --> tests/fail/stacked_borrows/return_invalid_mut_option.rs:LL:CC
    |
 LL |     let ret = Some(ret);
    |               ^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x8] by a read access
-  --> $DIR/return_invalid_mut_option.rs:LL:CC
+  --> tests/fail/stacked_borrows/return_invalid_mut_option.rs:LL:CC
    |
 LL |     let _val = unsafe { *xraw }; // invalidate xref
    |                         ^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `foo` at $DIR/return_invalid_mut_option.rs:LL:CC
+   = note: inside `foo` at tests/fail/stacked_borrows/return_invalid_mut_option.rs:LL:CC
 note: inside `main`
-  --> $DIR/return_invalid_mut_option.rs:LL:CC
+  --> tests/fail/stacked_borrows/return_invalid_mut_option.rs:LL:CC
    |
 LL |     match foo(&mut (1, 2)) {
    |           ^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_tuple.stderr b/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_tuple.stderr
index 7522115c516..2cc3ba2c9a9 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_tuple.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/return_invalid_mut_tuple.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to retag from <TAG> for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
-  --> $DIR/return_invalid_mut_tuple.rs:LL:CC
+  --> tests/fail/stacked_borrows/return_invalid_mut_tuple.rs:LL:CC
    |
 LL |     ret
    |     ^^^
@@ -11,19 +11,19 @@ LL |     ret
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a Unique retag at offsets [0x4..0x8]
-  --> $DIR/return_invalid_mut_tuple.rs:LL:CC
+  --> tests/fail/stacked_borrows/return_invalid_mut_tuple.rs:LL:CC
    |
 LL |     let ret = (unsafe { &mut (*xraw).1 },);
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x8] by a read access
-  --> $DIR/return_invalid_mut_tuple.rs:LL:CC
+  --> tests/fail/stacked_borrows/return_invalid_mut_tuple.rs:LL:CC
    |
 LL |     let _val = unsafe { *xraw }; // invalidate xref
    |                         ^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `foo` at $DIR/return_invalid_mut_tuple.rs:LL:CC
+   = note: inside `foo` at tests/fail/stacked_borrows/return_invalid_mut_tuple.rs:LL:CC
 note: inside `main`
-  --> $DIR/return_invalid_mut_tuple.rs:LL:CC
+  --> tests/fail/stacked_borrows/return_invalid_mut_tuple.rs:LL:CC
    |
 LL |     foo(&mut (1, 2)).0;
    |     ^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.stderr b/src/tools/miri/tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.stderr
index b5106c9d940..56d9783367b 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to retag from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/shared_rw_borrows_are_weak1.rs:LL:CC
+  --> tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.rs:LL:CC
    |
 LL |         y.get_mut();
    |         ^
@@ -10,17 +10,17 @@ LL |         y.get_mut();
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a Unique retag at offsets [0x0..0x4]
-  --> $DIR/shared_rw_borrows_are_weak1.rs:LL:CC
+  --> tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.rs:LL:CC
    |
 LL |         let y: &mut Cell<i32> = mem::transmute(&mut *x); // launder lifetime
    |                                 ^^^^^^^^^^^^^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a Unique retag
-  --> $DIR/shared_rw_borrows_are_weak1.rs:LL:CC
+  --> tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.rs:LL:CC
    |
 LL |         shr_rw.set(1);
    |         ^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/shared_rw_borrows_are_weak1.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.stderr b/src/tools/miri/tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.stderr
index ccea83db857..8ca56afc121 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a read access using <TAG> at ALLOC[$HEX], but that tag does not exist in the borrow stack for this location
-  --> $DIR/shared_rw_borrows_are_weak2.rs:LL:CC
+  --> tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.rs:LL:CC
    |
 LL |         let _val = *y;
    |                    ^^
@@ -10,17 +10,17 @@ LL |         let _val = *y;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadOnly retag at offsets [$HEX..$HEX]
-  --> $DIR/shared_rw_borrows_are_weak2.rs:LL:CC
+  --> tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.rs:LL:CC
    |
 LL |         let y: &i32 = mem::transmute(&*x.borrow()); // launder lifetime
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [$HEX..$HEX] by a Unique retag
-  --> $DIR/shared_rw_borrows_are_weak2.rs:LL:CC
+  --> tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.rs:LL:CC
    |
 LL |         shr_rw.replace(1);
    |         ^^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/shared_rw_borrows_are_weak2.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/static_memory_modification.stderr b/src/tools/miri/tests/fail/stacked_borrows/static_memory_modification.stderr
index f605fa9d3b9..b86a64623ba 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/static_memory_modification.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/static_memory_modification.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: writing to ALLOC which is read-only
-  --> $DIR/static_memory_modification.rs:LL:CC
+  --> tests/fail/stacked_borrows/static_memory_modification.rs:LL:CC
    |
 LL |         std::mem::transmute::<&usize, &mut usize>(&X)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to ALLOC which is read-only
@@ -7,7 +7,7 @@ LL |         std::mem::transmute::<&usize, &mut usize>(&X)
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/static_memory_modification.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/static_memory_modification.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/track_caller.stderr b/src/tools/miri/tests/fail/stacked_borrows/track_caller.stderr
index f341222a664..163ec84281d 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/track_caller.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/track_caller.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a read access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/track_caller.rs:LL:CC
+  --> tests/fail/stacked_borrows/track_caller.rs:LL:CC
    |
 LL |     let _val = *xref; // ...but any use of raw will invalidate our ref.
    |                ^^^^^
@@ -10,17 +10,17 @@ LL |     let _val = *xref; // ...but any use of raw will invalidate our ref.
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a Unique retag at offsets [0x0..0x4]
-  --> $DIR/track_caller.rs:LL:CC
+  --> tests/fail/stacked_borrows/track_caller.rs:LL:CC
    |
 LL |     let xref = unsafe { &mut *xraw }; // derived from raw, so using raw is still ok...
    |                         ^^^^^^^^^^
 help: <TAG> was later invalidated at offsets [0x0..0x4] by a read access
-  --> $DIR/track_caller.rs:LL:CC
+  --> tests/fail/stacked_borrows/track_caller.rs:LL:CC
    |
 LL |     callee(xraw);
    |     ^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/track_caller.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/track_caller.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/transmute-is-no-escape.stderr b/src/tools/miri/tests/fail/stacked_borrows/transmute-is-no-escape.stderr
index 7d8132b85c8..becd6681eca 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/transmute-is-no-escape.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/transmute-is-no-escape.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a write access using <TAG> at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
-  --> $DIR/transmute-is-no-escape.rs:LL:CC
+  --> tests/fail/stacked_borrows/transmute-is-no-escape.rs:LL:CC
    |
 LL |     unsafe { *raw = 13 };
    |              ^^^^^^^^^
@@ -10,12 +10,12 @@ LL |     unsafe { *raw = 13 };
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadWrite retag at offsets [0x4..0x8]
-  --> $DIR/transmute-is-no-escape.rs:LL:CC
+  --> tests/fail/stacked_borrows/transmute-is-no-escape.rs:LL:CC
    |
 LL |     let raw = (&mut x[1] as *mut i32).wrapping_offset(-1);
    |                ^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/transmute-is-no-escape.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/transmute-is-no-escape.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/unescaped_local.stderr b/src/tools/miri/tests/fail/stacked_borrows/unescaped_local.stderr
index 50c02b3455e..08c2cf2099b 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/unescaped_local.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/unescaped_local.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a write access using <wildcard> at ALLOC[0x0], but no exposed tags have suitable permission in the borrow stack for this location
-  --> $DIR/unescaped_local.rs:LL:CC
+  --> tests/fail/stacked_borrows/unescaped_local.rs:LL:CC
    |
 LL |         *raw = 13;
    |         ^^^^^^^^^
@@ -10,7 +10,7 @@ LL |         *raw = 13;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unescaped_local.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/unescaped_local.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/unescaped_static.stderr b/src/tools/miri/tests/fail/stacked_borrows/unescaped_static.stderr
index 7578b89708a..fb48edc5ddd 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/unescaped_static.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/unescaped_static.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: attempting a read access using <TAG> at ALLOC[0x1], but that tag does not exist in the borrow stack for this location
-  --> $DIR/unescaped_static.rs:LL:CC
+  --> tests/fail/stacked_borrows/unescaped_static.rs:LL:CC
    |
 LL |     let _val = unsafe { *ptr_to_first.add(1) };
    |                         ^^^^^^^^^^^^^^^^^^^^
@@ -10,12 +10,12 @@ LL |     let _val = unsafe { *ptr_to_first.add(1) };
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> was created by a SharedReadOnly retag at offsets [0x0..0x1]
-  --> $DIR/unescaped_static.rs:LL:CC
+  --> tests/fail/stacked_borrows/unescaped_static.rs:LL:CC
    |
 LL |     let ptr_to_first = &ARRAY[0] as *const u8;
    |                        ^^^^^^^^^
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/unescaped_static.rs:LL:CC
+   = note: inside `main` at tests/fail/stacked_borrows/unescaped_static.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/stacked_borrows/zst_slice.stderr b/src/tools/miri/tests/fail/stacked_borrows/zst_slice.stderr
index acae479ced2..01e3c60f0fe 100644
--- a/src/tools/miri/tests/fail/stacked_borrows/zst_slice.stderr
+++ b/src/tools/miri/tests/fail/stacked_borrows/zst_slice.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: trying to retag from <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
-  --> $DIR/zst_slice.rs:LL:CC
+  --> tests/fail/stacked_borrows/zst_slice.rs:LL:CC
    |
 LL |         assert_eq!(*s.as_ptr().add(1), 2);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -10,7 +10,7 @@ LL |         assert_eq!(*s.as_ptr().add(1), 2);
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
 help: <TAG> would have been created here, but this is a zero-size retag ([0x0..0x0]) so the tag in question does not exist anywhere
-  --> $DIR/zst_slice.rs:LL:CC
+  --> tests/fail/stacked_borrows/zst_slice.rs:LL:CC
    |
 LL |         assert_eq!(*s.as_ptr().add(1), 2);
    |                     ^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/static_memory_modification1.stderr b/src/tools/miri/tests/fail/static_memory_modification1.stderr
index 877cf1d6e47..2b2cd4af3da 100644
--- a/src/tools/miri/tests/fail/static_memory_modification1.stderr
+++ b/src/tools/miri/tests/fail/static_memory_modification1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: writing to ALLOC which is read-only
-  --> $DIR/static_memory_modification1.rs:LL:CC
+  --> tests/fail/static_memory_modification1.rs:LL:CC
    |
 LL |         *std::mem::transmute::<&usize, &mut usize>(&X) = 6;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to ALLOC which is read-only
@@ -7,7 +7,7 @@ LL |         *std::mem::transmute::<&usize, &mut usize>(&X) = 6;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/static_memory_modification1.rs:LL:CC
+   = note: inside `main` at tests/fail/static_memory_modification1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/static_memory_modification2.stderr b/src/tools/miri/tests/fail/static_memory_modification2.stderr
index 77bbace4696..99c7f15d9ff 100644
--- a/src/tools/miri/tests/fail/static_memory_modification2.stderr
+++ b/src/tools/miri/tests/fail/static_memory_modification2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: writing to ALLOC which is read-only
-  --> $DIR/static_memory_modification2.rs:LL:CC
+  --> tests/fail/static_memory_modification2.rs:LL:CC
    |
 LL |         transmute::<&[u8], &mut [u8]>(s.as_bytes())[4] = 42;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to ALLOC which is read-only
@@ -7,7 +7,7 @@ LL |         transmute::<&[u8], &mut [u8]>(s.as_bytes())[4] = 42;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/static_memory_modification2.rs:LL:CC
+   = note: inside `main` at tests/fail/static_memory_modification2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/static_memory_modification3.stderr b/src/tools/miri/tests/fail/static_memory_modification3.stderr
index a04609805cb..cb37a2a2dab 100644
--- a/src/tools/miri/tests/fail/static_memory_modification3.stderr
+++ b/src/tools/miri/tests/fail/static_memory_modification3.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: writing to ALLOC which is read-only
-  --> $DIR/static_memory_modification3.rs:LL:CC
+  --> tests/fail/static_memory_modification3.rs:LL:CC
    |
 LL |         transmute::<&[u8], &mut [u8]>(bs)[4] = 42;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to ALLOC which is read-only
@@ -7,7 +7,7 @@ LL |         transmute::<&[u8], &mut [u8]>(bs)[4] = 42;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/static_memory_modification3.rs:LL:CC
+   = note: inside `main` at tests/fail/static_memory_modification3.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/storage-live-dead-var.stderr b/src/tools/miri/tests/fail/storage-live-dead-var.stderr
index ccc77b1c978..f370c284831 100644
--- a/src/tools/miri/tests/fail/storage-live-dead-var.stderr
+++ b/src/tools/miri/tests/fail/storage-live-dead-var.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: accessing a dead local variable
-  --> $DIR/storage-live-dead-var.rs:LL:CC
+  --> tests/fail/storage-live-dead-var.rs:LL:CC
    |
 LL |             val = 42;
    |             ^^^^^^^^ accessing a dead local variable
@@ -7,7 +7,7 @@ LL |             val = 42;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/storage-live-dead-var.rs:LL:CC
+   = note: inside `main` at tests/fail/storage-live-dead-var.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/storage-live-resets-var.stderr b/src/tools/miri/tests/fail/storage-live-resets-var.stderr
index 07d39cc9d6b..099dd3a1f7e 100644
--- a/src/tools/miri/tests/fail/storage-live-resets-var.stderr
+++ b/src/tools/miri/tests/fail/storage-live-resets-var.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered uninitialized memory, but expected an integer
-  --> $DIR/storage-live-resets-var.rs:LL:CC
+  --> tests/fail/storage-live-resets-var.rs:LL:CC
    |
 LL |             _val2 = val;
    |             ^^^^^^^^^^^ constructing invalid value: encountered uninitialized memory, but expected an integer
@@ -7,7 +7,7 @@ LL |             _val2 = val;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/storage-live-resets-var.rs:LL:CC
+   = note: inside `main` at tests/fail/storage-live-resets-var.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/tail_calls/signature-mismatch-arg.stderr b/src/tools/miri/tests/fail/tail_calls/signature-mismatch-arg.stderr
index 8823ab9b970..db8ab7cb460 100644
--- a/src/tools/miri/tests/fail/tail_calls/signature-mismatch-arg.stderr
+++ b/src/tools/miri/tests/fail/tail_calls/signature-mismatch-arg.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: calling a function with argument of type i32 passing data of type u32
-  --> $DIR/signature-mismatch-arg.rs:LL:CC
+  --> tests/fail/tail_calls/signature-mismatch-arg.rs:LL:CC
    |
 LL |     f(0);
    |     ^^^^ calling a function with argument of type i32 passing data of type u32
@@ -9,7 +9,7 @@ LL |     f(0);
    = help: this means these two types are not *guaranteed* to be ABI-compatible across all targets
    = help: if you think this code should be accepted anyway, please report an issue with Miri
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/signature-mismatch-arg.rs:LL:CC
+   = note: inside `main` at tests/fail/tail_calls/signature-mismatch-arg.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/terminate-terminator.stderr b/src/tools/miri/tests/fail/terminate-terminator.stderr
index 6384689c563..e1c0fabd03d 100644
--- a/src/tools/miri/tests/fail/terminate-terminator.stderr
+++ b/src/tools/miri/tests/fail/terminate-terminator.stderr
@@ -1,6 +1,6 @@
 warning: You have explicitly enabled MIR optimizations, overriding Miri's default which is to completely disable them. Any optimizations may hide UB that Miri would otherwise detect, and it is not necessarily possible to predict what kind of UB will be missed. If you are enabling optimizations to make Miri run faster, we advise using cfg(miri) to shrink your workload instead. The performance benefit of enabling MIR optimizations is usually marginal at best.
 
-thread 'main' panicked at $DIR/terminate-terminator.rs:LL:CC:
+thread 'main' panicked at tests/fail/terminate-terminator.rs:LL:CC:
 explicit panic
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
@@ -23,7 +23,7 @@ LL |     ABORT();
    = note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC
    = note: inside `core::panicking::panic_cannot_unwind` at RUSTLIB/core/src/panicking.rs:LL:CC
 note: inside `has_cleanup`
-  --> $DIR/terminate-terminator.rs:LL:CC
+  --> tests/fail/terminate-terminator.rs:LL:CC
    |
 LL | / fn has_cleanup() {
 LL | |     let _f = Foo;
@@ -31,12 +31,12 @@ LL | |     panic!();
 LL | | }
    | |_^
 note: inside `panic_abort`
-  --> $DIR/terminate-terminator.rs:LL:CC
+  --> tests/fail/terminate-terminator.rs:LL:CC
    |
 LL |     has_cleanup();
    | ^
 note: inside `main`
-  --> $DIR/terminate-terminator.rs:LL:CC
+  --> tests/fail/terminate-terminator.rs:LL:CC
    |
 LL |     panic_abort();
    | ^
diff --git a/src/tools/miri/tests/fail/tls/tls_static_dealloc.stderr b/src/tools/miri/tests/fail/tls/tls_static_dealloc.stderr
index a49933b7d05..3a45dbfb583 100644
--- a/src/tools/miri/tests/fail/tls/tls_static_dealloc.stderr
+++ b/src/tools/miri/tests/fail/tls/tls_static_dealloc.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: ALLOC has been freed, so this pointer is dangling
-  --> $DIR/tls_static_dealloc.rs:LL:CC
+  --> tests/fail/tls/tls_static_dealloc.rs:LL:CC
    |
 LL |         let _val = *dangling_ptr.0;
    |                    ^^^^^^^^^^^^^^^ memory access failed: ALLOC has been freed, so this pointer is dangling
@@ -7,7 +7,7 @@ LL |         let _val = *dangling_ptr.0;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/tls_static_dealloc.rs:LL:CC
+   = note: inside `main` at tests/fail/tls/tls_static_dealloc.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/tls_macro_leak.stderr b/src/tools/miri/tests/fail/tls_macro_leak.stderr
index e4854328155..512932b3cb8 100644
--- a/src/tools/miri/tests/fail/tls_macro_leak.stderr
+++ b/src/tools/miri/tests/fail/tls_macro_leak.stderr
@@ -1,15 +1,15 @@
 error: memory leaked: ALLOC (Rust heap, size: 4, align: 4), allocated here:
-  --> $DIR/tls_macro_leak.rs:LL:CC
+  --> tests/fail/tls_macro_leak.rs:LL:CC
    |
 LL |             cell.set(Some(Box::leak(Box::new(123))));
    |                                     ^^^^^^^^^^^^^
    |
    = note: BACKTRACE:
-   = note: inside closure at $DIR/tls_macro_leak.rs:LL:CC
-   = note: inside `std::thread::LocalKey::<std::cell::Cell<std::option::Option<&i32>>>::try_with::<{closure@$DIR/tls_macro_leak.rs:LL:CC}, ()>` at RUSTLIB/std/src/thread/local.rs:LL:CC
-   = note: inside `std::thread::LocalKey::<std::cell::Cell<std::option::Option<&i32>>>::with::<{closure@$DIR/tls_macro_leak.rs:LL:CC}, ()>` at RUSTLIB/std/src/thread/local.rs:LL:CC
+   = note: inside closure at tests/fail/tls_macro_leak.rs:LL:CC
+   = note: inside `std::thread::LocalKey::<std::cell::Cell<std::option::Option<&i32>>>::try_with::<{closure@tests/fail/tls_macro_leak.rs:LL:CC}, ()>` at RUSTLIB/std/src/thread/local.rs:LL:CC
+   = note: inside `std::thread::LocalKey::<std::cell::Cell<std::option::Option<&i32>>>::with::<{closure@tests/fail/tls_macro_leak.rs:LL:CC}, ()>` at RUSTLIB/std/src/thread/local.rs:LL:CC
 note: inside closure
-  --> $DIR/tls_macro_leak.rs:LL:CC
+  --> tests/fail/tls_macro_leak.rs:LL:CC
    |
 LL | /         TLS.with(|cell| {
 LL | |             cell.set(Some(Box::leak(Box::new(123))));
diff --git a/src/tools/miri/tests/fail/tls_static_leak.stderr b/src/tools/miri/tests/fail/tls_static_leak.stderr
index 06d71fb4568..24306cca7ff 100644
--- a/src/tools/miri/tests/fail/tls_static_leak.stderr
+++ b/src/tools/miri/tests/fail/tls_static_leak.stderr
@@ -1,11 +1,11 @@
 error: memory leaked: ALLOC (Rust heap, size: 4, align: 4), allocated here:
-  --> $DIR/tls_static_leak.rs:LL:CC
+  --> tests/fail/tls_static_leak.rs:LL:CC
    |
 LL |         TLS.set(Some(Box::leak(Box::new(123))));
    |                                ^^^^^^^^^^^^^
    |
    = note: BACKTRACE:
-   = note: inside closure at $DIR/tls_static_leak.rs:LL:CC
+   = note: inside closure at tests/fail/tls_static_leak.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/tree_borrows/alternate-read-write.rs b/src/tools/miri/tests/fail/tree_borrows/alternate-read-write.rs
index 122a8ff8752..fee88cf3486 100644
--- a/src/tools/miri/tests/fail/tree_borrows/alternate-read-write.rs
+++ b/src/tools/miri/tests/fail/tree_borrows/alternate-read-write.rs
@@ -13,7 +13,8 @@ pub fn main() {
     // This time y gets Frozen...
     let _val = *x;
     // ... and the next Write attempt fails.
-    *y += 1; // Failure //~ ERROR: /write access through .* is forbidden/
+    //~v ERROR: /write access through .* is forbidden/
+    *y += 1; // Failure
     let _val = *x;
     *y += 1; // Unreachable
 }
diff --git a/src/tools/miri/tests/fail/tree_borrows/alternate-read-write.stderr b/src/tools/miri/tests/fail/tree_borrows/alternate-read-write.stderr
index bd969d089c3..1294b52c051 100644
--- a/src/tools/miri/tests/fail/tree_borrows/alternate-read-write.stderr
+++ b/src/tools/miri/tests/fail/tree_borrows/alternate-read-write.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/alternate-read-write.rs:LL:CC
+  --> tests/fail/tree_borrows/alternate-read-write.rs:LL:CC
    |
 LL |     *y += 1; // Failure
    |     ^^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
@@ -7,24 +7,24 @@ LL |     *y += 1; // Failure
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Frozen which forbids this child write access
 help: the accessed tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/alternate-read-write.rs:LL:CC
+  --> tests/fail/tree_borrows/alternate-read-write.rs:LL:CC
    |
 LL |     let y = unsafe { &mut *(x as *mut u8) };
    |                      ^^^^^^^^^^^^^^^^^^^^
 help: the accessed tag <TAG> later transitioned to Active due to a child write access at offsets [0x0..0x1]
-  --> $DIR/alternate-read-write.rs:LL:CC
+  --> tests/fail/tree_borrows/alternate-read-write.rs:LL:CC
    |
 LL |     *y += 1; // Success
    |     ^^^^^^^
    = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference
 help: the accessed tag <TAG> later transitioned to Frozen due to a foreign read access at offsets [0x0..0x1]
-  --> $DIR/alternate-read-write.rs:LL:CC
+  --> tests/fail/tree_borrows/alternate-read-write.rs:LL:CC
    |
 LL |     let _val = *x;
    |                ^^
    = help: this transition corresponds to a loss of write permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/alternate-read-write.rs:LL:CC
+   = note: inside `main` at tests/fail/tree_borrows/alternate-read-write.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/tree_borrows/children-can-alias.default.stderr b/src/tools/miri/tests/fail/tree_borrows/children-can-alias.default.stderr
index 87286f1a1a6..b9651e21ece 100644
--- a/src/tools/miri/tests/fail/tree_borrows/children-can-alias.default.stderr
+++ b/src/tools/miri/tests/fail/tree_borrows/children-can-alias.default.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: entering unreachable code
-  --> $DIR/children-can-alias.rs:LL:CC
+  --> tests/fail/tree_borrows/children-can-alias.rs:LL:CC
    |
 LL |         std::hint::unreachable_unchecked();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ entering unreachable code
@@ -7,7 +7,7 @@ LL |         std::hint::unreachable_unchecked();
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/children-can-alias.rs:LL:CC
+   = note: inside `main` at tests/fail/tree_borrows/children-can-alias.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/tree_borrows/children-can-alias.uniq.stderr b/src/tools/miri/tests/fail/tree_borrows/children-can-alias.uniq.stderr
index cdfa8a74238..83c506abb2d 100644
--- a/src/tools/miri/tests/fail/tree_borrows/children-can-alias.uniq.stderr
+++ b/src/tools/miri/tests/fail/tree_borrows/children-can-alias.uniq.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/children-can-alias.rs:LL:CC
+  --> tests/fail/tree_borrows/children-can-alias.rs:LL:CC
    |
 LL |     child2.write(2);
    |     ^^^^^^^^^^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
@@ -7,20 +7,20 @@ LL |     child2.write(2);
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Disabled which forbids this child write access
 help: the accessed tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/children-can-alias.rs:LL:CC
+  --> tests/fail/tree_borrows/children-can-alias.rs:LL:CC
    |
 LL |     let child2 = x.as_ptr();
    |                  ^^^^^^^^^^
 help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x0..0x1]
-  --> $DIR/children-can-alias.rs:LL:CC
+  --> tests/fail/tree_borrows/children-can-alias.rs:LL:CC
    |
 LL |     child1.write(1);
    |     ^^^^^^^^^^^^^^^
    = help: this transition corresponds to a loss of read and write permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `raw_children_of_unique_can_alias` at $DIR/children-can-alias.rs:LL:CC
+   = note: inside `raw_children_of_unique_can_alias` at tests/fail/tree_borrows/children-can-alias.rs:LL:CC
 note: inside `main`
-  --> $DIR/children-can-alias.rs:LL:CC
+  --> tests/fail/tree_borrows/children-can-alias.rs:LL:CC
    |
 LL |         raw_children_of_unique_can_alias(Unique::new_unchecked(raw));
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/tree_borrows/error-range.stderr b/src/tools/miri/tests/fail/tree_borrows/error-range.stderr
index 090ae4507bd..dc4d7c1f7ff 100644
--- a/src/tools/miri/tests/fail/tree_borrows/error-range.stderr
+++ b/src/tools/miri/tests/fail/tree_borrows/error-range.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: read access through <TAG> at ALLOC[0x5] is forbidden
-  --> $DIR/error-range.rs:LL:CC
+  --> tests/fail/tree_borrows/error-range.rs:LL:CC
    |
 LL |         rmut[5] += 1;
    |         ^^^^^^^^^^^^ read access through <TAG> at ALLOC[0x5] is forbidden
@@ -7,18 +7,18 @@ LL |         rmut[5] += 1;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Disabled which forbids this child read access
 help: the accessed tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/error-range.rs:LL:CC
+  --> tests/fail/tree_borrows/error-range.rs:LL:CC
    |
 LL |         let rmut = &mut *addr_of_mut!(data[0..6]);
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x5..0x6]
-  --> $DIR/error-range.rs:LL:CC
+  --> tests/fail/tree_borrows/error-range.rs:LL:CC
    |
 LL |         data[5] = 1;
    |         ^^^^^^^^^^^
    = help: this transition corresponds to a loss of read permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/error-range.rs:LL:CC
+   = note: inside `main` at tests/fail/tree_borrows/error-range.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/tree_borrows/fnentry_invalidation.stderr b/src/tools/miri/tests/fail/tree_borrows/fnentry_invalidation.stderr
index dd5d27107fe..6b8e8fc1147 100644
--- a/src/tools/miri/tests/fail/tree_borrows/fnentry_invalidation.stderr
+++ b/src/tools/miri/tests/fail/tree_borrows/fnentry_invalidation.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/fnentry_invalidation.rs:LL:CC
+  --> tests/fail/tree_borrows/fnentry_invalidation.rs:LL:CC
    |
 LL |         *z = 2;
    |         ^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
@@ -7,24 +7,24 @@ LL |         *z = 2;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Frozen which forbids this child write access
 help: the accessed tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/fnentry_invalidation.rs:LL:CC
+  --> tests/fail/tree_borrows/fnentry_invalidation.rs:LL:CC
    |
 LL |     let z = &mut x as *mut i32;
    |             ^^^^^^
 help: the accessed tag <TAG> later transitioned to Active due to a child write access at offsets [0x0..0x4]
-  --> $DIR/fnentry_invalidation.rs:LL:CC
+  --> tests/fail/tree_borrows/fnentry_invalidation.rs:LL:CC
    |
 LL |         *z = 1;
    |         ^^^^^^
    = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference
 help: the accessed tag <TAG> later transitioned to Frozen due to a reborrow (acting as a foreign read access) at offsets [0x0..0x4]
-  --> $DIR/fnentry_invalidation.rs:LL:CC
+  --> tests/fail/tree_borrows/fnentry_invalidation.rs:LL:CC
    |
 LL |     x.do_bad();
    |     ^
    = help: this transition corresponds to a loss of write permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/fnentry_invalidation.rs:LL:CC
+   = note: inside `main` at tests/fail/tree_borrows/fnentry_invalidation.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/tree_borrows/outside-range.stderr b/src/tools/miri/tests/fail/tree_borrows/outside-range.stderr
index 715228028bc..39fb956f739 100644
--- a/src/tools/miri/tests/fail/tree_borrows/outside-range.stderr
+++ b/src/tools/miri/tests/fail/tree_borrows/outside-range.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x3] is forbidden
-  --> $DIR/outside-range.rs:LL:CC
+  --> tests/fail/tree_borrows/outside-range.rs:LL:CC
    |
 LL |     *y.add(3) = 42;
    |     ^^^^^^^^^^^^^^ write access through <TAG> at ALLOC[0x3] is forbidden
@@ -9,19 +9,19 @@ LL |     *y.add(3) = 42;
    = help: this foreign write access would cause the protected tag <TAG> (currently Reserved) to become Disabled
    = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
-  --> $DIR/outside-range.rs:LL:CC
+  --> tests/fail/tree_borrows/outside-range.rs:LL:CC
    |
 LL |         let raw = data.as_mut_ptr();
    |                   ^^^^^^^^^^^^^^^^^
 help: the protected tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/outside-range.rs:LL:CC
+  --> tests/fail/tree_borrows/outside-range.rs:LL:CC
    |
 LL | unsafe fn stuff(x: &mut u8, y: *mut u8) {
    |                 ^
    = note: BACKTRACE (of the first span):
-   = note: inside `stuff` at $DIR/outside-range.rs:LL:CC
+   = note: inside `stuff` at tests/fail/tree_borrows/outside-range.rs:LL:CC
 note: inside `main`
-  --> $DIR/outside-range.rs:LL:CC
+  --> tests/fail/tree_borrows/outside-range.rs:LL:CC
    |
 LL |         stuff(&mut *raw, raw);
    |         ^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/tree_borrows/parent_read_freezes_raw_mut.stderr b/src/tools/miri/tests/fail/tree_borrows/parent_read_freezes_raw_mut.stderr
index 87844ff4011..15f257c3d95 100644
--- a/src/tools/miri/tests/fail/tree_borrows/parent_read_freezes_raw_mut.stderr
+++ b/src/tools/miri/tests/fail/tree_borrows/parent_read_freezes_raw_mut.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/parent_read_freezes_raw_mut.rs:LL:CC
+  --> tests/fail/tree_borrows/parent_read_freezes_raw_mut.rs:LL:CC
    |
 LL |         *ptr = 0;
    |         ^^^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
@@ -7,24 +7,24 @@ LL |         *ptr = 0;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Frozen which forbids this child write access
 help: the accessed tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/parent_read_freezes_raw_mut.rs:LL:CC
+  --> tests/fail/tree_borrows/parent_read_freezes_raw_mut.rs:LL:CC
    |
 LL |         let mref = &mut root;
    |                    ^^^^^^^^^
 help: the accessed tag <TAG> later transitioned to Active due to a child write access at offsets [0x0..0x1]
-  --> $DIR/parent_read_freezes_raw_mut.rs:LL:CC
+  --> tests/fail/tree_borrows/parent_read_freezes_raw_mut.rs:LL:CC
    |
 LL |         *ptr = 0; // Write
    |         ^^^^^^^^
    = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference
 help: the accessed tag <TAG> later transitioned to Frozen due to a reborrow (acting as a foreign read access) at offsets [0x0..0x1]
-  --> $DIR/parent_read_freezes_raw_mut.rs:LL:CC
+  --> tests/fail/tree_borrows/parent_read_freezes_raw_mut.rs:LL:CC
    |
 LL |         assert_eq!(root, 0); // Parent Read
    |         ^^^^^^^^^^^^^^^^^^^
    = help: this transition corresponds to a loss of write permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/parent_read_freezes_raw_mut.rs:LL:CC
+   = note: inside `main` at tests/fail/tree_borrows/parent_read_freezes_raw_mut.rs:LL:CC
    = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
diff --git a/src/tools/miri/tests/fail/tree_borrows/pass_invalid_mut.stderr b/src/tools/miri/tests/fail/tree_borrows/pass_invalid_mut.stderr
index 84fbc91e686..f6da0b8ec52 100644
--- a/src/tools/miri/tests/fail/tree_borrows/pass_invalid_mut.stderr
+++ b/src/tools/miri/tests/fail/tree_borrows/pass_invalid_mut.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/pass_invalid_mut.rs:LL:CC
+  --> tests/fail/tree_borrows/pass_invalid_mut.rs:LL:CC
    |
 LL |     *nope = 31;
    |     ^^^^^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
@@ -8,31 +8,31 @@ LL |     *nope = 31;
    = help: the accessed tag <TAG> is a child of the conflicting tag <TAG>
    = help: the conflicting tag <TAG> has state Frozen which forbids this child write access
 help: the accessed tag <TAG> was created here
-  --> $DIR/pass_invalid_mut.rs:LL:CC
+  --> tests/fail/tree_borrows/pass_invalid_mut.rs:LL:CC
    |
 LL | fn foo(nope: &mut i32) {
    |        ^^^^
 help: the conflicting tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/pass_invalid_mut.rs:LL:CC
+  --> tests/fail/tree_borrows/pass_invalid_mut.rs:LL:CC
    |
 LL |     let xref = unsafe { &mut *xraw };
    |                         ^^^^^^^^^^
 help: the conflicting tag <TAG> later transitioned to Active due to a child write access at offsets [0x0..0x4]
-  --> $DIR/pass_invalid_mut.rs:LL:CC
+  --> tests/fail/tree_borrows/pass_invalid_mut.rs:LL:CC
    |
 LL |     *xref = 18; // activate xref
    |     ^^^^^^^^^^
    = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference
 help: the conflicting tag <TAG> later transitioned to Frozen due to a foreign read access at offsets [0x0..0x4]
-  --> $DIR/pass_invalid_mut.rs:LL:CC
+  --> tests/fail/tree_borrows/pass_invalid_mut.rs:LL:CC
    |
 LL |     let _val = unsafe { *xraw }; // invalidate xref for writing
    |                         ^^^^^
    = help: this transition corresponds to a loss of write permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `foo` at $DIR/pass_invalid_mut.rs:LL:CC
+   = note: inside `foo` at tests/fail/tree_borrows/pass_invalid_mut.rs:LL:CC
 note: inside `main`
-  --> $DIR/pass_invalid_mut.rs:LL:CC
+  --> tests/fail/tree_borrows/pass_invalid_mut.rs:LL:CC
    |
 LL |     foo(xref);
    |     ^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/tree_borrows/protector-write-lazy.stderr b/src/tools/miri/tests/fail/tree_borrows/protector-write-lazy.stderr
index 955abd144c7..bb07776da61 100644
--- a/src/tools/miri/tests/fail/tree_borrows/protector-write-lazy.stderr
+++ b/src/tools/miri/tests/fail/tree_borrows/protector-write-lazy.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: reborrow through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/protector-write-lazy.rs:LL:CC
+  --> tests/fail/tree_borrows/protector-write-lazy.rs:LL:CC
    |
 LL |     unsafe { println!("Value of funky: {}", *funky_ptr_lazy_on_fst_elem) }
    |                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ reborrow through <TAG> at ALLOC[0x0] is forbidden
@@ -7,18 +7,18 @@ LL |     unsafe { println!("Value of funky: {}", *funky_ptr_lazy_on_fst_elem) }
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Disabled which forbids this reborrow (acting as a child read access)
 help: the accessed tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/protector-write-lazy.rs:LL:CC
+  --> tests/fail/tree_borrows/protector-write-lazy.rs:LL:CC
    |
 LL |         unsafe { (&mut *(ptr_to_vec.wrapping_add(1))) as *mut i32 }.wrapping_sub(1);
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: the accessed tag <TAG> later transitioned to Disabled due to a protector release (acting as a foreign write access) on every location previously accessed by this tag
-  --> $DIR/protector-write-lazy.rs:LL:CC
+  --> tests/fail/tree_borrows/protector-write-lazy.rs:LL:CC
    |
 LL | }
    |  ^
    = help: this transition corresponds to a loss of read and write permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/protector-write-lazy.rs:LL:CC
+   = note: inside `main` at tests/fail/tree_borrows/protector-write-lazy.rs:LL:CC
    = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
diff --git a/src/tools/miri/tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.stderr b/src/tools/miri/tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.stderr
index 963e8e5eca9..d81ecff6ccc 100644
--- a/src/tools/miri/tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.stderr
+++ b/src/tools/miri/tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/repeated_foreign_read_lazy_conflicted.rs:LL:CC
+  --> tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.rs:LL:CC
    |
 LL |     *(x as *mut u8).byte_sub(1) = 42;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
@@ -7,20 +7,20 @@ LL |     *(x as *mut u8).byte_sub(1) = 42;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Reserved (conflicted) which forbids this child write access
 help: the accessed tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/repeated_foreign_read_lazy_conflicted.rs:LL:CC
+  --> tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.rs:LL:CC
    |
 LL | unsafe fn access_after_sub_1(x: &mut u8, orig_ptr: *mut u8) {
    |                              ^
 help: the accessed tag <TAG> later transitioned to Reserved (conflicted) due to a foreign read access at offsets [0x0..0x1]
-  --> $DIR/repeated_foreign_read_lazy_conflicted.rs:LL:CC
+  --> tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.rs:LL:CC
    |
 LL |     do_something(*orig_ptr);
    |                  ^^^^^^^^^
    = help: this transition corresponds to a temporary loss of write permissions until function exit
    = note: BACKTRACE (of the first span):
-   = note: inside `access_after_sub_1` at $DIR/repeated_foreign_read_lazy_conflicted.rs:LL:CC
+   = note: inside `access_after_sub_1` at tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.rs:LL:CC
 note: inside `main`
-  --> $DIR/repeated_foreign_read_lazy_conflicted.rs:LL:CC
+  --> tests/fail/tree_borrows/repeated_foreign_read_lazy_conflicted.rs:LL:CC
    |
 LL |         access_after_sub_1(&mut *(foo as *mut u8).byte_add(1), orig_ptr);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/tree_borrows/reserved/cell-protected-write.stderr b/src/tools/miri/tests/fail/tree_borrows/reserved/cell-protected-write.stderr
index 133a50938f2..03f79fe0a5d 100644
--- a/src/tools/miri/tests/fail/tree_borrows/reserved/cell-protected-write.stderr
+++ b/src/tools/miri/tests/fail/tree_borrows/reserved/cell-protected-write.stderr
@@ -9,7 +9,7 @@ Warning: this tree is indicative only. Some tags may have been hidden.
 | ReIM|        └────<TAG=y, callee:y, caller:y>
 ──────────────────────────────────────────────────
 error: Undefined Behavior: write access through <TAG> (y, callee:y, caller:y) at ALLOC[0x0] is forbidden
-  --> $DIR/cell-protected-write.rs:LL:CC
+  --> tests/fail/tree_borrows/reserved/cell-protected-write.rs:LL:CC
    |
 LL |             *y = 1;
    |             ^^^^^^ write access through <TAG> (y, callee:y, caller:y) at ALLOC[0x0] is forbidden
@@ -19,19 +19,19 @@ LL |             *y = 1;
    = help: this foreign write access would cause the protected tag <TAG> (callee:x) (currently Reserved) to become Disabled
    = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
-  --> $DIR/cell-protected-write.rs:LL:CC
+  --> tests/fail/tree_borrows/reserved/cell-protected-write.rs:LL:CC
    |
 LL |         let y = (&mut *n).get();
    |                 ^^^^^^^^^
 help: the protected tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/cell-protected-write.rs:LL:CC
+  --> tests/fail/tree_borrows/reserved/cell-protected-write.rs:LL:CC
    |
 LL |         unsafe fn write_second(x: &mut UnsafeCell<u8>, y: *mut u8) {
    |                                ^
    = note: BACKTRACE (of the first span):
-   = note: inside `main::write_second` at $DIR/cell-protected-write.rs:LL:CC
+   = note: inside `main::write_second` at tests/fail/tree_borrows/reserved/cell-protected-write.rs:LL:CC
 note: inside `main`
-  --> $DIR/cell-protected-write.rs:LL:CC
+  --> tests/fail/tree_borrows/reserved/cell-protected-write.rs:LL:CC
    |
 LL |         write_second(x, y);
    |         ^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/tree_borrows/reserved/int-protected-write.stderr b/src/tools/miri/tests/fail/tree_borrows/reserved/int-protected-write.stderr
index a4dc123979e..a9683c9e614 100644
--- a/src/tools/miri/tests/fail/tree_borrows/reserved/int-protected-write.stderr
+++ b/src/tools/miri/tests/fail/tree_borrows/reserved/int-protected-write.stderr
@@ -9,7 +9,7 @@ Warning: this tree is indicative only. Some tags may have been hidden.
 | Res |        └────<TAG=y, callee:y, caller:y>
 ──────────────────────────────────────────────────
 error: Undefined Behavior: write access through <TAG> (y, callee:y, caller:y) at ALLOC[0x0] is forbidden
-  --> $DIR/int-protected-write.rs:LL:CC
+  --> tests/fail/tree_borrows/reserved/int-protected-write.rs:LL:CC
    |
 LL |             *y = 0;
    |             ^^^^^^ write access through <TAG> (y, callee:y, caller:y) at ALLOC[0x0] is forbidden
@@ -19,19 +19,19 @@ LL |             *y = 0;
    = help: this foreign write access would cause the protected tag <TAG> (callee:x) (currently Reserved) to become Disabled
    = help: protected tags must never be Disabled
 help: the accessed tag <TAG> was created here
-  --> $DIR/int-protected-write.rs:LL:CC
+  --> tests/fail/tree_borrows/reserved/int-protected-write.rs:LL:CC
    |
 LL |         let y = (&mut *n) as *mut _;
    |                 ^^^^^^^^^
 help: the protected tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/int-protected-write.rs:LL:CC
+  --> tests/fail/tree_borrows/reserved/int-protected-write.rs:LL:CC
    |
 LL |         unsafe fn write_second(x: &mut u8, y: *mut u8) {
    |                                ^
    = note: BACKTRACE (of the first span):
-   = note: inside `main::write_second` at $DIR/int-protected-write.rs:LL:CC
+   = note: inside `main::write_second` at tests/fail/tree_borrows/reserved/int-protected-write.rs:LL:CC
 note: inside `main`
-  --> $DIR/int-protected-write.rs:LL:CC
+  --> tests/fail/tree_borrows/reserved/int-protected-write.rs:LL:CC
    |
 LL |         write_second(x, y);
    |         ^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.with.stderr b/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.with.stderr
index 0e4517e9010..47341e027d7 100644
--- a/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.with.stderr
+++ b/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.with.stderr
@@ -13,7 +13,7 @@ Thread 1 executing: ret x
 Thread 1 executing: write y
 Thread 2 executing: write y
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/reservedim_spurious_write.rs:LL:CC
+  --> tests/fail/tree_borrows/reservedim_spurious_write.rs:LL:CC
    |
 LL |         unsafe { *y = 13 }
    |                  ^^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
@@ -21,18 +21,18 @@ LL |         unsafe { *y = 13 }
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Disabled which forbids this child write access
 help: the accessed tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/reservedim_spurious_write.rs:LL:CC
+  --> tests/fail/tree_borrows/reservedim_spurious_write.rs:LL:CC
    |
 LL |         fn inner(y: &mut Cell<()>, b: IdxBarrier) -> *mut u8 {
    |                  ^
 help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x0..0x1]
-  --> $DIR/reservedim_spurious_write.rs:LL:CC
+  --> tests/fail/tree_borrows/reservedim_spurious_write.rs:LL:CC
    |
 LL |                 *x = 64;
    |                 ^^^^^^^
    = help: this transition corresponds to a loss of read and write permissions
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/reservedim_spurious_write.rs:LL:CC
+   = note: inside closure at tests/fail/tree_borrows/reservedim_spurious_write.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.without.stderr b/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.without.stderr
index cbeef90243b..504b8cc0ac7 100644
--- a/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.without.stderr
+++ b/src/tools/miri/tests/fail/tree_borrows/reservedim_spurious_write.without.stderr
@@ -13,7 +13,7 @@ Thread 1 executing: ret x
 Thread 1 executing: write y
 Thread 2 executing: write y
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/reservedim_spurious_write.rs:LL:CC
+  --> tests/fail/tree_borrows/reservedim_spurious_write.rs:LL:CC
    |
 LL |         unsafe { *y = 13 }
    |                  ^^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
@@ -21,18 +21,18 @@ LL |         unsafe { *y = 13 }
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Disabled which forbids this child write access
 help: the accessed tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/reservedim_spurious_write.rs:LL:CC
+  --> tests/fail/tree_borrows/reservedim_spurious_write.rs:LL:CC
    |
 LL |         fn inner(y: &mut Cell<()>, b: IdxBarrier) -> *mut u8 {
    |                  ^
 help: the accessed tag <TAG> later transitioned to Disabled due to a protector release (acting as a foreign write access) on every location previously accessed by this tag
-  --> $DIR/reservedim_spurious_write.rs:LL:CC
+  --> tests/fail/tree_borrows/reservedim_spurious_write.rs:LL:CC
    |
 LL |         }
    |          ^
    = help: this transition corresponds to a loss of read and write permissions
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/reservedim_spurious_write.rs:LL:CC
+   = note: inside closure at tests/fail/tree_borrows/reservedim_spurious_write.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/tree_borrows/return_invalid_mut.stderr b/src/tools/miri/tests/fail/tree_borrows/return_invalid_mut.stderr
index ca8c45d36f9..81fa3262877 100644
--- a/src/tools/miri/tests/fail/tree_borrows/return_invalid_mut.stderr
+++ b/src/tools/miri/tests/fail/tree_borrows/return_invalid_mut.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x4] is forbidden
-  --> $DIR/return_invalid_mut.rs:LL:CC
+  --> tests/fail/tree_borrows/return_invalid_mut.rs:LL:CC
    |
 LL |     *ret = 3;
    |     ^^^^^^^^ write access through <TAG> at ALLOC[0x4] is forbidden
@@ -8,29 +8,29 @@ LL |     *ret = 3;
    = help: the accessed tag <TAG> is a child of the conflicting tag <TAG>
    = help: the conflicting tag <TAG> has state Frozen which forbids this child write access
 help: the accessed tag <TAG> was created here
-  --> $DIR/return_invalid_mut.rs:LL:CC
+  --> tests/fail/tree_borrows/return_invalid_mut.rs:LL:CC
    |
 LL |     let ret = foo(arg);
    |               ^^^^^^^^
 help: the conflicting tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/return_invalid_mut.rs:LL:CC
+  --> tests/fail/tree_borrows/return_invalid_mut.rs:LL:CC
    |
 LL |     let ret = unsafe { &mut (*xraw).1 };
    |                        ^^^^^^^^^^^^^^
 help: the conflicting tag <TAG> later transitioned to Active due to a child write access at offsets [0x4..0x8]
-  --> $DIR/return_invalid_mut.rs:LL:CC
+  --> tests/fail/tree_borrows/return_invalid_mut.rs:LL:CC
    |
 LL |     *ret = *ret; // activate
    |     ^^^^^^^^^^^
    = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference
 help: the conflicting tag <TAG> later transitioned to Frozen due to a foreign read access at offsets [0x0..0x8]
-  --> $DIR/return_invalid_mut.rs:LL:CC
+  --> tests/fail/tree_borrows/return_invalid_mut.rs:LL:CC
    |
 LL |     let _val = unsafe { *xraw }; // invalidate xref for writing
    |                         ^^^^^
    = help: this transition corresponds to a loss of write permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/return_invalid_mut.rs:LL:CC
+   = note: inside `main` at tests/fail/tree_borrows/return_invalid_mut.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/tree_borrows/spurious_read.stderr b/src/tools/miri/tests/fail/tree_borrows/spurious_read.stderr
index f3934d4cbe5..bd26b4e36df 100644
--- a/src/tools/miri/tests/fail/tree_borrows/spurious_read.stderr
+++ b/src/tools/miri/tests/fail/tree_borrows/spurious_read.stderr
@@ -12,7 +12,7 @@ Thread 2 executing: write y
 Thread 1 executing: write y
 Thread 1 executing: ret y
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/spurious_read.rs:LL:CC
+  --> tests/fail/tree_borrows/spurious_read.rs:LL:CC
    |
 LL |                 *y = 2;
    |                 ^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
@@ -20,20 +20,20 @@ LL |                 *y = 2;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Reserved (conflicted) which forbids this child write access
 help: the accessed tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/spurious_read.rs:LL:CC
+  --> tests/fail/tree_borrows/spurious_read.rs:LL:CC
    |
 LL |         fn as_mut(y: &mut u8, b: (usize, Arc<Barrier>)) -> *mut u8 {
    |                   ^
 help: the accessed tag <TAG> later transitioned to Reserved (conflicted) due to a protector release (acting as a foreign read access) on every location previously accessed by this tag
-  --> $DIR/spurious_read.rs:LL:CC
+  --> tests/fail/tree_borrows/spurious_read.rs:LL:CC
    |
 LL |         }
    |          ^
    = help: this transition corresponds to a temporary loss of write permissions until function exit
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside `retagx_retagy_retx_writey_rety::{closure#1}::as_mut` at $DIR/spurious_read.rs:LL:CC
+   = note: inside `retagx_retagy_retx_writey_rety::{closure#1}::as_mut` at tests/fail/tree_borrows/spurious_read.rs:LL:CC
 note: inside closure
-  --> $DIR/spurious_read.rs:LL:CC
+  --> tests/fail/tree_borrows/spurious_read.rs:LL:CC
    |
 LL |         let _y = as_mut(unsafe { &mut *ptr.0 }, b.clone());
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/tree_borrows/strongly-protected.stderr b/src/tools/miri/tests/fail/tree_borrows/strongly-protected.stderr
index 2a7f69ff202..f6197a2acb3 100644
--- a/src/tools/miri/tests/fail/tree_borrows/strongly-protected.stderr
+++ b/src/tools/miri/tests/fail/tree_borrows/strongly-protected.stderr
@@ -8,12 +8,12 @@ LL |                 self.1.deallocate(From::from(ptr.cast()), layout);
    = help: the allocation of the accessed tag <TAG> also contains the strongly protected tag <TAG>
    = help: the strongly protected tag <TAG> disallows deallocations
 help: the accessed tag <TAG> was created here
-  --> $DIR/strongly-protected.rs:LL:CC
+  --> tests/fail/tree_borrows/strongly-protected.rs:LL:CC
    |
 LL |         drop(unsafe { Box::from_raw(raw) });
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: the strongly protected tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/strongly-protected.rs:LL:CC
+  --> tests/fail/tree_borrows/strongly-protected.rs:LL:CC
    |
 LL | fn inner(x: &mut i32, f: fn(*mut i32)) {
    |          ^
@@ -22,18 +22,18 @@ LL | fn inner(x: &mut i32, f: fn(*mut i32)) {
    = note: inside `std::ptr::drop_in_place::<std::boxed::Box<i32>> - shim(Some(std::boxed::Box<i32>))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC
    = note: inside `std::mem::drop::<std::boxed::Box<i32>>` at RUSTLIB/core/src/mem/mod.rs:LL:CC
 note: inside closure
-  --> $DIR/strongly-protected.rs:LL:CC
+  --> tests/fail/tree_borrows/strongly-protected.rs:LL:CC
    |
 LL |         drop(unsafe { Box::from_raw(raw) });
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: inside `<{closure@$DIR/strongly-protected.rs:LL:CC} as std::ops::FnOnce<(*mut i32,)>>::call_once - shim` at RUSTLIB/core/src/ops/function.rs:LL:CC
+   = note: inside `<{closure@tests/fail/tree_borrows/strongly-protected.rs:LL:CC} as std::ops::FnOnce<(*mut i32,)>>::call_once - shim` at RUSTLIB/core/src/ops/function.rs:LL:CC
 note: inside `inner`
-  --> $DIR/strongly-protected.rs:LL:CC
+  --> tests/fail/tree_borrows/strongly-protected.rs:LL:CC
    |
 LL |     f(x)
    |     ^^^^
 note: inside `main`
-  --> $DIR/strongly-protected.rs:LL:CC
+  --> tests/fail/tree_borrows/strongly-protected.rs:LL:CC
    |
 LL | /     inner(Box::leak(Box::new(0)), |raw| {
 LL | |         drop(unsafe { Box::from_raw(raw) });
diff --git a/src/tools/miri/tests/fail/tree_borrows/unique.default.stderr b/src/tools/miri/tests/fail/tree_borrows/unique.default.stderr
index bce8cb011f6..c7d72f70f40 100644
--- a/src/tools/miri/tests/fail/tree_borrows/unique.default.stderr
+++ b/src/tools/miri/tests/fail/tree_borrows/unique.default.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/unique.rs:LL:CC
+  --> tests/fail/tree_borrows/unique.rs:LL:CC
    |
 LL |         *uniq.as_ptr() = 3;
    |         ^^^^^^^^^^^^^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
@@ -7,24 +7,24 @@ LL |         *uniq.as_ptr() = 3;
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Frozen which forbids this child write access
 help: the accessed tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/unique.rs:LL:CC
+  --> tests/fail/tree_borrows/unique.rs:LL:CC
    |
 LL |     let refmut = &mut data;
    |                  ^^^^^^^^^
 help: the accessed tag <TAG> later transitioned to Active due to a child write access at offsets [0x0..0x1]
-  --> $DIR/unique.rs:LL:CC
+  --> tests/fail/tree_borrows/unique.rs:LL:CC
    |
 LL |         *uniq.as_ptr() = 1; // activation
    |         ^^^^^^^^^^^^^^^^^^
    = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference
 help: the accessed tag <TAG> later transitioned to Frozen due to a foreign read access at offsets [0x0..0x1]
-  --> $DIR/unique.rs:LL:CC
+  --> tests/fail/tree_borrows/unique.rs:LL:CC
    |
 LL |         let _definitely_parent = data; // definitely Frozen by now
    |                                  ^^^^
    = help: this transition corresponds to a loss of write permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/unique.rs:LL:CC
+   = note: inside `main` at tests/fail/tree_borrows/unique.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/tree_borrows/unique.uniq.stderr b/src/tools/miri/tests/fail/tree_borrows/unique.uniq.stderr
index 7323cd1c5ad..4ecff3ea0e1 100644
--- a/src/tools/miri/tests/fail/tree_borrows/unique.uniq.stderr
+++ b/src/tools/miri/tests/fail/tree_borrows/unique.uniq.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/unique.rs:LL:CC
+  --> tests/fail/tree_borrows/unique.rs:LL:CC
    |
 LL |         *uniq.as_ptr() = 2;
    |         ^^^^^^^^^^^^^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
@@ -8,29 +8,29 @@ LL |         *uniq.as_ptr() = 2;
    = help: the accessed tag <TAG> is a child of the conflicting tag <TAG>
    = help: the conflicting tag <TAG> has state Frozen which forbids this child write access
 help: the accessed tag <TAG> was created here
-  --> $DIR/unique.rs:LL:CC
+  --> tests/fail/tree_borrows/unique.rs:LL:CC
    |
 LL |         *uniq.as_ptr() = 2;
    |          ^^^^^^^^^^^^^
 help: the conflicting tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/unique.rs:LL:CC
+  --> tests/fail/tree_borrows/unique.rs:LL:CC
    |
 LL |         let uniq = Unique::new_unchecked(rawptr);
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: the conflicting tag <TAG> later transitioned to Active due to a child write access at offsets [0x0..0x1]
-  --> $DIR/unique.rs:LL:CC
+  --> tests/fail/tree_borrows/unique.rs:LL:CC
    |
 LL |         *uniq.as_ptr() = 1; // activation
    |         ^^^^^^^^^^^^^^^^^^
    = help: this transition corresponds to the first write to a 2-phase borrowed mutable reference
 help: the conflicting tag <TAG> later transitioned to Frozen due to a foreign read access at offsets [0x0..0x1]
-  --> $DIR/unique.rs:LL:CC
+  --> tests/fail/tree_borrows/unique.rs:LL:CC
    |
 LL |         let _maybe_parent = *rawptr; // maybe becomes Frozen
    |                             ^^^^^^^
    = help: this transition corresponds to a loss of write permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `main` at $DIR/unique.rs:LL:CC
+   = note: inside `main` at tests/fail/tree_borrows/unique.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/tree_borrows/write-during-2phase.stderr b/src/tools/miri/tests/fail/tree_borrows/write-during-2phase.stderr
index 87589299cb1..b85aac7db76 100644
--- a/src/tools/miri/tests/fail/tree_borrows/write-during-2phase.stderr
+++ b/src/tools/miri/tests/fail/tree_borrows/write-during-2phase.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: reborrow through <TAG> at ALLOC[0x0] is forbidden
-  --> $DIR/write-during-2phase.rs:LL:CC
+  --> tests/fail/tree_borrows/write-during-2phase.rs:LL:CC
    |
 LL |     fn add(&mut self, n: u64) -> u64 {
    |            ^^^^^^^^^ reborrow through <TAG> at ALLOC[0x0] is forbidden
@@ -7,20 +7,20 @@ LL |     fn add(&mut self, n: u64) -> u64 {
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
    = help: the accessed tag <TAG> has state Disabled which forbids this reborrow (acting as a child read access)
 help: the accessed tag <TAG> was created here, in the initial state Reserved
-  --> $DIR/write-during-2phase.rs:LL:CC
+  --> tests/fail/tree_borrows/write-during-2phase.rs:LL:CC
    |
 LL |     let _res = f.add(unsafe {
    |                ^
 help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x0..0x8]
-  --> $DIR/write-during-2phase.rs:LL:CC
+  --> tests/fail/tree_borrows/write-during-2phase.rs:LL:CC
    |
 LL |         *inner = 42;
    |         ^^^^^^^^^^^
    = help: this transition corresponds to a loss of read and write permissions
    = note: BACKTRACE (of the first span):
-   = note: inside `Foo::add` at $DIR/write-during-2phase.rs:LL:CC
+   = note: inside `Foo::add` at tests/fail/tree_borrows/write-during-2phase.rs:LL:CC
 note: inside `main`
-  --> $DIR/write-during-2phase.rs:LL:CC
+  --> tests/fail/tree_borrows/write-during-2phase.rs:LL:CC
    |
 LL |       let _res = f.add(unsafe {
    |  ________________^
diff --git a/src/tools/miri/tests/fail/type-too-large.rs b/src/tools/miri/tests/fail/type-too-large.rs
index 81ecc6145d7..46e3ac2d6ca 100644
--- a/src/tools/miri/tests/fail/type-too-large.rs
+++ b/src/tools/miri/tests/fail/type-too-large.rs
@@ -1,4 +1,4 @@
-//@ignore-32bit
+//@ignore-bitwidth: 32
 
 fn main() {
     let _fat: [u8; (1 << 61) + (1 << 31)]; // ideally we'd error here, but we avoid computing the layout until absolutely necessary
diff --git a/src/tools/miri/tests/fail/type-too-large.stderr b/src/tools/miri/tests/fail/type-too-large.stderr
index b07bb84e348..15ad8f1764d 100644
--- a/src/tools/miri/tests/fail/type-too-large.stderr
+++ b/src/tools/miri/tests/fail/type-too-large.stderr
@@ -1,11 +1,11 @@
 error: post-monomorphization error: values of the type `[u8; 2305843011361177600]` are too big for the current architecture
-  --> $DIR/type-too-large.rs:LL:CC
+  --> tests/fail/type-too-large.rs:LL:CC
    |
 LL |     _fat = [0; (1u64 << 61) as usize + (1u64 << 31) as usize];
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ values of the type `[u8; 2305843011361177600]` are too big for the current architecture
    |
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/type-too-large.rs:LL:CC
+   = note: inside `main` at tests/fail/type-too-large.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/unaligned_pointers/alignment.stderr b/src/tools/miri/tests/fail/unaligned_pointers/alignment.stderr
index ca3d34661d3..8bbb4dfdb60 100644
--- a/src/tools/miri/tests/fail/unaligned_pointers/alignment.stderr
+++ b/src/tools/miri/tests/fail/unaligned_pointers/alignment.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required
-  --> $DIR/alignment.rs:LL:CC
+  --> tests/fail/unaligned_pointers/alignment.rs:LL:CC
    |
 LL |         *(x_ptr as *mut u32) = 42; *(x_ptr.add(1) as *mut u32) = 42;
    | ^ accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required
@@ -7,7 +7,7 @@ LL |         *(x_ptr as *mut u32) = 42; *(x_ptr.add(1) as *mut u32) = 42;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/alignment.rs:LL:CC
+   = note: inside `main` at tests/fail/unaligned_pointers/alignment.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/unaligned_pointers/atomic_unaligned.stderr b/src/tools/miri/tests/fail/unaligned_pointers/atomic_unaligned.stderr
index 161e8977bf4..a9da740be1d 100644
--- a/src/tools/miri/tests/fail/unaligned_pointers/atomic_unaligned.stderr
+++ b/src/tools/miri/tests/fail/unaligned_pointers/atomic_unaligned.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: accessing memory with alignment ALIGN, but alignment ALIGN is required
-  --> $DIR/atomic_unaligned.rs:LL:CC
+  --> tests/fail/unaligned_pointers/atomic_unaligned.rs:LL:CC
    |
 LL |         ::std::intrinsics::atomic_load_seqcst(zptr);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ accessing memory with alignment ALIGN, but alignment ALIGN is required
@@ -7,7 +7,7 @@ LL |         ::std::intrinsics::atomic_load_seqcst(zptr);
    = help: this usually indicates that your program performed an invalid operation and caused Undefined Behavior
    = help: but due to `-Zmiri-symbolic-alignment-check`, alignment errors can also be false positives
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/atomic_unaligned.rs:LL:CC
+   = note: inside `main` at tests/fail/unaligned_pointers/atomic_unaligned.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/unaligned_pointers/drop_in_place.stderr b/src/tools/miri/tests/fail/unaligned_pointers/drop_in_place.stderr
index 600028337fa..75efa5ff806 100644
--- a/src/tools/miri/tests/fail/unaligned_pointers/drop_in_place.stderr
+++ b/src/tools/miri/tests/fail/unaligned_pointers/drop_in_place.stderr
@@ -9,7 +9,7 @@ LL | pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
    = note: BACKTRACE:
    = note: inside `std::ptr::drop_in_place::<PartialDrop> - shim(Some(PartialDrop))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC
 note: inside `main`
-  --> $DIR/drop_in_place.rs:LL:CC
+  --> tests/fail/unaligned_pointers/drop_in_place.rs:LL:CC
    |
 LL |         core::ptr::drop_in_place(p);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/unaligned_pointers/dyn_alignment.stderr b/src/tools/miri/tests/fail/unaligned_pointers/dyn_alignment.stderr
index 05e30f833bb..72cded1c079 100644
--- a/src/tools/miri/tests/fail/unaligned_pointers/dyn_alignment.stderr
+++ b/src/tools/miri/tests/fail/unaligned_pointers/dyn_alignment.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered an unaligned reference (required ALIGN byte alignment but found ALIGN)
-  --> $DIR/dyn_alignment.rs:LL:CC
+  --> tests/fail/unaligned_pointers/dyn_alignment.rs:LL:CC
    |
 LL |         let _ptr = &*ptr;
    |                    ^^^^^ constructing invalid value: encountered an unaligned reference (required ALIGN byte alignment but found ALIGN)
@@ -7,7 +7,7 @@ LL |         let _ptr = &*ptr;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/dyn_alignment.rs:LL:CC
+   = note: inside `main` at tests/fail/unaligned_pointers/dyn_alignment.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment.stderr b/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment.stderr
index 9046502975d..04ecf618fc0 100644
--- a/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment.stderr
+++ b/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required
-  --> $DIR/field_requires_parent_struct_alignment.rs:LL:CC
+  --> tests/fail/unaligned_pointers/field_requires_parent_struct_alignment.rs:LL:CC
    |
 LL |     unsafe { (*x).x }
    |              ^^^^^^ accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required
@@ -7,9 +7,9 @@ LL |     unsafe { (*x).x }
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `foo` at $DIR/field_requires_parent_struct_alignment.rs:LL:CC
+   = note: inside `foo` at tests/fail/unaligned_pointers/field_requires_parent_struct_alignment.rs:LL:CC
 note: inside `main`
-  --> $DIR/field_requires_parent_struct_alignment.rs:LL:CC
+  --> tests/fail/unaligned_pointers/field_requires_parent_struct_alignment.rs:LL:CC
    |
 LL |         foo(odd_ptr.cast());
    |         ^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment2.stderr b/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment2.stderr
index 0d0057a79ab..da5a34a8dc6 100644
--- a/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment2.stderr
+++ b/src/tools/miri/tests/fail/unaligned_pointers/field_requires_parent_struct_alignment2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required
-  --> $DIR/field_requires_parent_struct_alignment2.rs:LL:CC
+  --> tests/fail/unaligned_pointers/field_requires_parent_struct_alignment2.rs:LL:CC
    |
 LL |     unsafe { (*x).packed.x }
    |              ^^^^^^^^^^^^^ accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required
@@ -7,9 +7,9 @@ LL |     unsafe { (*x).packed.x }
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `foo` at $DIR/field_requires_parent_struct_alignment2.rs:LL:CC
+   = note: inside `foo` at tests/fail/unaligned_pointers/field_requires_parent_struct_alignment2.rs:LL:CC
 note: inside `main`
-  --> $DIR/field_requires_parent_struct_alignment2.rs:LL:CC
+  --> tests/fail/unaligned_pointers/field_requires_parent_struct_alignment2.rs:LL:CC
    |
 LL |         foo(odd_ptr.cast());
    |         ^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/unaligned_pointers/intptrcast_alignment_check.stderr b/src/tools/miri/tests/fail/unaligned_pointers/intptrcast_alignment_check.stderr
index 318004da601..e0e866b25c8 100644
--- a/src/tools/miri/tests/fail/unaligned_pointers/intptrcast_alignment_check.stderr
+++ b/src/tools/miri/tests/fail/unaligned_pointers/intptrcast_alignment_check.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required
-  --> $DIR/intptrcast_alignment_check.rs:LL:CC
+  --> tests/fail/unaligned_pointers/intptrcast_alignment_check.rs:LL:CC
    |
 LL |     unsafe { *u16_ptr = 2 };
    |              ^^^^^^^^^^^^ accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required
@@ -7,7 +7,7 @@ LL |     unsafe { *u16_ptr = 2 };
    = help: this usually indicates that your program performed an invalid operation and caused Undefined Behavior
    = help: but due to `-Zmiri-symbolic-alignment-check`, alignment errors can also be false positives
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/intptrcast_alignment_check.rs:LL:CC
+   = note: inside `main` at tests/fail/unaligned_pointers/intptrcast_alignment_check.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment.call_unaligned_ptr.stderr b/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment.call_unaligned_ptr.stderr
index 6d62db4d3d5..91df7cf47a7 100644
--- a/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment.call_unaligned_ptr.stderr
+++ b/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment.call_unaligned_ptr.stderr
@@ -1,12 +1,12 @@
 error: unsupported operation: `miri_promise_symbolic_alignment`: pointer is not actually aligned
-  --> $DIR/promise_alignment.rs:LL:CC
+  --> tests/fail/unaligned_pointers/promise_alignment.rs:LL:CC
    |
 LL |         unsafe { utils::miri_promise_symbolic_alignment(align8.add(1).cast(), 8) };
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `miri_promise_symbolic_alignment`: pointer is not actually aligned
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/promise_alignment.rs:LL:CC
+   = note: inside `main` at tests/fail/unaligned_pointers/promise_alignment.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment.read_unaligned_ptr.stderr b/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment.read_unaligned_ptr.stderr
index 0842ccd6d5b..1e984aa3efd 100644
--- a/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment.read_unaligned_ptr.stderr
+++ b/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment.read_unaligned_ptr.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required
-  --> $DIR/promise_alignment.rs:LL:CC
+  --> tests/fail/unaligned_pointers/promise_alignment.rs:LL:CC
    |
 LL |         let _val = unsafe { align8.cast::<Align16>().read() };
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required
@@ -7,7 +7,7 @@ LL |         let _val = unsafe { align8.cast::<Align16>().read() };
    = help: this usually indicates that your program performed an invalid operation and caused Undefined Behavior
    = help: but due to `-Zmiri-symbolic-alignment-check`, alignment errors can also be false positives
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/promise_alignment.rs:LL:CC
+   = note: inside `main` at tests/fail/unaligned_pointers/promise_alignment.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment_zero.stderr b/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment_zero.stderr
index 3f7ced0b407..c687d998613 100644
--- a/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment_zero.stderr
+++ b/src/tools/miri/tests/fail/unaligned_pointers/promise_alignment_zero.stderr
@@ -1,12 +1,12 @@
 error: unsupported operation: `miri_promise_symbolic_alignment`: alignment must be a power of 2, got 0
-  --> $DIR/promise_alignment_zero.rs:LL:CC
+  --> tests/fail/unaligned_pointers/promise_alignment_zero.rs:LL:CC
    |
 LL |     unsafe { utils::miri_promise_symbolic_alignment(buffer.as_ptr().cast(), 0) };
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `miri_promise_symbolic_alignment`: alignment must be a power of 2, got 0
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/promise_alignment_zero.rs:LL:CC
+   = note: inside `main` at tests/fail/unaligned_pointers/promise_alignment_zero.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/unaligned_pointers/reference_to_packed.stderr b/src/tools/miri/tests/fail/unaligned_pointers/reference_to_packed.stderr
index 938a0375729..9adbd7f8153 100644
--- a/src/tools/miri/tests/fail/unaligned_pointers/reference_to_packed.stderr
+++ b/src/tools/miri/tests/fail/unaligned_pointers/reference_to_packed.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered an unaligned reference (required ALIGN byte alignment but found ALIGN)
-  --> $DIR/reference_to_packed.rs:LL:CC
+  --> tests/fail/unaligned_pointers/reference_to_packed.rs:LL:CC
    |
 LL |     mem::transmute(x)
    |     ^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required ALIGN byte alignment but found ALIGN)
@@ -7,9 +7,9 @@ LL |     mem::transmute(x)
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `raw_to_ref::<'_, i32>` at $DIR/reference_to_packed.rs:LL:CC
+   = note: inside `raw_to_ref::<'_, i32>` at tests/fail/unaligned_pointers/reference_to_packed.rs:LL:CC
 note: inside `main`
-  --> $DIR/reference_to_packed.rs:LL:CC
+  --> tests/fail/unaligned_pointers/reference_to_packed.rs:LL:CC
    |
 LL |         let p: &i32 = unsafe { raw_to_ref(ptr::addr_of!(foo.x)) };
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr1.stderr b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr1.stderr
index ae3be1ed3af..90cfb4245c8 100644
--- a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr1.stderr
+++ b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required
-  --> $DIR/unaligned_ptr1.rs:LL:CC
+  --> tests/fail/unaligned_pointers/unaligned_ptr1.rs:LL:CC
    |
 LL |         let _x = unsafe { *x };
    |                           ^^ accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required
@@ -7,7 +7,7 @@ LL |         let _x = unsafe { *x };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unaligned_ptr1.rs:LL:CC
+   = note: inside `main` at tests/fail/unaligned_pointers/unaligned_ptr1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr2.stderr b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr2.stderr
index 2b926027498..57ac8553930 100644
--- a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr2.stderr
+++ b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required
-  --> $DIR/unaligned_ptr2.rs:LL:CC
+  --> tests/fail/unaligned_pointers/unaligned_ptr2.rs:LL:CC
    |
 LL |     let _x = unsafe { *x };
    |                       ^^ accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required
@@ -7,7 +7,7 @@ LL |     let _x = unsafe { *x };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unaligned_ptr2.rs:LL:CC
+   = note: inside `main` at tests/fail/unaligned_pointers/unaligned_ptr2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr3.stderr b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr3.stderr
index 5ac4e23bf01..d8ab546af6a 100644
--- a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr3.stderr
+++ b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr3.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required
-  --> $DIR/unaligned_ptr3.rs:LL:CC
+  --> tests/fail/unaligned_pointers/unaligned_ptr3.rs:LL:CC
    |
 LL |         let _x = unsafe { *x };
    |                           ^^ accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required
@@ -7,7 +7,7 @@ LL |         let _x = unsafe { *x };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unaligned_ptr3.rs:LL:CC
+   = note: inside `main` at tests/fail/unaligned_pointers/unaligned_ptr3.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr4.stderr b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr4.stderr
index 4de90118b4b..5fe342c9b31 100644
--- a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr4.stderr
+++ b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr4.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required
-  --> $DIR/unaligned_ptr4.rs:LL:CC
+  --> tests/fail/unaligned_pointers/unaligned_ptr4.rs:LL:CC
    |
 LL |         let _val = unsafe { *ptr };
    |                             ^^^^ accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required
@@ -7,7 +7,7 @@ LL |         let _val = unsafe { *ptr };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unaligned_ptr4.rs:LL:CC
+   = note: inside `main` at tests/fail/unaligned_pointers/unaligned_ptr4.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr_zst.stderr b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr_zst.stderr
index 72db125074b..1ae8d954882 100644
--- a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr_zst.stderr
+++ b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr_zst.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required
-  --> $DIR/unaligned_ptr_zst.rs:LL:CC
+  --> tests/fail/unaligned_pointers/unaligned_ptr_zst.rs:LL:CC
    |
 LL |         let _x = unsafe { *x };
    |                           ^^ accessing memory based on pointer with alignment ALIGN, but alignment ALIGN is required
@@ -7,7 +7,7 @@ LL |         let _x = unsafe { *x };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unaligned_ptr_zst.rs:LL:CC
+   = note: inside `main` at tests/fail/unaligned_pointers/unaligned_ptr_zst.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ref_addr_of.stderr b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ref_addr_of.stderr
index 448023a2a3d..d7561c57a8c 100644
--- a/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ref_addr_of.stderr
+++ b/src/tools/miri/tests/fail/unaligned_pointers/unaligned_ref_addr_of.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered an unaligned reference (required ALIGN byte alignment but found ALIGN)
-  --> $DIR/unaligned_ref_addr_of.rs:LL:CC
+  --> tests/fail/unaligned_pointers/unaligned_ref_addr_of.rs:LL:CC
    |
 LL |         let _x = unsafe { &*x };
    |                           ^^^ constructing invalid value: encountered an unaligned reference (required ALIGN byte alignment but found ALIGN)
@@ -7,7 +7,7 @@ LL |         let _x = unsafe { &*x };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unaligned_ref_addr_of.rs:LL:CC
+   = note: inside `main` at tests/fail/unaligned_pointers/unaligned_ref_addr_of.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/uninit/padding-enum.stderr b/src/tools/miri/tests/fail/uninit/padding-enum.stderr
index 312cf6d20fa..66d3092c9ba 100644
--- a/src/tools/miri/tests/fail/uninit/padding-enum.stderr
+++ b/src/tools/miri/tests/fail/uninit/padding-enum.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
-  --> $DIR/padding-enum.rs:LL:CC
+  --> tests/fail/uninit/padding-enum.rs:LL:CC
    |
 LL |         let _val = *c.add(0);
    |                    ^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
@@ -7,7 +7,7 @@ LL |         let _val = *c.add(0);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/padding-enum.rs:LL:CC
+   = note: inside `main` at tests/fail/uninit/padding-enum.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/uninit/padding-pair.stderr b/src/tools/miri/tests/fail/uninit/padding-pair.stderr
index d35934d83d5..f4ce802b157 100644
--- a/src/tools/miri/tests/fail/uninit/padding-pair.stderr
+++ b/src/tools/miri/tests/fail/uninit/padding-pair.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
-  --> $DIR/padding-pair.rs:LL:CC
+  --> tests/fail/uninit/padding-pair.rs:LL:CC
    |
 LL |     let v = unsafe { *z.offset(first_undef) };
    |                      ^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
@@ -7,7 +7,7 @@ LL |     let v = unsafe { *z.offset(first_undef) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/padding-pair.rs:LL:CC
+   = note: inside `main` at tests/fail/uninit/padding-pair.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/uninit/padding-struct-in-union.stderr b/src/tools/miri/tests/fail/uninit/padding-struct-in-union.stderr
index e122249af16..5e9dabd5644 100644
--- a/src/tools/miri/tests/fail/uninit/padding-struct-in-union.stderr
+++ b/src/tools/miri/tests/fail/uninit/padding-struct-in-union.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value at .bytes[2]: encountered uninitialized memory, but expected an integer
-  --> $DIR/padding-struct-in-union.rs:LL:CC
+  --> tests/fail/uninit/padding-struct-in-union.rs:LL:CC
    |
 LL |     let _val = unsafe { (foobar.foo, foobar.bar) };
    |                                      ^^^^^^^^^^ constructing invalid value at .bytes[2]: encountered uninitialized memory, but expected an integer
@@ -7,7 +7,7 @@ LL |     let _val = unsafe { (foobar.foo, foobar.bar) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/padding-struct-in-union.rs:LL:CC
+   = note: inside `main` at tests/fail/uninit/padding-struct-in-union.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/uninit/padding-struct.stderr b/src/tools/miri/tests/fail/uninit/padding-struct.stderr
index 19e3969279b..f27783c17e9 100644
--- a/src/tools/miri/tests/fail/uninit/padding-struct.stderr
+++ b/src/tools/miri/tests/fail/uninit/padding-struct.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
-  --> $DIR/padding-struct.rs:LL:CC
+  --> tests/fail/uninit/padding-struct.rs:LL:CC
    |
 LL |         let _val = *c.add(1);
    |                    ^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
@@ -7,7 +7,7 @@ LL |         let _val = *c.add(1);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/padding-struct.rs:LL:CC
+   = note: inside `main` at tests/fail/uninit/padding-struct.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/uninit/padding-union.stderr b/src/tools/miri/tests/fail/uninit/padding-union.stderr
index 61a8d1c6ba6..248b06a14fe 100644
--- a/src/tools/miri/tests/fail/uninit/padding-union.stderr
+++ b/src/tools/miri/tests/fail/uninit/padding-union.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value at [1]: encountered uninitialized memory, but expected an integer
-  --> $DIR/padding-union.rs:LL:CC
+  --> tests/fail/uninit/padding-union.rs:LL:CC
    |
 LL |         let _val = *c;
    |                    ^^ constructing invalid value at [1]: encountered uninitialized memory, but expected an integer
@@ -7,7 +7,7 @@ LL |         let _val = *c;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/padding-union.rs:LL:CC
+   = note: inside `main` at tests/fail/uninit/padding-union.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/uninit/padding-wide-ptr.stderr b/src/tools/miri/tests/fail/uninit/padding-wide-ptr.stderr
index 24194c4b02a..219bee45fe8 100644
--- a/src/tools/miri/tests/fail/uninit/padding-wide-ptr.stderr
+++ b/src/tools/miri/tests/fail/uninit/padding-wide-ptr.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
-  --> $DIR/padding-wide-ptr.rs:LL:CC
+  --> tests/fail/uninit/padding-wide-ptr.rs:LL:CC
    |
 LL |         let _val = *c.add(mem::size_of::<*const u8>());
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
@@ -7,7 +7,7 @@ LL |         let _val = *c.add(mem::size_of::<*const u8>());
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/padding-wide-ptr.rs:LL:CC
+   = note: inside `main` at tests/fail/uninit/padding-wide-ptr.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/uninit/transmute-pair-uninit.stderr b/src/tools/miri/tests/fail/uninit/transmute-pair-uninit.stderr
index 30306054fbb..7fe88df560c 100644
--- a/src/tools/miri/tests/fail/uninit/transmute-pair-uninit.stderr
+++ b/src/tools/miri/tests/fail/uninit/transmute-pair-uninit.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
-  --> $DIR/transmute-pair-uninit.rs:LL:CC
+  --> tests/fail/uninit/transmute-pair-uninit.rs:LL:CC
    |
 LL |     let v = unsafe { *z.offset(first_undef) };
    |                      ^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
@@ -7,7 +7,7 @@ LL |     let v = unsafe { *z.offset(first_undef) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/transmute-pair-uninit.rs:LL:CC
+   = note: inside `main` at tests/fail/uninit/transmute-pair-uninit.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/uninit/uninit-after-aggregate-assign.stderr b/src/tools/miri/tests/fail/uninit/uninit-after-aggregate-assign.stderr
index 5f3d9bde1f2..ec6ba3fea7d 100644
--- a/src/tools/miri/tests/fail/uninit/uninit-after-aggregate-assign.stderr
+++ b/src/tools/miri/tests/fail/uninit/uninit-after-aggregate-assign.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value at [1]: encountered uninitialized memory, but expected an integer
-  --> $DIR/uninit-after-aggregate-assign.rs:LL:CC
+  --> tests/fail/uninit/uninit-after-aggregate-assign.rs:LL:CC
    |
 LL |             _val = *sptr2; // should hence be UB
    |             ^^^^^^^^^^^^^ constructing invalid value at [1]: encountered uninitialized memory, but expected an integer
@@ -7,7 +7,7 @@ LL |             _val = *sptr2; // should hence be UB
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/uninit-after-aggregate-assign.rs:LL:CC
+   = note: inside `main` at tests/fail/uninit/uninit-after-aggregate-assign.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic.stderr b/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic.stderr
index dfe3ed4b522..0996e5d11ef 100644
--- a/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic.stderr
+++ b/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic.stderr
@@ -10,7 +10,7 @@ LL |         let mut order = unsafe { compare_bytes(left, right, len) as isize }
    = note: inside `<u8 as core::slice::cmp::SliceOrd>::compare` at RUSTLIB/core/src/slice/cmp.rs:LL:CC
    = note: inside `core::slice::cmp::<impl std::cmp::Ord for [u8]>::cmp` at RUSTLIB/core/src/slice/cmp.rs:LL:CC
 note: inside `main`
-  --> $DIR/uninit_alloc_diagnostic.rs:LL:CC
+  --> tests/fail/uninit/uninit_alloc_diagnostic.rs:LL:CC
    |
 LL |         drop(slice1.cmp(slice2));
    |              ^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic_with_provenance.stderr b/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic_with_provenance.stderr
index 48ce9ae7656..bcde9377c54 100644
--- a/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic_with_provenance.stderr
+++ b/src/tools/miri/tests/fail/uninit/uninit_alloc_diagnostic_with_provenance.stderr
@@ -10,7 +10,7 @@ LL |         let mut order = unsafe { compare_bytes(left, right, len) as isize }
    = note: inside `<u8 as core::slice::cmp::SliceOrd>::compare` at RUSTLIB/core/src/slice/cmp.rs:LL:CC
    = note: inside `core::slice::cmp::<impl std::cmp::Ord for [u8]>::cmp` at RUSTLIB/core/src/slice/cmp.rs:LL:CC
 note: inside `main`
-  --> $DIR/uninit_alloc_diagnostic_with_provenance.rs:LL:CC
+  --> tests/fail/uninit/uninit_alloc_diagnostic_with_provenance.rs:LL:CC
    |
 LL |         drop(slice1.cmp(slice2));
    |              ^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/uninit/uninit_byte_read.stderr b/src/tools/miri/tests/fail/uninit/uninit_byte_read.stderr
index 3917d868289..5da89976b03 100644
--- a/src/tools/miri/tests/fail/uninit/uninit_byte_read.stderr
+++ b/src/tools/miri/tests/fail/uninit/uninit_byte_read.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
-  --> $DIR/uninit_byte_read.rs:LL:CC
+  --> tests/fail/uninit/uninit_byte_read.rs:LL:CC
    |
 LL |     let undef = unsafe { *v.as_ptr().add(5) };
    |                          ^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
@@ -7,7 +7,7 @@ LL |     let undef = unsafe { *v.as_ptr().add(5) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/uninit_byte_read.rs:LL:CC
+   = note: inside `main` at tests/fail/uninit/uninit_byte_read.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/unreachable.stderr b/src/tools/miri/tests/fail/unreachable.stderr
index f6982dc8653..46c956ff77e 100644
--- a/src/tools/miri/tests/fail/unreachable.stderr
+++ b/src/tools/miri/tests/fail/unreachable.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: entering unreachable code
-  --> $DIR/unreachable.rs:LL:CC
+  --> tests/fail/unreachable.rs:LL:CC
    |
 LL |     unsafe { std::hint::unreachable_unchecked() }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ entering unreachable code
@@ -7,7 +7,7 @@ LL |     unsafe { std::hint::unreachable_unchecked() }
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unreachable.rs:LL:CC
+   = note: inside `main` at tests/fail/unreachable.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/unsized-local.stderr b/src/tools/miri/tests/fail/unsized-local.stderr
index df54c98bb0e..548f3d66c73 100644
--- a/src/tools/miri/tests/fail/unsized-local.stderr
+++ b/src/tools/miri/tests/fail/unsized-local.stderr
@@ -1,12 +1,12 @@
 error: unsupported operation: unsized locals are not supported
-  --> $DIR/unsized-local.rs:LL:CC
+  --> tests/fail/unsized-local.rs:LL:CC
    |
 LL |     let x = *(Box::new(A) as Box<dyn Foo>);
    |         ^ unsized locals are not supported
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unsized-local.rs:LL:CC
+   = note: inside `main` at tests/fail/unsized-local.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/unsupported_foreign_function.stderr b/src/tools/miri/tests/fail/unsupported_foreign_function.stderr
index f392e9564c7..4fe45b0868a 100644
--- a/src/tools/miri/tests/fail/unsupported_foreign_function.stderr
+++ b/src/tools/miri/tests/fail/unsupported_foreign_function.stderr
@@ -1,5 +1,5 @@
 error: unsupported operation: can't call foreign function `foo` on $OS
-  --> $DIR/unsupported_foreign_function.rs:LL:CC
+  --> tests/fail/unsupported_foreign_function.rs:LL:CC
    |
 LL |         foo();
    |         ^^^^^ can't call foreign function `foo` on $OS
@@ -7,7 +7,7 @@ LL |         foo();
    = help: if this is a basic API commonly used on this target, please report an issue with Miri
    = help: however, note that Miri does not aim to support every FFI function out there; for instance, we will not support APIs for things such as GUIs, scripting languages, or databases
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/unsupported_foreign_function.rs:LL:CC
+   = note: inside `main` at tests/fail/unsupported_foreign_function.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/unwind-action-terminate.stderr b/src/tools/miri/tests/fail/unwind-action-terminate.stderr
index fd67bdf4a90..81837122051 100644
--- a/src/tools/miri/tests/fail/unwind-action-terminate.stderr
+++ b/src/tools/miri/tests/fail/unwind-action-terminate.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at $DIR/unwind-action-terminate.rs:LL:CC:
+thread 'main' panicked at tests/fail/unwind-action-terminate.rs:LL:CC:
 explicit panic
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
@@ -21,14 +21,14 @@ LL |     ABORT();
    = note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC
    = note: inside `core::panicking::panic_cannot_unwind` at RUSTLIB/core/src/panicking.rs:LL:CC
 note: inside `panic_abort`
-  --> $DIR/unwind-action-terminate.rs:LL:CC
+  --> tests/fail/unwind-action-terminate.rs:LL:CC
    |
 LL | / extern "C" fn panic_abort() {
 LL | |     panic!()
 LL | | }
    | |_^
 note: inside `main`
-  --> $DIR/unwind-action-terminate.rs:LL:CC
+  --> tests/fail/unwind-action-terminate.rs:LL:CC
    |
 LL |     panic_abort();
    | ^
diff --git a/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_callee_arg.stderr b/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_callee_arg.stderr
index f526f77a4f0..9b6b7098e5c 100644
--- a/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_callee_arg.stderr
+++ b/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_callee_arg.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered a null reference
-  --> $DIR/cast_fn_ptr_invalid_callee_arg.rs:LL:CC
+  --> tests/fail/validity/cast_fn_ptr_invalid_callee_arg.rs:LL:CC
    |
 LL |     g(0usize as *const i32)
    |     ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null reference
@@ -7,7 +7,7 @@ LL |     g(0usize as *const i32)
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/cast_fn_ptr_invalid_callee_arg.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/cast_fn_ptr_invalid_callee_arg.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_callee_ret.stderr b/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_callee_ret.stderr
index 35de4535222..a0b7cc7a521 100644
--- a/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_callee_ret.stderr
+++ b/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_callee_ret.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value at .0: encountered 0, but expected something greater or equal to 1
-  --> $DIR/cast_fn_ptr_invalid_callee_ret.rs:LL:CC
+  --> tests/fail/validity/cast_fn_ptr_invalid_callee_ret.rs:LL:CC
    |
 LL |     f();
    |     ^^^ constructing invalid value at .0: encountered 0, but expected something greater or equal to 1
@@ -7,7 +7,7 @@ LL |     f();
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/cast_fn_ptr_invalid_callee_ret.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/cast_fn_ptr_invalid_callee_ret.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_arg.stderr b/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_arg.stderr
index 81d775f6d7f..6af0e72b9c4 100644
--- a/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_arg.stderr
+++ b/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_arg.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value at .0: encountered 0, but expected something greater or equal to 1
-  --> $DIR/cast_fn_ptr_invalid_caller_arg.rs:LL:CC
+  --> tests/fail/validity/cast_fn_ptr_invalid_caller_arg.rs:LL:CC
    |
 LL |             Call(_res = f(*ptr), ReturnTo(retblock), UnwindContinue())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0, but expected something greater or equal to 1
@@ -7,9 +7,9 @@ LL |             Call(_res = f(*ptr), ReturnTo(retblock), UnwindContinue())
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `call` at $DIR/cast_fn_ptr_invalid_caller_arg.rs:LL:CC
+   = note: inside `call` at tests/fail/validity/cast_fn_ptr_invalid_caller_arg.rs:LL:CC
 note: inside `main`
-  --> $DIR/cast_fn_ptr_invalid_caller_arg.rs:LL:CC
+  --> tests/fail/validity/cast_fn_ptr_invalid_caller_arg.rs:LL:CC
    |
 LL |     call(f);
    |     ^^^^^^^
diff --git a/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_ret.stderr b/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_ret.stderr
index 7593b8a3998..c02651c7cc9 100644
--- a/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_ret.stderr
+++ b/src/tools/miri/tests/fail/validity/cast_fn_ptr_invalid_caller_ret.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered a null reference
-  --> $DIR/cast_fn_ptr_invalid_caller_ret.rs:LL:CC
+  --> tests/fail/validity/cast_fn_ptr_invalid_caller_ret.rs:LL:CC
    |
 LL |     let _x = g();
    |              ^^^ constructing invalid value: encountered a null reference
@@ -7,7 +7,7 @@ LL |     let _x = g();
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/cast_fn_ptr_invalid_caller_ret.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/cast_fn_ptr_invalid_caller_ret.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/dangling_ref1.stderr b/src/tools/miri/tests/fail/validity/dangling_ref1.stderr
index fd4dd502bd5..09634e5ae7b 100644
--- a/src/tools/miri/tests/fail/validity/dangling_ref1.stderr
+++ b/src/tools/miri/tests/fail/validity/dangling_ref1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered a dangling reference (0x10[noalloc] has no provenance)
-  --> $DIR/dangling_ref1.rs:LL:CC
+  --> tests/fail/validity/dangling_ref1.rs:LL:CC
    |
 LL |     let _x: &i32 = unsafe { mem::transmute(16usize) };
    |                             ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (0x10[noalloc] has no provenance)
@@ -7,7 +7,7 @@ LL |     let _x: &i32 = unsafe { mem::transmute(16usize) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/dangling_ref1.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/dangling_ref1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/dangling_ref2.stderr b/src/tools/miri/tests/fail/validity/dangling_ref2.stderr
index 2d45ae68ca4..fe7fe2795ef 100644
--- a/src/tools/miri/tests/fail/validity/dangling_ref2.stderr
+++ b/src/tools/miri/tests/fail/validity/dangling_ref2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
-  --> $DIR/dangling_ref2.rs:LL:CC
+  --> tests/fail/validity/dangling_ref2.rs:LL:CC
    |
 LL |     let _x: &i32 = unsafe { mem::transmute(ptr) };
    |                             ^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
@@ -7,7 +7,7 @@ LL |     let _x: &i32 = unsafe { mem::transmute(ptr) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/dangling_ref2.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/dangling_ref2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/dangling_ref3.stderr b/src/tools/miri/tests/fail/validity/dangling_ref3.stderr
index 5ac4f5deffe..fe40aaa122f 100644
--- a/src/tools/miri/tests/fail/validity/dangling_ref3.stderr
+++ b/src/tools/miri/tests/fail/validity/dangling_ref3.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered a dangling reference (use-after-free)
-  --> $DIR/dangling_ref3.rs:LL:CC
+  --> tests/fail/validity/dangling_ref3.rs:LL:CC
    |
 LL |     let _x: &i32 = unsafe { mem::transmute(dangling()) };
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (use-after-free)
@@ -7,7 +7,7 @@ LL |     let _x: &i32 = unsafe { mem::transmute(dangling()) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/dangling_ref3.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/dangling_ref3.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/invalid_bool.stderr b/src/tools/miri/tests/fail/validity/invalid_bool.stderr
index 3ed823dde94..9bed0f716a0 100644
--- a/src/tools/miri/tests/fail/validity/invalid_bool.stderr
+++ b/src/tools/miri/tests/fail/validity/invalid_bool.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered 0x02, but expected a boolean
-  --> $DIR/invalid_bool.rs:LL:CC
+  --> tests/fail/validity/invalid_bool.rs:LL:CC
    |
 LL |     let _b = unsafe { std::mem::transmute::<u8, bool>(2) };
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x02, but expected a boolean
@@ -7,7 +7,7 @@ LL |     let _b = unsafe { std::mem::transmute::<u8, bool>(2) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/invalid_bool.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/invalid_bool.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/invalid_bool_op.stderr b/src/tools/miri/tests/fail/validity/invalid_bool_op.stderr
index b938d29e760..ee84762fe40 100644
--- a/src/tools/miri/tests/fail/validity/invalid_bool_op.stderr
+++ b/src/tools/miri/tests/fail/validity/invalid_bool_op.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: interpreting an invalid 8-bit value as a bool: 0x02
-  --> $DIR/invalid_bool_op.rs:LL:CC
+  --> tests/fail/validity/invalid_bool_op.rs:LL:CC
    |
 LL |     let _x = b == std::hint::black_box(true);
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ interpreting an invalid 8-bit value as a bool: 0x02
@@ -7,7 +7,7 @@ LL |     let _x = b == std::hint::black_box(true);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/invalid_bool_op.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/invalid_bool_op.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/invalid_bool_uninit.stderr b/src/tools/miri/tests/fail/validity/invalid_bool_uninit.stderr
index 314416766a5..487e3714b72 100644
--- a/src/tools/miri/tests/fail/validity/invalid_bool_uninit.stderr
+++ b/src/tools/miri/tests/fail/validity/invalid_bool_uninit.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value at [0]: encountered uninitialized memory, but expected a boolean
-  --> $DIR/invalid_bool_uninit.rs:LL:CC
+  --> tests/fail/validity/invalid_bool_uninit.rs:LL:CC
    |
 LL |     let _b = unsafe { MyUninit { init: () }.uninit };
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered uninitialized memory, but expected a boolean
@@ -7,7 +7,7 @@ LL |     let _b = unsafe { MyUninit { init: () }.uninit };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/invalid_bool_uninit.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/invalid_bool_uninit.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/invalid_char.stderr b/src/tools/miri/tests/fail/validity/invalid_char.stderr
index c761669c6db..5d258176cb6 100644
--- a/src/tools/miri/tests/fail/validity/invalid_char.stderr
+++ b/src/tools/miri/tests/fail/validity/invalid_char.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered $HEX, but expected a valid unicode scalar value (in `0..=$HEX` but not in `$HEX..=$HEX`)
-  --> $DIR/invalid_char.rs:LL:CC
+  --> tests/fail/validity/invalid_char.rs:LL:CC
    |
 LL |     let _val = match unsafe { std::mem::transmute::<i32, char>(-1) } {
    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered $HEX, but expected a valid unicode scalar value (in `0..=$HEX` but not in `$HEX..=$HEX`)
@@ -7,7 +7,7 @@ LL |     let _val = match unsafe { std::mem::transmute::<i32, char>(-1) } {
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/invalid_char.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/invalid_char.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/invalid_char_cast.stderr b/src/tools/miri/tests/fail/validity/invalid_char_cast.stderr
index 1b5c838cf46..b88f9f77208 100644
--- a/src/tools/miri/tests/fail/validity/invalid_char_cast.stderr
+++ b/src/tools/miri/tests/fail/validity/invalid_char_cast.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: interpreting an invalid 32-bit value as a char: $HEX
-  --> $DIR/invalid_char_cast.rs:LL:CC
+  --> tests/fail/validity/invalid_char_cast.rs:LL:CC
    |
 LL |             RET = *ptr as u32;
    |             ^^^^^^^^^^^^^^^^^ interpreting an invalid 32-bit value as a char: $HEX
@@ -7,9 +7,9 @@ LL |             RET = *ptr as u32;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `cast` at $DIR/invalid_char_cast.rs:LL:CC
+   = note: inside `cast` at tests/fail/validity/invalid_char_cast.rs:LL:CC
 note: inside `main`
-  --> $DIR/invalid_char_cast.rs:LL:CC
+  --> tests/fail/validity/invalid_char_cast.rs:LL:CC
    |
 LL |     cast(&v as *const u32 as *const char);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/validity/invalid_char_match.stderr b/src/tools/miri/tests/fail/validity/invalid_char_match.stderr
index 7706ed97316..9ce1631e67f 100644
--- a/src/tools/miri/tests/fail/validity/invalid_char_match.stderr
+++ b/src/tools/miri/tests/fail/validity/invalid_char_match.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: interpreting an invalid 32-bit value as a char: $HEX
-  --> $DIR/invalid_char_match.rs:LL:CC
+  --> tests/fail/validity/invalid_char_match.rs:LL:CC
    |
 LL | /             match *ptr {
 LL | |                 '0' => ret,
@@ -10,9 +10,9 @@ LL | |             }
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `switch_int` at $DIR/invalid_char_match.rs:LL:CC
+   = note: inside `switch_int` at tests/fail/validity/invalid_char_match.rs:LL:CC
 note: inside `main`
-  --> $DIR/invalid_char_match.rs:LL:CC
+  --> tests/fail/validity/invalid_char_match.rs:LL:CC
    |
 LL |     switch_int(&v as *const u32 as *const char);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/validity/invalid_char_op.stderr b/src/tools/miri/tests/fail/validity/invalid_char_op.stderr
index 113eecd9cf7..2d84ef3dda6 100644
--- a/src/tools/miri/tests/fail/validity/invalid_char_op.stderr
+++ b/src/tools/miri/tests/fail/validity/invalid_char_op.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: interpreting an invalid 32-bit value as a char: $HEX
-  --> $DIR/invalid_char_op.rs:LL:CC
+  --> tests/fail/validity/invalid_char_op.rs:LL:CC
    |
 LL |     let _x = c == 'x';
    |              ^^^^^^^^ interpreting an invalid 32-bit value as a char: $HEX
@@ -7,7 +7,7 @@ LL |     let _x = c == 'x';
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/invalid_char_op.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/invalid_char_op.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/invalid_char_uninit.stderr b/src/tools/miri/tests/fail/validity/invalid_char_uninit.stderr
index 34babac4dd3..6fd311df5ee 100644
--- a/src/tools/miri/tests/fail/validity/invalid_char_uninit.stderr
+++ b/src/tools/miri/tests/fail/validity/invalid_char_uninit.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value at [0]: encountered uninitialized memory, but expected a unicode scalar value
-  --> $DIR/invalid_char_uninit.rs:LL:CC
+  --> tests/fail/validity/invalid_char_uninit.rs:LL:CC
    |
 LL |     let _b = unsafe { MyUninit { init: () }.uninit };
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered uninitialized memory, but expected a unicode scalar value
@@ -7,7 +7,7 @@ LL |     let _b = unsafe { MyUninit { init: () }.uninit };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/invalid_char_uninit.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/invalid_char_uninit.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/invalid_enum_cast.stderr b/src/tools/miri/tests/fail/validity/invalid_enum_cast.stderr
index 30afb5e8087..0736dfb2df1 100644
--- a/src/tools/miri/tests/fail/validity/invalid_enum_cast.stderr
+++ b/src/tools/miri/tests/fail/validity/invalid_enum_cast.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: enum value has invalid tag: 0xff
-  --> $DIR/invalid_enum_cast.rs:LL:CC
+  --> tests/fail/validity/invalid_enum_cast.rs:LL:CC
    |
 LL |         let _val = *ptr as u32;
    |                    ^^^^^^^^^^^ enum value has invalid tag: 0xff
@@ -7,9 +7,9 @@ LL |         let _val = *ptr as u32;
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `cast` at $DIR/invalid_enum_cast.rs:LL:CC
+   = note: inside `cast` at tests/fail/validity/invalid_enum_cast.rs:LL:CC
 note: inside `main`
-  --> $DIR/invalid_enum_cast.rs:LL:CC
+  --> tests/fail/validity/invalid_enum_cast.rs:LL:CC
    |
 LL |     cast(&v as *const u32 as *const E);
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/fail/validity/invalid_enum_op.stderr b/src/tools/miri/tests/fail/validity/invalid_enum_op.stderr
index e7997689c51..d2cfa86de86 100644
--- a/src/tools/miri/tests/fail/validity/invalid_enum_op.stderr
+++ b/src/tools/miri/tests/fail/validity/invalid_enum_op.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: enum value has invalid tag: $HEX
-  --> $DIR/invalid_enum_op.rs:LL:CC
+  --> tests/fail/validity/invalid_enum_op.rs:LL:CC
    |
 LL |     let _val = mem::discriminant(&f);
    |                ^^^^^^^^^^^^^^^^^^^^^ enum value has invalid tag: $HEX
@@ -7,7 +7,7 @@ LL |     let _val = mem::discriminant(&f);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/invalid_enum_op.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/invalid_enum_op.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/invalid_enum_tag.stderr b/src/tools/miri/tests/fail/validity/invalid_enum_tag.stderr
index 5d27062fbc2..5721cfda932 100644
--- a/src/tools/miri/tests/fail/validity/invalid_enum_tag.stderr
+++ b/src/tools/miri/tests/fail/validity/invalid_enum_tag.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value at .<enum-tag>: encountered $HEX, but expected a valid enum tag
-  --> $DIR/invalid_enum_tag.rs:LL:CC
+  --> tests/fail/validity/invalid_enum_tag.rs:LL:CC
    |
 LL |     let _f = unsafe { std::mem::transmute::<i32, Foo>(42) };
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered $HEX, but expected a valid enum tag
@@ -7,7 +7,7 @@ LL |     let _f = unsafe { std::mem::transmute::<i32, Foo>(42) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/invalid_enum_tag.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/invalid_enum_tag.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/invalid_fnptr_null.stderr b/src/tools/miri/tests/fail/validity/invalid_fnptr_null.stderr
index f781ca04f03..a07b5babe1a 100644
--- a/src/tools/miri/tests/fail/validity/invalid_fnptr_null.stderr
+++ b/src/tools/miri/tests/fail/validity/invalid_fnptr_null.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered a null function pointer
-  --> $DIR/invalid_fnptr_null.rs:LL:CC
+  --> tests/fail/validity/invalid_fnptr_null.rs:LL:CC
    |
 LL |     let _b: fn() = unsafe { std::mem::transmute(0usize) };
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null function pointer
@@ -7,7 +7,7 @@ LL |     let _b: fn() = unsafe { std::mem::transmute(0usize) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/invalid_fnptr_null.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/invalid_fnptr_null.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/invalid_fnptr_uninit.stderr b/src/tools/miri/tests/fail/validity/invalid_fnptr_uninit.stderr
index 54781b507e0..85fabc1836b 100644
--- a/src/tools/miri/tests/fail/validity/invalid_fnptr_uninit.stderr
+++ b/src/tools/miri/tests/fail/validity/invalid_fnptr_uninit.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value at [0]: encountered uninitialized memory, but expected a function pointer
-  --> $DIR/invalid_fnptr_uninit.rs:LL:CC
+  --> tests/fail/validity/invalid_fnptr_uninit.rs:LL:CC
    |
 LL |     let _b = unsafe { MyUninit { init: () }.uninit };
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered uninitialized memory, but expected a function pointer
@@ -7,7 +7,7 @@ LL |     let _b = unsafe { MyUninit { init: () }.uninit };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/invalid_fnptr_uninit.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/invalid_fnptr_uninit.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/invalid_int_op.stderr b/src/tools/miri/tests/fail/validity/invalid_int_op.stderr
index df344311b75..c3f47df12f9 100644
--- a/src/tools/miri/tests/fail/validity/invalid_int_op.stderr
+++ b/src/tools/miri/tests/fail/validity/invalid_int_op.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
-  --> $DIR/invalid_int_op.rs:LL:CC
+  --> tests/fail/validity/invalid_int_op.rs:LL:CC
    |
 LL |     let i = unsafe { std::mem::MaybeUninit::<i32>::uninit().assume_init() };
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
@@ -7,7 +7,7 @@ LL |     let i = unsafe { std::mem::MaybeUninit::<i32>::uninit().assume_init() }
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/invalid_int_op.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/invalid_int_op.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/invalid_wide_raw.stderr b/src/tools/miri/tests/fail/validity/invalid_wide_raw.stderr
index ed34d5255a4..5321dc0f4cf 100644
--- a/src/tools/miri/tests/fail/validity/invalid_wide_raw.stderr
+++ b/src/tools/miri/tests/fail/validity/invalid_wide_raw.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered null pointer, but expected a vtable pointer
-  --> $DIR/invalid_wide_raw.rs:LL:CC
+  --> tests/fail/validity/invalid_wide_raw.rs:LL:CC
    |
 LL |     dbg!(S { x: unsafe { std::mem::transmute((0usize, 0usize)) } });
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a vtable pointer
@@ -7,7 +7,7 @@ LL |     dbg!(S { x: unsafe { std::mem::transmute((0usize, 0usize)) } });
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/invalid_wide_raw.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/invalid_wide_raw.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/match_binder_checks_validity1.stderr b/src/tools/miri/tests/fail/validity/match_binder_checks_validity1.stderr
index a1bfa267cbe..ec607512686 100644
--- a/src/tools/miri/tests/fail/validity/match_binder_checks_validity1.stderr
+++ b/src/tools/miri/tests/fail/validity/match_binder_checks_validity1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered a value of uninhabited type `main::Void`
-  --> $DIR/match_binder_checks_validity1.rs:LL:CC
+  --> tests/fail/validity/match_binder_checks_validity1.rs:LL:CC
    |
 LL |             _x => println!("hi from the void!"),
    |             ^^ constructing invalid value: encountered a value of uninhabited type `main::Void`
@@ -7,7 +7,7 @@ LL |             _x => println!("hi from the void!"),
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/match_binder_checks_validity1.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/match_binder_checks_validity1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/match_binder_checks_validity2.stderr b/src/tools/miri/tests/fail/validity/match_binder_checks_validity2.stderr
index 2d8238350f3..0375ead8f55 100644
--- a/src/tools/miri/tests/fail/validity/match_binder_checks_validity2.stderr
+++ b/src/tools/miri/tests/fail/validity/match_binder_checks_validity2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered 0x03, but expected a boolean
-  --> $DIR/match_binder_checks_validity2.rs:LL:CC
+  --> tests/fail/validity/match_binder_checks_validity2.rs:LL:CC
    |
 LL |             _x => println!("hi from the void!"),
    |             ^^ constructing invalid value: encountered 0x03, but expected a boolean
@@ -7,7 +7,7 @@ LL |             _x => println!("hi from the void!"),
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/match_binder_checks_validity2.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/match_binder_checks_validity2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/nonzero.stderr b/src/tools/miri/tests/fail/validity/nonzero.stderr
index 2add8434ca5..bbf1f9a73ff 100644
--- a/src/tools/miri/tests/fail/validity/nonzero.stderr
+++ b/src/tools/miri/tests/fail/validity/nonzero.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered 0, but expected something greater or equal to 1
-  --> $DIR/nonzero.rs:LL:CC
+  --> tests/fail/validity/nonzero.rs:LL:CC
    |
 LL |     let _x = Some(unsafe { NonZero(0) });
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
@@ -7,7 +7,7 @@ LL |     let _x = Some(unsafe { NonZero(0) });
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/nonzero.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/nonzero.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/recursive-validity-ref-bool.stderr b/src/tools/miri/tests/fail/validity/recursive-validity-ref-bool.stderr
index 2b2fa9b8a20..87ac8c17932 100644
--- a/src/tools/miri/tests/fail/validity/recursive-validity-ref-bool.stderr
+++ b/src/tools/miri/tests/fail/validity/recursive-validity-ref-bool.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value at .<deref>: encountered 0x03, but expected a boolean
-  --> $DIR/recursive-validity-ref-bool.rs:LL:CC
+  --> tests/fail/validity/recursive-validity-ref-bool.rs:LL:CC
    |
 LL |     let xref_wrong_type: &bool = unsafe { std::mem::transmute(xref) };
    |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered 0x03, but expected a boolean
@@ -7,7 +7,7 @@ LL |     let xref_wrong_type: &bool = unsafe { std::mem::transmute(xref) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/recursive-validity-ref-bool.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/recursive-validity-ref-bool.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/ref_to_uninhabited1.stderr b/src/tools/miri/tests/fail/validity/ref_to_uninhabited1.stderr
index d893f7a9e54..30acfef02ff 100644
--- a/src/tools/miri/tests/fail/validity/ref_to_uninhabited1.stderr
+++ b/src/tools/miri/tests/fail/validity/ref_to_uninhabited1.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered a box pointing to uninhabited type !
-  --> $DIR/ref_to_uninhabited1.rs:LL:CC
+  --> tests/fail/validity/ref_to_uninhabited1.rs:LL:CC
    |
 LL |         let x: Box<!> = transmute(&mut 42);
    |                         ^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a box pointing to uninhabited type !
@@ -7,7 +7,7 @@ LL |         let x: Box<!> = transmute(&mut 42);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/ref_to_uninhabited1.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/ref_to_uninhabited1.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/ref_to_uninhabited2.stderr b/src/tools/miri/tests/fail/validity/ref_to_uninhabited2.stderr
index 1d9c89c6880..1015d1ec427 100644
--- a/src/tools/miri/tests/fail/validity/ref_to_uninhabited2.stderr
+++ b/src/tools/miri/tests/fail/validity/ref_to_uninhabited2.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered a reference pointing to uninhabited type (i32, Void)
-  --> $DIR/ref_to_uninhabited2.rs:LL:CC
+  --> tests/fail/validity/ref_to_uninhabited2.rs:LL:CC
    |
 LL |         let _x: &(i32, Void) = transmute(&42);
    |                                ^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type (i32, Void)
@@ -7,7 +7,7 @@ LL |         let _x: &(i32, Void) = transmute(&42);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/ref_to_uninhabited2.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/ref_to_uninhabited2.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/too-big-slice.stderr b/src/tools/miri/tests/fail/validity/too-big-slice.stderr
index 2abe6c6fdf3..2b0a8f03813 100644
--- a/src/tools/miri/tests/fail/validity/too-big-slice.stderr
+++ b/src/tools/miri/tests/fail/validity/too-big-slice.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
-  --> $DIR/too-big-slice.rs:LL:CC
+  --> tests/fail/validity/too-big-slice.rs:LL:CC
    |
 LL |         let _x: &[u8] = mem::transmute((ptr, usize::MAX));
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
@@ -7,7 +7,7 @@ LL |         let _x: &[u8] = mem::transmute((ptr, usize::MAX));
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/too-big-slice.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/too-big-slice.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/too-big-unsized.stderr b/src/tools/miri/tests/fail/validity/too-big-unsized.stderr
index bc8a140ac22..1e8b37979b0 100644
--- a/src/tools/miri/tests/fail/validity/too-big-unsized.stderr
+++ b/src/tools/miri/tests/fail/validity/too-big-unsized.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: encountered invalid reference metadata: total size is bigger than largest supported object
-  --> $DIR/too-big-unsized.rs:LL:CC
+  --> tests/fail/validity/too-big-unsized.rs:LL:CC
    |
 LL |         let _x: &MySlice = mem::transmute((ptr, isize::MAX as usize));
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: total size is bigger than largest supported object
@@ -7,7 +7,7 @@ LL |         let _x: &MySlice = mem::transmute((ptr, isize::MAX as usize));
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/too-big-unsized.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/too-big-unsized.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/transmute_through_ptr.stderr b/src/tools/miri/tests/fail/validity/transmute_through_ptr.stderr
index fcd077daa38..bbb40d1f58f 100644
--- a/src/tools/miri/tests/fail/validity/transmute_through_ptr.stderr
+++ b/src/tools/miri/tests/fail/validity/transmute_through_ptr.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value at .<enum-tag>: encountered $HEX, but expected a valid enum tag
-  --> $DIR/transmute_through_ptr.rs:LL:CC
+  --> tests/fail/validity/transmute_through_ptr.rs:LL:CC
    |
 LL |     let y = x; // reading this ought to be enough to trigger validation
    |             ^ constructing invalid value at .<enum-tag>: encountered $HEX, but expected a valid enum tag
@@ -7,7 +7,7 @@ LL |     let y = x; // reading this ought to be enough to trigger validation
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/transmute_through_ptr.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/transmute_through_ptr.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/uninit_float.stderr b/src/tools/miri/tests/fail/validity/uninit_float.stderr
index 3d7ec44fdb0..a6ca0f40f0d 100644
--- a/src/tools/miri/tests/fail/validity/uninit_float.stderr
+++ b/src/tools/miri/tests/fail/validity/uninit_float.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value at .value[0]: encountered uninitialized memory, but expected a floating point number
-  --> $DIR/uninit_float.rs:LL:CC
+  --> tests/fail/validity/uninit_float.rs:LL:CC
    |
 LL |     let _val: [f32; 1] = unsafe { std::mem::uninitialized() };
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .value[0]: encountered uninitialized memory, but expected a floating point number
@@ -7,7 +7,7 @@ LL |     let _val: [f32; 1] = unsafe { std::mem::uninitialized() };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/uninit_float.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/uninit_float.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/uninit_integer.stderr b/src/tools/miri/tests/fail/validity/uninit_integer.stderr
index 55f3f803ad1..b983832799b 100644
--- a/src/tools/miri/tests/fail/validity/uninit_integer.stderr
+++ b/src/tools/miri/tests/fail/validity/uninit_integer.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value at .value[0]: encountered uninitialized memory, but expected an integer
-  --> $DIR/uninit_integer.rs:LL:CC
+  --> tests/fail/validity/uninit_integer.rs:LL:CC
    |
 LL |     let _val = unsafe { std::mem::MaybeUninit::<[usize; 1]>::uninit().assume_init() };
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .value[0]: encountered uninitialized memory, but expected an integer
@@ -7,7 +7,7 @@ LL |     let _val = unsafe { std::mem::MaybeUninit::<[usize; 1]>::uninit().assum
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/uninit_integer.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/uninit_integer.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/uninit_raw_ptr.stderr b/src/tools/miri/tests/fail/validity/uninit_raw_ptr.stderr
index fed1cf45874..83af585201a 100644
--- a/src/tools/miri/tests/fail/validity/uninit_raw_ptr.stderr
+++ b/src/tools/miri/tests/fail/validity/uninit_raw_ptr.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value at .value[0]: encountered uninitialized memory, but expected a raw pointer
-  --> $DIR/uninit_raw_ptr.rs:LL:CC
+  --> tests/fail/validity/uninit_raw_ptr.rs:LL:CC
    |
 LL |     let _val = unsafe { std::mem::MaybeUninit::<[*const u8; 1]>::uninit().assume_init() };
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .value[0]: encountered uninitialized memory, but expected a raw pointer
@@ -7,7 +7,7 @@ LL |     let _val = unsafe { std::mem::MaybeUninit::<[*const u8; 1]>::uninit().a
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/uninit_raw_ptr.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/uninit_raw_ptr.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/wrong-dyn-trait-generic.stderr b/src/tools/miri/tests/fail/validity/wrong-dyn-trait-generic.stderr
index 1219f9f88cf..0b5163f711e 100644
--- a/src/tools/miri/tests/fail/validity/wrong-dyn-trait-generic.stderr
+++ b/src/tools/miri/tests/fail/validity/wrong-dyn-trait-generic.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: wrong trait in wide pointer vtable: expected `Trait<u32>`, but encountered `Trait<i32>`
-  --> $DIR/wrong-dyn-trait-generic.rs:LL:CC
+  --> tests/fail/validity/wrong-dyn-trait-generic.rs:LL:CC
    |
 LL |     let _y: *const dyn Trait<u32> = unsafe { mem::transmute(x) };
    |                                              ^^^^^^^^^^^^^^^^^ constructing invalid value: wrong trait in wide pointer vtable: expected `Trait<u32>`, but encountered `Trait<i32>`
@@ -7,7 +7,7 @@ LL |     let _y: *const dyn Trait<u32> = unsafe { mem::transmute(x) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/wrong-dyn-trait-generic.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/wrong-dyn-trait-generic.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/validity/wrong-dyn-trait.stderr b/src/tools/miri/tests/fail/validity/wrong-dyn-trait.stderr
index e3503323b31..4be3fb52bdb 100644
--- a/src/tools/miri/tests/fail/validity/wrong-dyn-trait.stderr
+++ b/src/tools/miri/tests/fail/validity/wrong-dyn-trait.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: constructing invalid value: wrong trait in wide pointer vtable: expected `std::fmt::Debug`, but encountered `<trivial>`
-  --> $DIR/wrong-dyn-trait.rs:LL:CC
+  --> tests/fail/validity/wrong-dyn-trait.rs:LL:CC
    |
 LL |     let _y: *const dyn fmt::Debug = unsafe { mem::transmute(x) };
    |                                              ^^^^^^^^^^^^^^^^^ constructing invalid value: wrong trait in wide pointer vtable: expected `std::fmt::Debug`, but encountered `<trivial>`
@@ -7,7 +7,7 @@ LL |     let _y: *const dyn fmt::Debug = unsafe { mem::transmute(x) };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/wrong-dyn-trait.rs:LL:CC
+   = note: inside `main` at tests/fail/validity/wrong-dyn-trait.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/weak_memory/racing_mixed_size.stderr b/src/tools/miri/tests/fail/weak_memory/racing_mixed_size.stderr
index 44430cd25db..a437ca34258 100644
--- a/src/tools/miri/tests/fail/weak_memory/racing_mixed_size.stderr
+++ b/src/tools/miri/tests/fail/weak_memory/racing_mixed_size.stderr
@@ -1,11 +1,11 @@
 error: Undefined Behavior: Race condition detected between (1) 4-byte atomic store on thread `unnamed-ID` and (2) 2-byte atomic load on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/racing_mixed_size.rs:LL:CC
+  --> tests/fail/weak_memory/racing_mixed_size.rs:LL:CC
    |
 LL |             std::intrinsics::atomic_load_relaxed(hi);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Race condition detected between (1) 4-byte atomic store on thread `unnamed-ID` and (2) 2-byte atomic load on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/racing_mixed_size.rs:LL:CC
+  --> tests/fail/weak_memory/racing_mixed_size.rs:LL:CC
    |
 LL |         x.store(1, Relaxed);
    |         ^^^^^^^^^^^^^^^^^^^
@@ -14,7 +14,7 @@ LL |         x.store(1, Relaxed);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/racing_mixed_size.rs:LL:CC
+   = note: inside closure at tests/fail/weak_memory/racing_mixed_size.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/weak_memory/racing_mixed_size_read.stderr b/src/tools/miri/tests/fail/weak_memory/racing_mixed_size_read.stderr
index 94b4123d345..9e6a6e80418 100644
--- a/src/tools/miri/tests/fail/weak_memory/racing_mixed_size_read.stderr
+++ b/src/tools/miri/tests/fail/weak_memory/racing_mixed_size_read.stderr
@@ -1,11 +1,11 @@
 error: Undefined Behavior: Race condition detected between (1) 4-byte atomic load on thread `unnamed-ID` and (2) 2-byte atomic load on thread `unnamed-ID` at ALLOC. (2) just happened here
-  --> $DIR/racing_mixed_size_read.rs:LL:CC
+  --> tests/fail/weak_memory/racing_mixed_size_read.rs:LL:CC
    |
 LL |             (*hi).load(Relaxed);
    |             ^^^^^^^^^^^^^^^^^^^ Race condition detected between (1) 4-byte atomic load on thread `unnamed-ID` and (2) 2-byte atomic load on thread `unnamed-ID` at ALLOC. (2) just happened here
    |
 help: and (1) occurred earlier here
-  --> $DIR/racing_mixed_size_read.rs:LL:CC
+  --> tests/fail/weak_memory/racing_mixed_size_read.rs:LL:CC
    |
 LL |         x.load(Relaxed);
    |         ^^^^^^^^^^^^^^^
@@ -14,7 +14,7 @@ LL |         x.load(Relaxed);
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE (of the first span) on thread `unnamed-ID`:
-   = note: inside closure at $DIR/racing_mixed_size_read.rs:LL:CC
+   = note: inside closure at tests/fail/weak_memory/racing_mixed_size_read.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/weak_memory/weak_uninit.stderr b/src/tools/miri/tests/fail/weak_memory/weak_uninit.stderr
index 9aa5bc2fa76..816bd323f4c 100644
--- a/src/tools/miri/tests/fail/weak_memory/weak_uninit.stderr
+++ b/src/tools/miri/tests/fail/weak_memory/weak_uninit.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: using uninitialized data, but this operation requires initialized memory
-  --> $DIR/weak_uninit.rs:LL:CC
+  --> tests/fail/weak_memory/weak_uninit.rs:LL:CC
    |
 LL |     let j2 = spawn(move || x.load(Ordering::Relaxed));
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
@@ -7,7 +7,7 @@ LL |     let j2 = spawn(move || x.load(Ordering::Relaxed));
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE on thread `unnamed-ID`:
-   = note: inside closure at $DIR/weak_uninit.rs:LL:CC
+   = note: inside closure at tests/fail/weak_memory/weak_uninit.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/fail/zst_local_oob.stderr b/src/tools/miri/tests/fail/zst_local_oob.stderr
index 39ac2c91437..26911948eff 100644
--- a/src/tools/miri/tests/fail/zst_local_oob.stderr
+++ b/src/tools/miri/tests/fail/zst_local_oob.stderr
@@ -1,5 +1,5 @@
 error: Undefined Behavior: memory access failed: expected a pointer to 1 byte of memory, but got ALLOC which is at or beyond the end of the allocation of size 0 bytes
-  --> $DIR/zst_local_oob.rs:LL:CC
+  --> tests/fail/zst_local_oob.rs:LL:CC
    |
 LL |     let _val = unsafe { *x };
    |                         ^^ memory access failed: expected a pointer to 1 byte of memory, but got ALLOC which is at or beyond the end of the allocation of size 0 bytes
@@ -7,7 +7,7 @@ LL |     let _val = unsafe { *x };
    = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
    = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/zst_local_oob.rs:LL:CC
+   = note: inside `main` at tests/fail/zst_local_oob.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/native-lib/fail/function_not_in_so.rs b/src/tools/miri/tests/native-lib/fail/function_not_in_so.rs
index c532d052245..a7df3e61187 100644
--- a/src/tools/miri/tests/native-lib/fail/function_not_in_so.rs
+++ b/src/tools/miri/tests/native-lib/fail/function_not_in_so.rs
@@ -1,6 +1,5 @@
 // Only works on Unix targets
-//@ignore-target-windows
-//@ignore-target-wasm
+//@ignore-target: windows wasm
 //@only-on-host
 //@normalize-stderr-test: "OS `.*`" -> "$$OS"
 
diff --git a/src/tools/miri/tests/native-lib/fail/function_not_in_so.stderr b/src/tools/miri/tests/native-lib/fail/function_not_in_so.stderr
index e905d7d0391..bf1cfd573b8 100644
--- a/src/tools/miri/tests/native-lib/fail/function_not_in_so.stderr
+++ b/src/tools/miri/tests/native-lib/fail/function_not_in_so.stderr
@@ -1,5 +1,5 @@
 error: unsupported operation: can't call foreign function `foo` on $OS
-  --> $DIR/function_not_in_so.rs:LL:CC
+  --> tests/native-lib/fail/function_not_in_so.rs:LL:CC
    |
 LL |         foo();
    |         ^^^^^ can't call foreign function `foo` on $OS
@@ -7,7 +7,7 @@ LL |         foo();
    = help: if this is a basic API commonly used on this target, please report an issue with Miri
    = help: however, note that Miri does not aim to support every FFI function out there; for instance, we will not support APIs for things such as GUIs, scripting languages, or databases
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/function_not_in_so.rs:LL:CC
+   = note: inside `main` at tests/native-lib/fail/function_not_in_so.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/native-lib/fail/private_function.rs b/src/tools/miri/tests/native-lib/fail/private_function.rs
index 3c6fda741dd..e54880e97da 100644
--- a/src/tools/miri/tests/native-lib/fail/private_function.rs
+++ b/src/tools/miri/tests/native-lib/fail/private_function.rs
@@ -1,6 +1,5 @@
 // Only works on Unix targets
-//@ignore-target-windows
-//@ignore-target-wasm
+//@ignore-target: windows wasm
 //@only-on-host
 //@normalize-stderr-test: "OS `.*`" -> "$$OS"
 
diff --git a/src/tools/miri/tests/native-lib/fail/private_function.stderr b/src/tools/miri/tests/native-lib/fail/private_function.stderr
index e27a501ebb9..2cfc062212b 100644
--- a/src/tools/miri/tests/native-lib/fail/private_function.stderr
+++ b/src/tools/miri/tests/native-lib/fail/private_function.stderr
@@ -1,5 +1,5 @@
 error: unsupported operation: can't call foreign function `not_exported` on $OS
-  --> $DIR/private_function.rs:LL:CC
+  --> tests/native-lib/fail/private_function.rs:LL:CC
    |
 LL |         not_exported();
    |         ^^^^^^^^^^^^^^ can't call foreign function `not_exported` on $OS
@@ -7,7 +7,7 @@ LL |         not_exported();
    = help: if this is a basic API commonly used on this target, please report an issue with Miri
    = help: however, note that Miri does not aim to support every FFI function out there; for instance, we will not support APIs for things such as GUIs, scripting languages, or databases
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/private_function.rs:LL:CC
+   = note: inside `main` at tests/native-lib/fail/private_function.rs:LL:CC
 
 note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
 
diff --git a/src/tools/miri/tests/native-lib/pass/ptr_read_access.rs b/src/tools/miri/tests/native-lib/pass/ptr_read_access.rs
index 2990dfa8975..46eb5778b32 100644
--- a/src/tools/miri/tests/native-lib/pass/ptr_read_access.rs
+++ b/src/tools/miri/tests/native-lib/pass/ptr_read_access.rs
@@ -1,6 +1,5 @@
 // Only works on Unix targets
-//@ignore-target-windows
-//@ignore-target-wasm
+//@ignore-target: windows wasm
 //@only-on-host
 
 fn main() {
diff --git a/src/tools/miri/tests/native-lib/pass/scalar_arguments.rs b/src/tools/miri/tests/native-lib/pass/scalar_arguments.rs
index 378baa7ce98..c896bd8dd34 100644
--- a/src/tools/miri/tests/native-lib/pass/scalar_arguments.rs
+++ b/src/tools/miri/tests/native-lib/pass/scalar_arguments.rs
@@ -1,6 +1,5 @@
 // Only works on Unix targets
-//@ignore-target-windows
-//@ignore-target-wasm
+//@ignore-target: windows wasm
 //@only-on-host
 
 extern "C" {
diff --git a/src/tools/miri/tests/panic/alloc_error_handler_hook.stderr b/src/tools/miri/tests/panic/alloc_error_handler_hook.stderr
index 319a10febb3..363298e49d9 100644
--- a/src/tools/miri/tests/panic/alloc_error_handler_hook.stderr
+++ b/src/tools/miri/tests/panic/alloc_error_handler_hook.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at $DIR/alloc_error_handler_hook.rs:LL:CC:
+thread 'main' panicked at tests/panic/alloc_error_handler_hook.rs:LL:CC:
 alloc error hook called
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
diff --git a/src/tools/miri/tests/panic/div-by-zero-2.stderr b/src/tools/miri/tests/panic/div-by-zero-2.stderr
index ed394f76b0e..e47a754d38d 100644
--- a/src/tools/miri/tests/panic/div-by-zero-2.stderr
+++ b/src/tools/miri/tests/panic/div-by-zero-2.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at $DIR/div-by-zero-2.rs:LL:CC:
+thread 'main' panicked at tests/panic/div-by-zero-2.rs:LL:CC:
 attempt to divide by zero
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
diff --git a/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr b/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr
index 6733f2e42c1..ec75b6201c2 100644
--- a/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr
+++ b/src/tools/miri/tests/panic/function_calls/exported_symbol_good_unwind.stderr
@@ -1,8 +1,8 @@
-thread 'main' panicked at $DIR/exported_symbol_good_unwind.rs:LL:CC:
+thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC:
 explicit panic
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
-thread 'main' panicked at $DIR/exported_symbol_good_unwind.rs:LL:CC:
+thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC:
 explicit panic
-thread 'main' panicked at $DIR/exported_symbol_good_unwind.rs:LL:CC:
+thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC:
 explicit panic
diff --git a/src/tools/miri/tests/panic/mir-validation.rs b/src/tools/miri/tests/panic/mir-validation.rs
index f1d0ccc7d03..e4b75cccbb5 100644
--- a/src/tools/miri/tests/panic/mir-validation.rs
+++ b/src/tools/miri/tests/panic/mir-validation.rs
@@ -7,7 +7,7 @@
 //@normalize-stderr-test: "DefId\([^()]*\)" -> "DefId"
 // Somehow on rustc Windows CI, the "Miri caused an ICE" message is not shown
 // and we don't even get a regular panic; rustc aborts with a different exit code instead.
-//@ignore-host-windows
+//@ignore-host: windows
 #![feature(custom_mir, core_intrinsics)]
 use core::intrinsics::mir::*;
 
diff --git a/src/tools/miri/tests/panic/oob_subslice.stderr b/src/tools/miri/tests/panic/oob_subslice.stderr
index 46f0f643a47..d608cec20a4 100644
--- a/src/tools/miri/tests/panic/oob_subslice.stderr
+++ b/src/tools/miri/tests/panic/oob_subslice.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at $DIR/oob_subslice.rs:LL:CC:
+thread 'main' panicked at tests/panic/oob_subslice.rs:LL:CC:
 range end index 5 out of range for slice of length 4
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
diff --git a/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr b/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr
index be822bd0285..29150052b30 100644
--- a/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr
+++ b/src/tools/miri/tests/panic/overflowing-lsh-neg.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at $DIR/overflowing-lsh-neg.rs:LL:CC:
+thread 'main' panicked at tests/panic/overflowing-lsh-neg.rs:LL:CC:
 attempt to shift left with overflow
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
diff --git a/src/tools/miri/tests/panic/overflowing-rsh-1.stderr b/src/tools/miri/tests/panic/overflowing-rsh-1.stderr
index fc090aba5fd..9a71a797dae 100644
--- a/src/tools/miri/tests/panic/overflowing-rsh-1.stderr
+++ b/src/tools/miri/tests/panic/overflowing-rsh-1.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at $DIR/overflowing-rsh-1.rs:LL:CC:
+thread 'main' panicked at tests/panic/overflowing-rsh-1.rs:LL:CC:
 attempt to shift right with overflow
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
diff --git a/src/tools/miri/tests/panic/overflowing-rsh-2.stderr b/src/tools/miri/tests/panic/overflowing-rsh-2.stderr
index 77160e1870f..b671c53c611 100644
--- a/src/tools/miri/tests/panic/overflowing-rsh-2.stderr
+++ b/src/tools/miri/tests/panic/overflowing-rsh-2.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at $DIR/overflowing-rsh-2.rs:LL:CC:
+thread 'main' panicked at tests/panic/overflowing-rsh-2.rs:LL:CC:
 attempt to shift right with overflow
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
diff --git a/src/tools/miri/tests/panic/panic1.stderr b/src/tools/miri/tests/panic/panic1.stderr
index 4eb4244d747..7e011bfd53b 100644
--- a/src/tools/miri/tests/panic/panic1.stderr
+++ b/src/tools/miri/tests/panic/panic1.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at $DIR/panic1.rs:LL:CC:
+thread 'main' panicked at tests/panic/panic1.rs:LL:CC:
 panicking from libstd
 stack backtrace:
    0: std::panicking::begin_panic_handler
@@ -6,7 +6,7 @@ stack backtrace:
    1: std::rt::panic_fmt
  at RUSTLIB/core/src/panicking.rs:LL:CC
    2: main
- at $DIR/panic1.rs:LL:CC
+ at tests/panic/panic1.rs:LL:CC
    3: <fn() as std::ops::FnOnce<()>>::call_once - shim(fn())
  at RUSTLIB/core/src/ops/function.rs:LL:CC
 note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
diff --git a/src/tools/miri/tests/panic/panic2.stderr b/src/tools/miri/tests/panic/panic2.stderr
index f7408310093..5640bd0b8d6 100644
--- a/src/tools/miri/tests/panic/panic2.stderr
+++ b/src/tools/miri/tests/panic/panic2.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at $DIR/panic2.rs:LL:CC:
+thread 'main' panicked at tests/panic/panic2.rs:LL:CC:
 42-panicking from libstd
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
diff --git a/src/tools/miri/tests/panic/panic3.stderr b/src/tools/miri/tests/panic/panic3.stderr
index 32ba400e025..0114320503b 100644
--- a/src/tools/miri/tests/panic/panic3.stderr
+++ b/src/tools/miri/tests/panic/panic3.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at $DIR/panic3.rs:LL:CC:
+thread 'main' panicked at tests/panic/panic3.rs:LL:CC:
 panicking from libcore
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
diff --git a/src/tools/miri/tests/panic/panic4.stderr b/src/tools/miri/tests/panic/panic4.stderr
index a8a23ee3ce1..f13b355ea45 100644
--- a/src/tools/miri/tests/panic/panic4.stderr
+++ b/src/tools/miri/tests/panic/panic4.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at $DIR/panic4.rs:LL:CC:
+thread 'main' panicked at tests/panic/panic4.rs:LL:CC:
 42-panicking from libcore
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
diff --git a/src/tools/miri/tests/panic/transmute_fat2.stderr b/src/tools/miri/tests/panic/transmute_fat2.stderr
index 021ca1c4b32..a9bc0eb9d01 100644
--- a/src/tools/miri/tests/panic/transmute_fat2.stderr
+++ b/src/tools/miri/tests/panic/transmute_fat2.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at $DIR/transmute_fat2.rs:LL:CC:
+thread 'main' panicked at tests/panic/transmute_fat2.rs:LL:CC:
 index out of bounds: the len is 0 but the index is 0
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
diff --git a/src/tools/miri/tests/panic/unsupported_foreign_function.stderr b/src/tools/miri/tests/panic/unsupported_foreign_function.stderr
index fcc4220bfce..278af9612d6 100644
--- a/src/tools/miri/tests/panic/unsupported_foreign_function.stderr
+++ b/src/tools/miri/tests/panic/unsupported_foreign_function.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at $DIR/unsupported_foreign_function.rs:LL:CC:
+thread 'main' panicked at tests/panic/unsupported_foreign_function.rs:LL:CC:
 unsupported Miri functionality: can't call foreign function `foo` on $OS
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
diff --git a/src/tools/miri/tests/panic/unsupported_syscall.rs b/src/tools/miri/tests/panic/unsupported_syscall.rs
index 30f9da5f80e..bbb076b169a 100644
--- a/src/tools/miri/tests/panic/unsupported_syscall.rs
+++ b/src/tools/miri/tests/panic/unsupported_syscall.rs
@@ -1,5 +1,5 @@
-//@ignore-target-windows: no `syscall` on Windows
-//@ignore-target-apple: `syscall` is not supported on macOS
+//@ignore-target: windows # no `syscall` on Windows
+//@ignore-target: apple # `syscall` is not supported on macOS
 //@compile-flags: -Zmiri-panic-on-unsupported
 
 fn main() {
diff --git a/src/tools/miri/tests/panic/unsupported_syscall.stderr b/src/tools/miri/tests/panic/unsupported_syscall.stderr
index 660cfba8900..e9b2b5b6652 100644
--- a/src/tools/miri/tests/panic/unsupported_syscall.stderr
+++ b/src/tools/miri/tests/panic/unsupported_syscall.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at $DIR/unsupported_syscall.rs:LL:CC:
+thread 'main' panicked at tests/panic/unsupported_syscall.rs:LL:CC:
 unsupported Miri functionality: can't execute syscall with ID 0
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
diff --git a/src/tools/miri/tests/pass-dep/concurrency/apple-os-unfair-lock.rs b/src/tools/miri/tests/pass-dep/concurrency/apple-os-unfair-lock.rs
index c2b9c37bbfb..0fc432f24c8 100644
--- a/src/tools/miri/tests/pass-dep/concurrency/apple-os-unfair-lock.rs
+++ b/src/tools/miri/tests/pass-dep/concurrency/apple-os-unfair-lock.rs
@@ -1,4 +1,4 @@
-//@ only-target-darwin
+//@only-target: darwin
 
 use std::cell::UnsafeCell;
 
diff --git a/src/tools/miri/tests/pass-dep/concurrency/env-cleanup-data-race.rs b/src/tools/miri/tests/pass-dep/concurrency/env-cleanup-data-race.rs
index 86a47ba3655..c9c9dc5dfd2 100644
--- a/src/tools/miri/tests/pass-dep/concurrency/env-cleanup-data-race.rs
+++ b/src/tools/miri/tests/pass-dep/concurrency/env-cleanup-data-race.rs
@@ -1,5 +1,5 @@
 //@compile-flags: -Zmiri-disable-isolation -Zmiri-preemption-rate=0
-//@ignore-target-windows: No libc env support on Windows
+//@ignore-target: windows # No libc env support on Windows
 
 use std::ffi::CStr;
 use std::thread;
diff --git a/src/tools/miri/tests/pass-dep/concurrency/linux-futex.rs b/src/tools/miri/tests/pass-dep/concurrency/linux-futex.rs
index 399d6df73ff..e84ffee367f 100644
--- a/src/tools/miri/tests/pass-dep/concurrency/linux-futex.rs
+++ b/src/tools/miri/tests/pass-dep/concurrency/linux-futex.rs
@@ -1,4 +1,4 @@
-//@only-target-linux
+//@only-target: linux
 //@compile-flags: -Zmiri-disable-isolation
 
 use std::mem::MaybeUninit;
diff --git a/src/tools/miri/tests/pass-dep/concurrency/tls_pthread_drop_order.rs b/src/tools/miri/tests/pass-dep/concurrency/tls_pthread_drop_order.rs
index 52348aad33d..87c8a2e1063 100644
--- a/src/tools/miri/tests/pass-dep/concurrency/tls_pthread_drop_order.rs
+++ b/src/tools/miri/tests/pass-dep/concurrency/tls_pthread_drop_order.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 //! Test that pthread_key destructors are run in the right order.
 //! Note that these are *not* used by actual `thread_local!` on Linux! Those use
 //! `destructors::register` from the stdlib instead. In Miri this ends up hitting
diff --git a/src/tools/miri/tests/pass-dep/concurrency/windows_detach_terminated.rs b/src/tools/miri/tests/pass-dep/concurrency/windows_detach_terminated.rs
index 3d4f8c5e1c0..fe2d20bb76f 100644
--- a/src/tools/miri/tests/pass-dep/concurrency/windows_detach_terminated.rs
+++ b/src/tools/miri/tests/pass-dep/concurrency/windows_detach_terminated.rs
@@ -1,4 +1,4 @@
-//@only-target-windows: Uses win32 api functions
+//@only-target: windows # Uses win32 api functions
 // We are making scheduler assumptions here.
 //@compile-flags: -Zmiri-preemption-rate=0
 
diff --git a/src/tools/miri/tests/pass-dep/concurrency/windows_init_once.rs b/src/tools/miri/tests/pass-dep/concurrency/windows_init_once.rs
index 5e33617f98a..afcab7a702d 100644
--- a/src/tools/miri/tests/pass-dep/concurrency/windows_init_once.rs
+++ b/src/tools/miri/tests/pass-dep/concurrency/windows_init_once.rs
@@ -1,4 +1,4 @@
-//@only-target-windows: Uses win32 api functions
+//@only-target: windows # Uses win32 api functions
 // We are making scheduler assumptions here.
 //@compile-flags: -Zmiri-preemption-rate=0
 
diff --git a/src/tools/miri/tests/pass-dep/concurrency/windows_join_multiple.rs b/src/tools/miri/tests/pass-dep/concurrency/windows_join_multiple.rs
index bff59591a94..67e77663110 100644
--- a/src/tools/miri/tests/pass-dep/concurrency/windows_join_multiple.rs
+++ b/src/tools/miri/tests/pass-dep/concurrency/windows_join_multiple.rs
@@ -1,4 +1,4 @@
-//@only-target-windows: Uses win32 api functions
+//@only-target: windows # Uses win32 api functions
 // We are making scheduler assumptions here.
 //@compile-flags: -Zmiri-preemption-rate=0
 
diff --git a/src/tools/miri/tests/pass-dep/extra_fn_ptr_gc.rs b/src/tools/miri/tests/pass-dep/extra_fn_ptr_gc.rs
index 1198168795d..9e5627c75a9 100644
--- a/src/tools/miri/tests/pass-dep/extra_fn_ptr_gc.rs
+++ b/src/tools/miri/tests/pass-dep/extra_fn_ptr_gc.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No `dlsym` on Windows
+//@ignore-target: windows # No `dlsym` on Windows
 //@compile-flags: -Zmiri-permissive-provenance
 
 #[path = "../utils/mod.rs"]
diff --git a/src/tools/miri/tests/pass-dep/libc/fcntl_f-fullfsync_apple.rs b/src/tools/miri/tests/pass-dep/libc/fcntl_f-fullfsync_apple.rs
index 307906f2583..7dddfa66613 100644
--- a/src/tools/miri/tests/pass-dep/libc/fcntl_f-fullfsync_apple.rs
+++ b/src/tools/miri/tests/pass-dep/libc/fcntl_f-fullfsync_apple.rs
@@ -1,4 +1,4 @@
-//@only-target-apple: F_FULLFSYNC only on apple systems
+//@only-target: apple # F_FULLFSYNC only on apple systems
 //@compile-flags: -Zmiri-isolation-error=warn-nobacktrace
 
 use std::io::Error;
diff --git a/src/tools/miri/tests/pass-dep/libc/gettid.rs b/src/tools/miri/tests/pass-dep/libc/gettid.rs
index 87405b02ac3..ca352e0109a 100644
--- a/src/tools/miri/tests/pass-dep/libc/gettid.rs
+++ b/src/tools/miri/tests/pass-dep/libc/gettid.rs
@@ -1,4 +1,4 @@
-//@only-target-linux
+//@only-target: linux
 //@revisions: with_isolation without_isolation
 //@[without_isolation] compile-flags: -Zmiri-disable-isolation
 
diff --git a/src/tools/miri/tests/pass-dep/libc/libc-affinity.rs b/src/tools/miri/tests/pass-dep/libc/libc-affinity.rs
index 0e482ab2601..ff152eaea5c 100644
--- a/src/tools/miri/tests/pass-dep/libc/libc-affinity.rs
+++ b/src/tools/miri/tests/pass-dep/libc/libc-affinity.rs
@@ -1,5 +1,5 @@
-//@ignore-target-windows: only very limited libc on Windows
-//@ignore-target-apple: `sched_{g, s}etaffinity` are not supported on macOS
+//@ignore-target: windows # only very limited libc on Windows
+//@ignore-target: apple # `sched_{g, s}etaffinity` are not supported on macOS
 //@compile-flags: -Zmiri-disable-isolation -Zmiri-num-cpus=4
 #![feature(io_error_more)]
 #![feature(pointer_is_aligned_to)]
diff --git a/src/tools/miri/tests/pass-dep/libc/libc-epoll-blocking.rs b/src/tools/miri/tests/pass-dep/libc/libc-epoll-blocking.rs
index 2a5d3dff07f..eb38529ae57 100644
--- a/src/tools/miri/tests/pass-dep/libc/libc-epoll-blocking.rs
+++ b/src/tools/miri/tests/pass-dep/libc/libc-epoll-blocking.rs
@@ -1,4 +1,4 @@
-//@only-target-linux
+//@only-target: linux
 // test_epoll_block_then_unblock depends on a deterministic schedule.
 //@compile-flags: -Zmiri-preemption-rate=0
 
diff --git a/src/tools/miri/tests/pass-dep/libc/libc-epoll-no-blocking.rs b/src/tools/miri/tests/pass-dep/libc/libc-epoll-no-blocking.rs
index 647b5e60649..3e448b6ce3c 100644
--- a/src/tools/miri/tests/pass-dep/libc/libc-epoll-no-blocking.rs
+++ b/src/tools/miri/tests/pass-dep/libc/libc-epoll-no-blocking.rs
@@ -1,4 +1,4 @@
-//@only-target-linux
+//@only-target: linux
 
 #![feature(strict_provenance)]
 use std::convert::TryInto;
diff --git a/src/tools/miri/tests/pass-dep/libc/libc-eventfd.rs b/src/tools/miri/tests/pass-dep/libc/libc-eventfd.rs
index a3567eeb7cb..1e3d486233a 100644
--- a/src/tools/miri/tests/pass-dep/libc/libc-eventfd.rs
+++ b/src/tools/miri/tests/pass-dep/libc/libc-eventfd.rs
@@ -1,4 +1,4 @@
-//@only-target-linux
+//@only-target: linux
 // test_race depends on a deterministic schedule.
 //@compile-flags: -Zmiri-preemption-rate=0
 
diff --git a/src/tools/miri/tests/pass-dep/libc/libc-fs-flock.rs b/src/tools/miri/tests/pass-dep/libc/libc-fs-flock.rs
index 3f7f9b18be9..be11f65a1e0 100644
--- a/src/tools/miri/tests/pass-dep/libc/libc-fs-flock.rs
+++ b/src/tools/miri/tests/pass-dep/libc/libc-fs-flock.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: File handling is not implemented yet
+//@ignore-target: windows # File handling is not implemented yet
 //@compile-flags: -Zmiri-disable-isolation
 
 use std::{fs::File, io::Error, os::fd::AsRawFd};
diff --git a/src/tools/miri/tests/pass-dep/libc/libc-fs-symlink.rs b/src/tools/miri/tests/pass-dep/libc/libc-fs-symlink.rs
index 619c6db3a29..a35c92636ce 100644
--- a/src/tools/miri/tests/pass-dep/libc/libc-fs-symlink.rs
+++ b/src/tools/miri/tests/pass-dep/libc/libc-fs-symlink.rs
@@ -1,6 +1,6 @@
 // Symlink tests are separate since they don't in general work on a Windows host.
-//@ignore-host-windows: creating symlinks requires admin permissions on Windows
-//@ignore-target-windows: File handling is not implemented yet
+//@ignore-host: windows # creating symlinks requires admin permissions on Windows
+//@ignore-target: windows # File handling is not implemented yet
 //@compile-flags: -Zmiri-disable-isolation
 
 use std::ffi::CString;
diff --git a/src/tools/miri/tests/pass-dep/libc/libc-fs-with-isolation.rs b/src/tools/miri/tests/pass-dep/libc/libc-fs-with-isolation.rs
index 088a632427e..ab3fd6733ff 100644
--- a/src/tools/miri/tests/pass-dep/libc/libc-fs-with-isolation.rs
+++ b/src/tools/miri/tests/pass-dep/libc/libc-fs-with-isolation.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: File handling is not implemented yet
+//@ignore-target: windows # File handling is not implemented yet
 //@compile-flags: -Zmiri-isolation-error=warn-nobacktrace
 //@normalize-stderr-test: "(stat(x)?)" -> "$$STAT"
 
diff --git a/src/tools/miri/tests/pass-dep/libc/libc-fs.rs b/src/tools/miri/tests/pass-dep/libc/libc-fs.rs
index 5b2bbfbb27d..11809613749 100644
--- a/src/tools/miri/tests/pass-dep/libc/libc-fs.rs
+++ b/src/tools/miri/tests/pass-dep/libc/libc-fs.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: File handling is not implemented yet
+//@ignore-target: windows # File handling is not implemented yet
 //@compile-flags: -Zmiri-disable-isolation
 
 #![feature(io_error_more)]
diff --git a/src/tools/miri/tests/pass-dep/libc/libc-misc.rs b/src/tools/miri/tests/pass-dep/libc/libc-misc.rs
index a5b944e9d42..f3261eaa43c 100644
--- a/src/tools/miri/tests/pass-dep/libc/libc-misc.rs
+++ b/src/tools/miri/tests/pass-dep/libc/libc-misc.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: only very limited libc on Windows
+//@ignore-target: windows # only very limited libc on Windows
 //@compile-flags: -Zmiri-disable-isolation
 #![feature(io_error_more)]
 #![feature(pointer_is_aligned_to)]
diff --git a/src/tools/miri/tests/pass-dep/libc/libc-pipe.rs b/src/tools/miri/tests/pass-dep/libc/libc-pipe.rs
index 90dbd888392..c6e8355c3f5 100644
--- a/src/tools/miri/tests/pass-dep/libc/libc-pipe.rs
+++ b/src/tools/miri/tests/pass-dep/libc/libc-pipe.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No libc pipe on Windows
+//@ignore-target: windows # No libc pipe on Windows
 // test_race depends on a deterministic schedule.
 //@compile-flags: -Zmiri-preemption-rate=0
 use std::thread;
diff --git a/src/tools/miri/tests/pass-dep/libc/libc-random.rs b/src/tools/miri/tests/pass-dep/libc/libc-random.rs
index 71e33522634..e951603639c 100644
--- a/src/tools/miri/tests/pass-dep/libc/libc-random.rs
+++ b/src/tools/miri/tests/pass-dep/libc/libc-random.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: no libc
+//@ignore-target: windows # no libc
 //@revisions: isolation no_isolation
 //@[no_isolation]compile-flags: -Zmiri-disable-isolation
 
diff --git a/src/tools/miri/tests/pass-dep/libc/libc-socketpair.rs b/src/tools/miri/tests/pass-dep/libc/libc-socketpair.rs
index 15e040116de..c3d6af5a1ef 100644
--- a/src/tools/miri/tests/pass-dep/libc/libc-socketpair.rs
+++ b/src/tools/miri/tests/pass-dep/libc/libc-socketpair.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No libc socketpair on Windows
+//@ignore-target: windows # No libc socketpair on Windows
 // test_race depends on a deterministic schedule.
 //@compile-flags: -Zmiri-preemption-rate=0
 use std::thread;
diff --git a/src/tools/miri/tests/pass-dep/libc/libc-time.rs b/src/tools/miri/tests/pass-dep/libc/libc-time.rs
index 5e4bb73e368..c2c87586492 100644
--- a/src/tools/miri/tests/pass-dep/libc/libc-time.rs
+++ b/src/tools/miri/tests/pass-dep/libc/libc-time.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: no libc time APIs on Windows
+//@ignore-target: windows # no libc time APIs on Windows
 //@compile-flags: -Zmiri-disable-isolation
 use std::{env, mem, ptr};
 
diff --git a/src/tools/miri/tests/pass-dep/libc/libc_pthread_cond_timedwait.rs b/src/tools/miri/tests/pass-dep/libc/libc_pthread_cond_timedwait.rs
index d758168c7c3..997fd5cc89f 100644
--- a/src/tools/miri/tests/pass-dep/libc/libc_pthread_cond_timedwait.rs
+++ b/src/tools/miri/tests/pass-dep/libc/libc_pthread_cond_timedwait.rs
@@ -1,5 +1,5 @@
-//@ignore-target-windows: No pthreads on Windows
-//@ignore-target-apple: pthread_condattr_setclock is not supported on MacOS.
+//@ignore-target: windows # No pthreads on Windows
+//@ignore-target: apple # pthread_condattr_setclock is not supported on MacOS.
 //@compile-flags: -Zmiri-disable-isolation
 
 /// Test that conditional variable timeouts are working properly with both
diff --git a/src/tools/miri/tests/pass-dep/libc/libc_pthread_cond_timedwait_isolated.rs b/src/tools/miri/tests/pass-dep/libc/libc_pthread_cond_timedwait_isolated.rs
index f1a3c5dc10d..0479d26af72 100644
--- a/src/tools/miri/tests/pass-dep/libc/libc_pthread_cond_timedwait_isolated.rs
+++ b/src/tools/miri/tests/pass-dep/libc/libc_pthread_cond_timedwait_isolated.rs
@@ -1,5 +1,5 @@
-//@ignore-target-windows: No pthreads on Windows
-//@ignore-target-apple: pthread_condattr_setclock is not supported on MacOS.
+//@ignore-target: windows # No pthreads on Windows
+//@ignore-target: apple # pthread_condattr_setclock is not supported on MacOS.
 
 /// Test that conditional variable timeouts are working properly
 /// with monotonic clocks even under isolation.
diff --git a/src/tools/miri/tests/pass-dep/libc/mmap.rs b/src/tools/miri/tests/pass-dep/libc/mmap.rs
index fd874dbe89e..db305acbf4a 100644
--- a/src/tools/miri/tests/pass-dep/libc/mmap.rs
+++ b/src/tools/miri/tests/pass-dep/libc/mmap.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No mmap on Windows
+//@ignore-target: windows # No mmap on Windows
 //@compile-flags: -Zmiri-disable-isolation -Zmiri-permissive-provenance
 #![feature(strict_provenance)]
 
diff --git a/src/tools/miri/tests/pass-dep/libc/pthread-sync.rs b/src/tools/miri/tests/pass-dep/libc/pthread-sync.rs
index 14275262128..75848bd44db 100644
--- a/src/tools/miri/tests/pass-dep/libc/pthread-sync.rs
+++ b/src/tools/miri/tests/pass-dep/libc/pthread-sync.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 // We use `yield` to test specific interleavings, so disable automatic preemption.
 //@compile-flags: -Zmiri-preemption-rate=0
 #![feature(sync_unsafe_cell)]
diff --git a/src/tools/miri/tests/pass-dep/libc/pthread-threadname.rs b/src/tools/miri/tests/pass-dep/libc/pthread-threadname.rs
index 8be42b50897..a94f960f442 100644
--- a/src/tools/miri/tests/pass-dep/libc/pthread-threadname.rs
+++ b/src/tools/miri/tests/pass-dep/libc/pthread-threadname.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: No pthreads on Windows
+//@ignore-target: windows # No pthreads on Windows
 use std::ffi::CStr;
 #[cfg(not(target_os = "freebsd"))]
 use std::ffi::CString;
diff --git a/src/tools/miri/tests/pass-dep/tempfile.rs b/src/tools/miri/tests/pass-dep/tempfile.rs
index c4583ca3f47..a44a7e7d924 100644
--- a/src/tools/miri/tests/pass-dep/tempfile.rs
+++ b/src/tools/miri/tests/pass-dep/tempfile.rs
@@ -1,5 +1,5 @@
-//@ignore-target-windows: File handling is not implemented yet
-//@ignore-host-windows: Only supported for UNIX hosts
+//@ignore-target: windows # File handling is not implemented yet
+//@ignore-host: windows # Only supported for UNIX hosts
 //@compile-flags: -Zmiri-disable-isolation
 
 #[path = "../utils/mod.rs"]
diff --git a/src/tools/miri/tests/pass-dep/tokio/file-io.rs b/src/tools/miri/tests/pass-dep/tokio/file-io.rs
index d14af299cd4..14c27285a6a 100644
--- a/src/tools/miri/tests/pass-dep/tokio/file-io.rs
+++ b/src/tools/miri/tests/pass-dep/tokio/file-io.rs
@@ -1,5 +1,5 @@
 //@compile-flags: -Zmiri-disable-isolation
-//@only-target-linux: We only support tokio on Linux
+//@only-target: linux # We only support tokio on Linux
 
 use std::fs::remove_file;
 use tokio::fs::{File, OpenOptions};
diff --git a/src/tools/miri/tests/pass-dep/tokio/mpsc-await.rs b/src/tools/miri/tests/pass-dep/tokio/mpsc-await.rs
index 7dea07c6e7d..96018f34aa5 100644
--- a/src/tools/miri/tests/pass-dep/tokio/mpsc-await.rs
+++ b/src/tools/miri/tests/pass-dep/tokio/mpsc-await.rs
@@ -1,4 +1,4 @@
-//@only-target-linux: We only support tokio on Linux
+//@only-target: linux # We only support tokio on Linux
 use tokio::sync::mpsc;
 
 #[tokio::main]
diff --git a/src/tools/miri/tests/pass-dep/tokio/sleep.rs b/src/tools/miri/tests/pass-dep/tokio/sleep.rs
index 5e63037c8a6..38f2cdde115 100644
--- a/src/tools/miri/tests/pass-dep/tokio/sleep.rs
+++ b/src/tools/miri/tests/pass-dep/tokio/sleep.rs
@@ -1,4 +1,4 @@
-//@only-target-linux: We only support tokio on Linux
+//@only-target: linux # We only support tokio on Linux
 
 use tokio::time::{sleep, Duration, Instant};
 
diff --git a/src/tools/miri/tests/pass/alloc-access-tracking.rs b/src/tools/miri/tests/pass/alloc-access-tracking.rs
index 40b8e23a33c..50e217918b0 100644
--- a/src/tools/miri/tests/pass/alloc-access-tracking.rs
+++ b/src/tools/miri/tests/pass/alloc-access-tracking.rs
@@ -2,7 +2,7 @@
 #![no_std]
 //@compile-flags: -Zmiri-track-alloc-id=21 -Zmiri-track-alloc-accesses -Cpanic=abort
 //@normalize-stderr-test: "id 21" -> "id $$ALLOC"
-//@only-target-linux: alloc IDs differ between OSes (due to extern static allocations)
+//@only-target: linux # alloc IDs differ between OSes (due to extern static allocations)
 
 extern "Rust" {
     fn miri_alloc(size: usize, align: usize) -> *mut u8;
diff --git a/src/tools/miri/tests/pass/alloc-access-tracking.stderr b/src/tools/miri/tests/pass/alloc-access-tracking.stderr
index 0af6cde833f..451f5de25d3 100644
--- a/src/tools/miri/tests/pass/alloc-access-tracking.stderr
+++ b/src/tools/miri/tests/pass/alloc-access-tracking.stderr
@@ -1,23 +1,23 @@
 note: tracking was triggered
-  --> $DIR/alloc-access-tracking.rs:LL:CC
+  --> tests/pass/alloc-access-tracking.rs:LL:CC
    |
 LL |         let ptr = miri_alloc(123, 1);
    |                   ^^^^^^^^^^^^^^^^^^ created Miri bare-metal heap allocation of 123 bytes (alignment ALIGN bytes) with id $ALLOC
    |
    = note: BACKTRACE:
-   = note: inside `start` at $DIR/alloc-access-tracking.rs:LL:CC
+   = note: inside `start` at tests/pass/alloc-access-tracking.rs:LL:CC
 
 note: tracking was triggered
-  --> $DIR/alloc-access-tracking.rs:LL:CC
+  --> tests/pass/alloc-access-tracking.rs:LL:CC
    |
 LL |         *ptr = 42; // Crucially, only a write is printed here, no read!
    |         ^^^^^^^^^ write access to allocation with id $ALLOC
    |
    = note: BACKTRACE:
-   = note: inside `start` at $DIR/alloc-access-tracking.rs:LL:CC
+   = note: inside `start` at tests/pass/alloc-access-tracking.rs:LL:CC
 
 note: tracking was triggered
-  --> $DIR/alloc-access-tracking.rs:LL:CC
+  --> tests/pass/alloc-access-tracking.rs:LL:CC
    |
 LL |         assert_eq!(*ptr, 42);
    |         ^^^^^^^^^^^^^^^^^^^^ read access to allocation with id $ALLOC
@@ -27,11 +27,11 @@ LL |         assert_eq!(*ptr, 42);
    = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 note: tracking was triggered
-  --> $DIR/alloc-access-tracking.rs:LL:CC
+  --> tests/pass/alloc-access-tracking.rs:LL:CC
    |
 LL |         miri_dealloc(ptr, 123, 1);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^ freed allocation with id $ALLOC
    |
    = note: BACKTRACE:
-   = note: inside `start` at $DIR/alloc-access-tracking.rs:LL:CC
+   = note: inside `start` at tests/pass/alloc-access-tracking.rs:LL:CC
 
diff --git a/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stderr b/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stderr
index c05950ebdc7..b87063431ad 100644
--- a/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stderr
+++ b/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stderr
@@ -1,8 +1,8 @@
-$DIR/backtrace-api-v0.rs:LL:CC (func_d)
-$DIR/backtrace-api-v0.rs:LL:CC (func_c)
-$DIR/backtrace-api-v0.rs:LL:CC (func_b)
-$DIR/backtrace-api-v0.rs:LL:CC (func_a)
-$DIR/backtrace-api-v0.rs:LL:CC (main)
+tests/pass/backtrace/backtrace-api-v0.rs:LL:CC (func_d)
+tests/pass/backtrace/backtrace-api-v0.rs:LL:CC (func_c)
+tests/pass/backtrace/backtrace-api-v0.rs:LL:CC (func_b)
+tests/pass/backtrace/backtrace-api-v0.rs:LL:CC (func_a)
+tests/pass/backtrace/backtrace-api-v0.rs:LL:CC (main)
 RUSTLIB/core/src/ops/function.rs:LL:CC (<fn() as std::ops::FnOnce<()>>::call_once - shim(fn()))
 RUSTLIB/std/src/sys/backtrace.rs:LL:CC (std::sys::backtrace::__rust_begin_short_backtrace)
 RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start::{closure#0})
diff --git a/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stdout b/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stdout
index e6644b4453f..8c1bc5c353e 100644
--- a/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stdout
+++ b/src/tools/miri/tests/pass/backtrace/backtrace-api-v0.stdout
@@ -1,5 +1,5 @@
-$DIR/backtrace-api-v0.rs:24:14 (func_d)
-$DIR/backtrace-api-v0.rs:14:9 (func_c)
-$DIR/backtrace-api-v0.rs:9:5 (func_b::<u8>)
-$DIR/backtrace-api-v0.rs:5:5 (func_a)
-$DIR/backtrace-api-v0.rs:29:18 (main)
+tests/pass/backtrace/backtrace-api-v0.rs:24:14 (func_d)
+tests/pass/backtrace/backtrace-api-v0.rs:14:9 (func_c)
+tests/pass/backtrace/backtrace-api-v0.rs:9:5 (func_b::<u8>)
+tests/pass/backtrace/backtrace-api-v0.rs:5:5 (func_a)
+tests/pass/backtrace/backtrace-api-v0.rs:29:18 (main)
diff --git a/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stderr b/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stderr
index b56d983d429..2c729c49ee0 100644
--- a/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stderr
+++ b/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stderr
@@ -1,8 +1,8 @@
-$DIR/backtrace-api-v1.rs:LL:CC (func_d)
-$DIR/backtrace-api-v1.rs:LL:CC (func_c)
-$DIR/backtrace-api-v1.rs:LL:CC (func_b)
-$DIR/backtrace-api-v1.rs:LL:CC (func_a)
-$DIR/backtrace-api-v1.rs:LL:CC (main)
+tests/pass/backtrace/backtrace-api-v1.rs:LL:CC (func_d)
+tests/pass/backtrace/backtrace-api-v1.rs:LL:CC (func_c)
+tests/pass/backtrace/backtrace-api-v1.rs:LL:CC (func_b)
+tests/pass/backtrace/backtrace-api-v1.rs:LL:CC (func_a)
+tests/pass/backtrace/backtrace-api-v1.rs:LL:CC (main)
 RUSTLIB/core/src/ops/function.rs:LL:CC (<fn() as std::ops::FnOnce<()>>::call_once - shim(fn()))
 RUSTLIB/std/src/sys/backtrace.rs:LL:CC (std::sys::backtrace::__rust_begin_short_backtrace)
 RUSTLIB/std/src/rt.rs:LL:CC (std::rt::lang_start::{closure#0})
diff --git a/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stdout b/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stdout
index 11efd2f0752..5c2995e132a 100644
--- a/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stdout
+++ b/src/tools/miri/tests/pass/backtrace/backtrace-api-v1.stdout
@@ -1,5 +1,5 @@
-$DIR/backtrace-api-v1.rs:27:9 (func_d)
-$DIR/backtrace-api-v1.rs:14:9 (func_c)
-$DIR/backtrace-api-v1.rs:9:5 (func_b::<u8>)
-$DIR/backtrace-api-v1.rs:5:5 (func_a)
-$DIR/backtrace-api-v1.rs:34:18 (main)
+tests/pass/backtrace/backtrace-api-v1.rs:27:9 (func_d)
+tests/pass/backtrace/backtrace-api-v1.rs:14:9 (func_c)
+tests/pass/backtrace/backtrace-api-v1.rs:9:5 (func_b::<u8>)
+tests/pass/backtrace/backtrace-api-v1.rs:5:5 (func_a)
+tests/pass/backtrace/backtrace-api-v1.rs:34:18 (main)
diff --git a/src/tools/miri/tests/pass/backtrace/backtrace-global-alloc.stderr b/src/tools/miri/tests/pass/backtrace/backtrace-global-alloc.stderr
index b06dd1da3c6..d9414aa6518 100644
--- a/src/tools/miri/tests/pass/backtrace/backtrace-global-alloc.stderr
+++ b/src/tools/miri/tests/pass/backtrace/backtrace-global-alloc.stderr
@@ -1,5 +1,5 @@
    0: main
- at $DIR/backtrace-global-alloc.rs:LL:CC
+ at tests/pass/backtrace/backtrace-global-alloc.rs:LL:CC
    1: <fn() as std::ops::FnOnce<()>>::call_once - shim(fn())
  at RUSTLIB/core/src/ops/function.rs:LL:CC
    2: std::sys::backtrace::__rust_begin_short_backtrace
diff --git a/src/tools/miri/tests/pass/backtrace/backtrace-std.stderr b/src/tools/miri/tests/pass/backtrace/backtrace-std.stderr
index 84bdda59fce..d6d69ee837e 100644
--- a/src/tools/miri/tests/pass/backtrace/backtrace-std.stderr
+++ b/src/tools/miri/tests/pass/backtrace/backtrace-std.stderr
@@ -1,13 +1,13 @@
    0: func_d
- at $DIR/backtrace-std.rs:LL:CC
+ at tests/pass/backtrace/backtrace-std.rs:LL:CC
    1: func_c
- at $DIR/backtrace-std.rs:LL:CC
+ at tests/pass/backtrace/backtrace-std.rs:LL:CC
    2: func_b
- at $DIR/backtrace-std.rs:LL:CC
+ at tests/pass/backtrace/backtrace-std.rs:LL:CC
    3: func_a
- at $DIR/backtrace-std.rs:LL:CC
+ at tests/pass/backtrace/backtrace-std.rs:LL:CC
    4: main
- at $DIR/backtrace-std.rs:LL:CC
+ at tests/pass/backtrace/backtrace-std.rs:LL:CC
    5: <fn() as std::ops::FnOnce<()>>::call_once - shim(fn())
  at RUSTLIB/core/src/ops/function.rs:LL:CC
    6: std::sys::backtrace::__rust_begin_short_backtrace
diff --git a/src/tools/miri/tests/pass/concurrency/thread_park_isolated.rs b/src/tools/miri/tests/pass/concurrency/thread_park_isolated.rs
index 7852d495e28..35145fe9bd3 100644
--- a/src/tools/miri/tests/pass/concurrency/thread_park_isolated.rs
+++ b/src/tools/miri/tests/pass/concurrency/thread_park_isolated.rs
@@ -1,4 +1,4 @@
-//@ignore-target-apple: park_timeout on macOS uses the system clock
+//@ignore-target: apple # park_timeout on macOS uses the system clock
 use std::thread;
 use std::time::{Duration, Instant};
 
diff --git a/src/tools/miri/tests/pass/extern_types.stack.stderr b/src/tools/miri/tests/pass/extern_types.stack.stderr
index 2c9fc0192af..898c19d514b 100644
--- a/src/tools/miri/tests/pass/extern_types.stack.stderr
+++ b/src/tools/miri/tests/pass/extern_types.stack.stderr
@@ -1,5 +1,5 @@
 warning: reborrow of reference to `extern type`
-  --> $DIR/extern_types.rs:LL:CC
+  --> tests/pass/extern_types.rs:LL:CC
    |
 LL |     let x: &Foo = unsafe { &*(ptr::without_provenance::<()>(16) as *const Foo) };
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reborrow of a reference to `extern type` is not properly supported
@@ -7,5 +7,5 @@ LL |     let x: &Foo = unsafe { &*(ptr::without_provenance::<()>(16) as *const F
    = help: `extern type` are not compatible with the Stacked Borrows aliasing model implemented by Miri; Miri may miss bugs in this code
    = help: try running with `MIRIFLAGS=-Zmiri-tree-borrows` to use the more permissive but also even more experimental Tree Borrows aliasing checks instead
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/extern_types.rs:LL:CC
+   = note: inside `main` at tests/pass/extern_types.rs:LL:CC
 
diff --git a/src/tools/miri/tests/pass/function_calls/target_feature.rs b/src/tools/miri/tests/pass/function_calls/target_feature.rs
index 0be86ba3731..43df761bd0b 100644
--- a/src/tools/miri/tests/pass/function_calls/target_feature.rs
+++ b/src/tools/miri/tests/pass/function_calls/target_feature.rs
@@ -1,4 +1,4 @@
-//@only-target-x86_64: uses x86 target features
+//@only-target: x86_64 # uses x86 target features
 //@compile-flags: -C target-feature=+ssse3
 
 fn main() {
diff --git a/src/tools/miri/tests/pass/issues/issue-miri-3680.rs b/src/tools/miri/tests/pass/issues/issue-miri-3680.rs
index 55b896c91ad..c8e2498fa5a 100644
--- a/src/tools/miri/tests/pass/issues/issue-miri-3680.rs
+++ b/src/tools/miri/tests/pass/issues/issue-miri-3680.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: File handling is not implemented yet
+//@ignore-target: windows # File handling is not implemented yet
 //@compile-flags: -Zmiri-disable-isolation
 
 use std::fs::remove_file;
diff --git a/src/tools/miri/tests/pass/miri-alloc.rs b/src/tools/miri/tests/pass/miri-alloc.rs
index 8f172475418..17f6d5d05a5 100644
--- a/src/tools/miri/tests/pass/miri-alloc.rs
+++ b/src/tools/miri/tests/pass/miri-alloc.rs
@@ -4,7 +4,7 @@
 // windows tls dtors go through libstd right now, thus this test
 // cannot pass. When windows tls dtors go through the special magic
 // windows linker section, we can run this test on windows again.
-//@ignore-target-windows: no-std not supported on Windows
+//@ignore-target: windows # no-std not supported on Windows
 
 extern "Rust" {
     fn miri_alloc(size: usize, align: usize) -> *mut u8;
diff --git a/src/tools/miri/tests/pass/panic/catch_panic.stderr b/src/tools/miri/tests/pass/panic/catch_panic.stderr
index f61b39493ed..cb74312a83a 100644
--- a/src/tools/miri/tests/pass/panic/catch_panic.stderr
+++ b/src/tools/miri/tests/pass/panic/catch_panic.stderr
@@ -1,36 +1,36 @@
-thread 'main' panicked at $DIR/catch_panic.rs:LL:CC:
+thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
 Hello from std::panic
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 Caught panic message (&str): Hello from std::panic
-thread 'main' panicked at $DIR/catch_panic.rs:LL:CC:
+thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
 Hello from std::panic: 1
 Caught panic message (String): Hello from std::panic: 1
-thread 'main' panicked at $DIR/catch_panic.rs:LL:CC:
+thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
 Hello from std::panic_any: 2
 Caught panic message (String): Hello from std::panic_any: 2
-thread 'main' panicked at $DIR/catch_panic.rs:LL:CC:
+thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
 Box<dyn Any>
 Failed to get caught panic message.
-thread 'main' panicked at $DIR/catch_panic.rs:LL:CC:
+thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
 Hello from core::panic
 Caught panic message (&str): Hello from core::panic
-thread 'main' panicked at $DIR/catch_panic.rs:LL:CC:
+thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
 Hello from core::panic: 5
 Caught panic message (String): Hello from core::panic: 5
-thread 'main' panicked at $DIR/catch_panic.rs:LL:CC:
+thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
 index out of bounds: the len is 3 but the index is 4
 Caught panic message (String): index out of bounds: the len is 3 but the index is 4
-thread 'main' panicked at $DIR/catch_panic.rs:LL:CC:
+thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
 attempt to divide by zero
 Caught panic message (&str): attempt to divide by zero
 thread 'main' panicked at RUSTLIB/core/src/ptr/const_ptr.rs:LL:CC:
 align_offset: align is not a power-of-two
 Caught panic message (&str): align_offset: align is not a power-of-two
-thread 'main' panicked at $DIR/catch_panic.rs:LL:CC:
+thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
 assertion failed: false
 Caught panic message (&str): assertion failed: false
-thread 'main' panicked at $DIR/catch_panic.rs:LL:CC:
+thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
 assertion failed: false
 Caught panic message (&str): assertion failed: false
 Success!
diff --git a/src/tools/miri/tests/pass/panic/concurrent-panic.stderr b/src/tools/miri/tests/pass/panic/concurrent-panic.stderr
index fe0d16ca78a..9c87489e8db 100644
--- a/src/tools/miri/tests/pass/panic/concurrent-panic.stderr
+++ b/src/tools/miri/tests/pass/panic/concurrent-panic.stderr
@@ -1,13 +1,13 @@
 Thread 1 starting, will block on mutex
 Thread 1 reported it has started
-thread '<unnamed>' panicked at $DIR/concurrent-panic.rs:LL:CC:
+thread '<unnamed>' panicked at tests/pass/panic/concurrent-panic.rs:LL:CC:
 panic in thread 2
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
 Thread 2 blocking on thread 1
 Thread 2 reported it has started
 Unlocking mutex
-thread '<unnamed>' panicked at $DIR/concurrent-panic.rs:LL:CC:
+thread '<unnamed>' panicked at tests/pass/panic/concurrent-panic.rs:LL:CC:
 panic in thread 1
 Thread 1 has exited
 Thread 2 has exited
diff --git a/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr b/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr
index a346d31f645..e066f7dfce1 100644
--- a/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr
+++ b/src/tools/miri/tests/pass/panic/nested_panic_caught.stderr
@@ -1,7 +1,7 @@
-thread 'main' panicked at $DIR/nested_panic_caught.rs:LL:CC:
+thread 'main' panicked at tests/pass/panic/nested_panic_caught.rs:LL:CC:
 once
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
-thread 'main' panicked at $DIR/nested_panic_caught.rs:LL:CC:
+thread 'main' panicked at tests/pass/panic/nested_panic_caught.rs:LL:CC:
 twice
 stack backtrace:
diff --git a/src/tools/miri/tests/pass/panic/thread_panic.stderr b/src/tools/miri/tests/pass/panic/thread_panic.stderr
index 0fde5922c19..9464e76b6c9 100644
--- a/src/tools/miri/tests/pass/panic/thread_panic.stderr
+++ b/src/tools/miri/tests/pass/panic/thread_panic.stderr
@@ -1,6 +1,6 @@
-thread '<unnamed>' panicked at $DIR/thread_panic.rs:LL:CC:
+thread '<unnamed>' panicked at tests/pass/panic/thread_panic.rs:LL:CC:
 Hello!
 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
-thread 'childthread' panicked at $DIR/thread_panic.rs:LL:CC:
+thread 'childthread' panicked at tests/pass/panic/thread_panic.rs:LL:CC:
 Hello, world!
diff --git a/src/tools/miri/tests/pass/panic/unwind_dwarf.rs b/src/tools/miri/tests/pass/panic/unwind_dwarf.rs
index f690be471ba..ca90e4f4d94 100644
--- a/src/tools/miri/tests/pass/panic/unwind_dwarf.rs
+++ b/src/tools/miri/tests/pass/panic/unwind_dwarf.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: Windows uses a different unwinding mechanism
+//@ignore-target: windows # Windows uses a different unwinding mechanism
 #![feature(core_intrinsics, panic_unwind, rustc_attrs)]
 #![allow(internal_features)]
 
diff --git a/src/tools/miri/tests/pass/ptr_int_casts.tree.stderr b/src/tools/miri/tests/pass/ptr_int_casts.tree.stderr
index a34474ee0d6..21c5b2b0dfe 100644
--- a/src/tools/miri/tests/pass/ptr_int_casts.tree.stderr
+++ b/src/tools/miri/tests/pass/ptr_int_casts.tree.stderr
@@ -1,5 +1,5 @@
 warning: integer-to-pointer cast
-  --> $DIR/ptr_int_casts.rs:LL:CC
+  --> tests/pass/ptr_int_casts.rs:LL:CC
    |
 LL |     assert_eq!(1 as *const i32 as usize, 1);
    |                ^^^^^^^^^^^^^^^ integer-to-pointer cast
@@ -10,79 +10,79 @@ LL |     assert_eq!(1 as *const i32 as usize, 1);
    = help: you can then set `MIRIFLAGS=-Zmiri-strict-provenance` to ensure you are not relying on `with_exposed_provenance` semantics
    = help: Tree Borrows does not support integer-to-pointer casts, so the program is likely to go wrong when this pointer gets used
    = note: BACKTRACE:
-   = note: inside `ptr_int_casts` at $DIR/ptr_int_casts.rs:LL:CC
+   = note: inside `ptr_int_casts` at tests/pass/ptr_int_casts.rs:LL:CC
 note: inside `main`
-  --> $DIR/ptr_int_casts.rs:LL:CC
+  --> tests/pass/ptr_int_casts.rs:LL:CC
    |
 LL |     ptr_int_casts();
    |     ^^^^^^^^^^^^^^^
 
 warning: integer-to-pointer cast
-  --> $DIR/ptr_int_casts.rs:LL:CC
+  --> tests/pass/ptr_int_casts.rs:LL:CC
    |
 LL |     assert_eq!((1 as *const i32).wrapping_offset(4) as usize, 1 + 4 * 4);
    |                ^^^^^^^^^^^^^^^^^ integer-to-pointer cast
    |
    = note: BACKTRACE:
-   = note: inside `ptr_int_casts` at $DIR/ptr_int_casts.rs:LL:CC
+   = note: inside `ptr_int_casts` at tests/pass/ptr_int_casts.rs:LL:CC
 note: inside `main`
-  --> $DIR/ptr_int_casts.rs:LL:CC
+  --> tests/pass/ptr_int_casts.rs:LL:CC
    |
 LL |     ptr_int_casts();
    |     ^^^^^^^^^^^^^^^
 
 warning: integer-to-pointer cast
-  --> $DIR/ptr_int_casts.rs:LL:CC
+  --> tests/pass/ptr_int_casts.rs:LL:CC
    |
 LL |     *val = (1 as *const u8).wrapping_offset(-4);
    |            ^^^^^^^^^^^^^^^^ integer-to-pointer cast
    |
    = note: BACKTRACE:
-   = note: inside `ptr_int_casts` at $DIR/ptr_int_casts.rs:LL:CC
+   = note: inside `ptr_int_casts` at tests/pass/ptr_int_casts.rs:LL:CC
 note: inside `main`
-  --> $DIR/ptr_int_casts.rs:LL:CC
+  --> tests/pass/ptr_int_casts.rs:LL:CC
    |
 LL |     ptr_int_casts();
    |     ^^^^^^^^^^^^^^^
 
 warning: integer-to-pointer cast
-  --> $DIR/ptr_int_casts.rs:LL:CC
+  --> tests/pass/ptr_int_casts.rs:LL:CC
    |
 LL |         let y = y as *const _;
    |                 ^^^^^^^^^^^^^ integer-to-pointer cast
    |
    = note: BACKTRACE:
-   = note: inside `ptr_int_casts` at $DIR/ptr_int_casts.rs:LL:CC
+   = note: inside `ptr_int_casts` at tests/pass/ptr_int_casts.rs:LL:CC
 note: inside `main`
-  --> $DIR/ptr_int_casts.rs:LL:CC
+  --> tests/pass/ptr_int_casts.rs:LL:CC
    |
 LL |     ptr_int_casts();
    |     ^^^^^^^^^^^^^^^
 
 warning: integer-to-pointer cast
-  --> $DIR/ptr_int_casts.rs:LL:CC
+  --> tests/pass/ptr_int_casts.rs:LL:CC
    |
 LL |         let x: fn() -> i32 = unsafe { mem::transmute(y as *mut u8) };
    |                                                      ^^^^^^^^^^^^ integer-to-pointer cast
    |
    = note: BACKTRACE:
-   = note: inside `ptr_int_casts` at $DIR/ptr_int_casts.rs:LL:CC
+   = note: inside `ptr_int_casts` at tests/pass/ptr_int_casts.rs:LL:CC
 note: inside `main`
-  --> $DIR/ptr_int_casts.rs:LL:CC
+  --> tests/pass/ptr_int_casts.rs:LL:CC
    |
 LL |     ptr_int_casts();
    |     ^^^^^^^^^^^^^^^
 
 warning: integer-to-pointer cast
-  --> $DIR/ptr_int_casts.rs:LL:CC
+  --> tests/pass/ptr_int_casts.rs:LL:CC
    |
 LL |     assert_eq!((-1i32) as usize as *const i32 as usize, (-1i32) as usize);
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ integer-to-pointer cast
    |
    = note: BACKTRACE:
-   = note: inside `ptr_int_casts` at $DIR/ptr_int_casts.rs:LL:CC
+   = note: inside `ptr_int_casts` at tests/pass/ptr_int_casts.rs:LL:CC
 note: inside `main`
-  --> $DIR/ptr_int_casts.rs:LL:CC
+  --> tests/pass/ptr_int_casts.rs:LL:CC
    |
 LL |     ptr_int_casts();
    |     ^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/pass/ptr_int_from_exposed.tree.stderr b/src/tools/miri/tests/pass/ptr_int_from_exposed.tree.stderr
index 614b0d26a63..aac6d0f48d0 100644
--- a/src/tools/miri/tests/pass/ptr_int_from_exposed.tree.stderr
+++ b/src/tools/miri/tests/pass/ptr_int_from_exposed.tree.stderr
@@ -1,5 +1,5 @@
 warning: integer-to-pointer cast
-  --> $DIR/ptr_int_from_exposed.rs:LL:CC
+  --> tests/pass/ptr_int_from_exposed.rs:LL:CC
    |
 LL |     let ptr = ptr::with_exposed_provenance::<i32>(x_usize).wrapping_offset(-128);
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ integer-to-pointer cast
@@ -10,9 +10,9 @@ LL |     let ptr = ptr::with_exposed_provenance::<i32>(x_usize).wrapping_offset(
    = help: you can then set `MIRIFLAGS=-Zmiri-strict-provenance` to ensure you are not relying on `with_exposed_provenance` semantics
    = help: Tree Borrows does not support integer-to-pointer casts, so the program is likely to go wrong when this pointer gets used
    = note: BACKTRACE:
-   = note: inside `ptr_roundtrip_out_of_bounds` at $DIR/ptr_int_from_exposed.rs:LL:CC
+   = note: inside `ptr_roundtrip_out_of_bounds` at tests/pass/ptr_int_from_exposed.rs:LL:CC
 note: inside `main`
-  --> $DIR/ptr_int_from_exposed.rs:LL:CC
+  --> tests/pass/ptr_int_from_exposed.rs:LL:CC
    |
 LL |     ptr_roundtrip_out_of_bounds();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/tools/miri/tests/pass/shims/fs-symlink.rs b/src/tools/miri/tests/pass/shims/fs-symlink.rs
index 4d5103b24c3..01bb713926c 100644
--- a/src/tools/miri/tests/pass/shims/fs-symlink.rs
+++ b/src/tools/miri/tests/pass/shims/fs-symlink.rs
@@ -1,6 +1,6 @@
 // Symlink tests are separate since they don't in general work on a Windows host.
-//@ignore-host-windows: creating symlinks requires admin permissions on Windows
-//@ignore-target-windows: File handling is not implemented yet
+//@ignore-host: windows # creating symlinks requires admin permissions on Windows
+//@ignore-target: windows # File handling is not implemented yet
 //@compile-flags: -Zmiri-disable-isolation
 
 use std::fs::{read_link, remove_file, File};
diff --git a/src/tools/miri/tests/pass/shims/fs-with-isolation.rs b/src/tools/miri/tests/pass/shims/fs-with-isolation.rs
index 8fa683085b9..c42f97458c4 100644
--- a/src/tools/miri/tests/pass/shims/fs-with-isolation.rs
+++ b/src/tools/miri/tests/pass/shims/fs-with-isolation.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: File handling is not implemented yet
+//@ignore-target: windows # File handling is not implemented yet
 //@compile-flags: -Zmiri-isolation-error=warn-nobacktrace
 //@normalize-stderr-test: "(stat(x)?)" -> "$$STAT"
 
diff --git a/src/tools/miri/tests/pass/shims/fs.rs b/src/tools/miri/tests/pass/shims/fs.rs
index 70e375b0981..761164a4ba3 100644
--- a/src/tools/miri/tests/pass/shims/fs.rs
+++ b/src/tools/miri/tests/pass/shims/fs.rs
@@ -1,4 +1,4 @@
-//@ignore-target-windows: File handling is not implemented yet
+//@ignore-target: windows # File handling is not implemented yet
 //@compile-flags: -Zmiri-disable-isolation
 
 #![feature(io_error_more)]
diff --git a/src/tools/miri/tests/pass/shims/windows-rand.rs b/src/tools/miri/tests/pass/shims/windows-rand.rs
index cfbc1d278a9..1947e6d1356 100644
--- a/src/tools/miri/tests/pass/shims/windows-rand.rs
+++ b/src/tools/miri/tests/pass/shims/windows-rand.rs
@@ -1,4 +1,4 @@
-//@only-target-windows: this directly tests windows-only functions
+//@only-target: windows # this directly tests windows-only functions
 use core::ffi::c_void;
 use core::mem::size_of_val;
 use core::ptr::null_mut;
diff --git a/src/tools/miri/tests/pass/shims/windows-threadname.rs b/src/tools/miri/tests/pass/shims/windows-threadname.rs
index c863ac670b6..29c3fa5d5f3 100644
--- a/src/tools/miri/tests/pass/shims/windows-threadname.rs
+++ b/src/tools/miri/tests/pass/shims/windows-threadname.rs
@@ -1,4 +1,4 @@
-//@only-target-windows: this directly tests windows-only functions
+//@only-target: windows # this directly tests windows-only functions
 
 use std::ffi::OsStr;
 use std::os::windows::ffi::OsStrExt;
diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-sha.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-sha.rs
index 79ac4432dff..4e892e6e3cb 100644
--- a/src/tools/miri/tests/pass/shims/x86/intrinsics-sha.rs
+++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-sha.rs
@@ -1,12 +1,5 @@
-// Ignore everything except x86 and x86_64
-// Any new targets that are added to CI should be ignored here.
-// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.)
-//@ignore-target-aarch64
-//@ignore-target-arm
-//@ignore-target-avr
-//@ignore-target-s390x
-//@ignore-target-thumbv7em
-//@ignore-target-wasm
+// We're testing x86 target specific features
+//@only-target: x86_64 i686
 //@compile-flags: -C target-feature=+sha,+sse2,+ssse3,+sse4.1
 
 #[cfg(target_arch = "x86")]
diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-adx.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-adx.rs
index 0fd4b7c0910..baa984e68d8 100644
--- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-adx.rs
+++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-adx.rs
@@ -1,12 +1,5 @@
-// Ignore everything except x86 and x86_64
-// Any new targets that are added to CI should be ignored here.
-// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.)
-//@ignore-target-aarch64
-//@ignore-target-arm
-//@ignore-target-avr
-//@ignore-target-s390x
-//@ignore-target-thumbv7em
-//@ignore-target-wasm
+// We're testing x86 target specific features
+//@only-target: x86_64 i686
 //@compile-flags: -C target-feature=+adx
 
 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-aes-vaes.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-aes-vaes.rs
index d4d1b6180a7..47f086f7340 100644
--- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-aes-vaes.rs
+++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-aes-vaes.rs
@@ -1,12 +1,5 @@
-// Ignore everything except x86 and x86_64
-// Any new targets that are added to CI should be ignored here.
-// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.)
-//@ignore-target-aarch64
-//@ignore-target-arm
-//@ignore-target-avr
-//@ignore-target-s390x
-//@ignore-target-thumbv7em
-//@ignore-target-wasm
+// We're testing x86 target specific features
+//@only-target: x86_64 i686
 //@compile-flags: -C target-feature=+aes,+vaes,+avx512f
 
 #![feature(avx512_target_feature, stdarch_x86_avx512)]
diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx.rs
index 3847a80be90..b3c2434c0d2 100644
--- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx.rs
+++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx.rs
@@ -1,12 +1,5 @@
-// Ignore everything except x86 and x86_64
-// Any new targets that are added to CI should be ignored here.
-// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.)
-//@ignore-target-aarch64
-//@ignore-target-arm
-//@ignore-target-avr
-//@ignore-target-s390x
-//@ignore-target-thumbv7em
-//@ignore-target-wasm
+// We're testing x86 target specific features
+//@only-target: x86_64 i686
 //@compile-flags: -C target-feature=+avx
 
 #[cfg(target_arch = "x86")]
diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx2.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx2.rs
index 8b8d8880e3b..de1abc81842 100644
--- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx2.rs
+++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx2.rs
@@ -1,12 +1,5 @@
-// Ignore everything except x86 and x86_64
-// Any new targets that are added to CI should be ignored here.
-// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.)
-//@ignore-target-aarch64
-//@ignore-target-arm
-//@ignore-target-avr
-//@ignore-target-s390x
-//@ignore-target-thumbv7em
-//@ignore-target-wasm
+// We're testing x86 target specific features
+//@only-target: x86_64 i686
 //@compile-flags: -C target-feature=+avx2
 
 #[cfg(target_arch = "x86")]
diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx512.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx512.rs
index a40eddde97c..db593063890 100644
--- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx512.rs
+++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-avx512.rs
@@ -1,12 +1,5 @@
-// Ignore everything except x86 and x86_64
-// Any new targets that are added to CI should be ignored here.
-// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.)
-//@ignore-target-aarch64
-//@ignore-target-arm
-//@ignore-target-avr
-//@ignore-target-s390x
-//@ignore-target-thumbv7em
-//@ignore-target-wasm
+// We're testing x86 target specific features
+//@only-target: x86_64 i686
 //@compile-flags: -C target-feature=+avx512f,+avx512vl,+avx512bitalg,+avx512vpopcntdq
 
 #![feature(avx512_target_feature)]
diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-bmi.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-bmi.rs
index 02f57f4b451..030258f21fa 100644
--- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-bmi.rs
+++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-bmi.rs
@@ -1,12 +1,5 @@
-// Ignore everything except x86 and x86_64
-// Any new targets that are added to CI should be ignored here.
-// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.)
-//@ignore-target-aarch64
-//@ignore-target-arm
-//@ignore-target-avr
-//@ignore-target-s390x
-//@ignore-target-thumbv7em
-//@ignore-target-wasm
+// We're testing x86 target specific features
+//@only-target: x86_64 i686
 //@compile-flags: -C target-feature=+bmi1,+bmi2
 
 #[cfg(target_arch = "x86")]
diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-pause-without-sse2.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-pause-without-sse2.rs
index 60da88df046..4d5ddd75f38 100644
--- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-pause-without-sse2.rs
+++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-pause-without-sse2.rs
@@ -1,12 +1,5 @@
-// Ignore everything except x86 and x86_64
-// Any new targets that are added to CI should be ignored here.
-// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.)
-//@ignore-target-aarch64
-//@ignore-target-arm
-//@ignore-target-avr
-//@ignore-target-s390x
-//@ignore-target-thumbv7em
-//@ignore-target-wasm
+// We're testing x86 target specific features
+//@only-target: x86_64 i686
 //@compile-flags: -C target-feature=-sse2
 
 #[cfg(target_arch = "x86")]
diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-pclmulqdq.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-pclmulqdq.rs
index 86ac5835a16..6051987f8d4 100644
--- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-pclmulqdq.rs
+++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-pclmulqdq.rs
@@ -1,12 +1,5 @@
-// Ignore everything except x86 and x86_64
-// Any new targets that are added to CI should be ignored here.
-// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.)
-//@ignore-target-aarch64
-//@ignore-target-arm
-//@ignore-target-avr
-//@ignore-target-s390x
-//@ignore-target-thumbv7em
-//@ignore-target-wasm
+// We're testing x86 target specific features
+//@only-target: x86_64 i686
 //@compile-flags: -C target-feature=+pclmulqdq
 
 #[cfg(target_arch = "x86")]
diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse3-ssse3.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse3-ssse3.rs
index 0b3be7f3cbd..10842160abd 100644
--- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse3-ssse3.rs
+++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse3-ssse3.rs
@@ -1,12 +1,5 @@
-// Ignore everything except x86 and x86_64
-// Any new targets that are added to CI should be ignored here.
-// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.)
-//@ignore-target-aarch64
-//@ignore-target-arm
-//@ignore-target-avr
-//@ignore-target-s390x
-//@ignore-target-thumbv7em
-//@ignore-target-wasm
+// We're testing x86 target specific features
+//@only-target: x86_64 i686
 // SSSE3 implicitly enables SSE3
 //@compile-flags: -C target-feature=+ssse3
 
diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse41.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse41.rs
index 8cd4e6308e2..7331c6ed0db 100644
--- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse41.rs
+++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse41.rs
@@ -1,12 +1,5 @@
-// Ignore everything except x86 and x86_64
-// Any new targets that are added to CI should be ignored here.
-// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.)
-//@ignore-target-aarch64
-//@ignore-target-arm
-//@ignore-target-avr
-//@ignore-target-s390x
-//@ignore-target-thumbv7em
-//@ignore-target-wasm
+// We're testing x86 target specific features
+//@only-target: x86_64 i686
 //@compile-flags: -C target-feature=+sse4.1
 
 #[cfg(target_arch = "x86")]
diff --git a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse42.rs b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse42.rs
index c87eb518774..30908baa6c1 100644
--- a/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse42.rs
+++ b/src/tools/miri/tests/pass/shims/x86/intrinsics-x86-sse42.rs
@@ -1,12 +1,5 @@
-// Ignore everything except x86 and x86_64
-// Any new targets that are added to CI should be ignored here.
-// (We cannot use `cfg`-based tricks here since the `target-feature` flags below only work on x86.)
-//@ignore-target-aarch64
-//@ignore-target-arm
-//@ignore-target-avr
-//@ignore-target-s390x
-//@ignore-target-thumbv7em
-//@ignore-target-wasm
+// We're testing x86 target specific features
+//@only-target: x86_64 i686
 //@compile-flags: -C target-feature=+sse4.2
 
 #[cfg(target_arch = "x86")]
diff --git a/src/tools/miri/tests/pass/stacked-borrows/issue-miri-2389.stderr b/src/tools/miri/tests/pass/stacked-borrows/issue-miri-2389.stderr
index 216bb6c76bc..bcb7a65e90f 100644
--- a/src/tools/miri/tests/pass/stacked-borrows/issue-miri-2389.stderr
+++ b/src/tools/miri/tests/pass/stacked-borrows/issue-miri-2389.stderr
@@ -1,5 +1,5 @@
 warning: integer-to-pointer cast
-  --> $DIR/issue-miri-2389.rs:LL:CC
+  --> tests/pass/stacked-borrows/issue-miri-2389.rs:LL:CC
    |
 LL |         let wildcard = &root0 as *const Cell<i32> as usize as *const Cell<i32>;
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ integer-to-pointer cast
@@ -10,5 +10,5 @@ LL |         let wildcard = &root0 as *const Cell<i32> as usize as *const Cell<i
    = help: you can then set `MIRIFLAGS=-Zmiri-strict-provenance` to ensure you are not relying on `with_exposed_provenance` semantics
    = help: alternatively, `MIRIFLAGS=-Zmiri-permissive-provenance` disables this warning
    = note: BACKTRACE:
-   = note: inside `main` at $DIR/issue-miri-2389.rs:LL:CC
+   = note: inside `main` at tests/pass/stacked-borrows/issue-miri-2389.rs:LL:CC
 
diff --git a/src/tools/miri/tests/pass/tls/macos_tlv_atexit.rs b/src/tools/miri/tests/pass/tls/macos_tlv_atexit.rs
index 845f50c1eba..4fc1e2c7b67 100644
--- a/src/tools/miri/tests/pass/tls/macos_tlv_atexit.rs
+++ b/src/tools/miri/tests/pass/tls/macos_tlv_atexit.rs
@@ -1,4 +1,4 @@
-//@only-target-darwin
+//@only-target: darwin
 
 use std::thread;
 
diff --git a/src/tools/miri/tests/pass/tls/win_tls_callback.rs b/src/tools/miri/tests/pass/tls/win_tls_callback.rs
index 99a8de29e91..a9155682923 100644
--- a/src/tools/miri/tests/pass/tls/win_tls_callback.rs
+++ b/src/tools/miri/tests/pass/tls/win_tls_callback.rs
@@ -1,5 +1,5 @@
 //! Ensure that we call Windows TLS callbacks in the local crate.
-//@only-target-windows
+//@only-target: windows
 // Calling eprintln in the callback seems to (re-)initialize some thread-local storage
 // and then leak the memory allocated for that. Let's just ignore these leaks,
 // that's not what this test is about.
diff --git a/src/tools/miri/tests/pass/wtf8.rs b/src/tools/miri/tests/pass/wtf8.rs
index be8348654a3..71b284f7e53 100644
--- a/src/tools/miri/tests/pass/wtf8.rs
+++ b/src/tools/miri/tests/pass/wtf8.rs
@@ -1,4 +1,4 @@
-//@only-target-windows
+//@only-target: windows
 
 use std::ffi::{OsStr, OsString};
 use std::os::windows::ffi::{OsStrExt, OsStringExt};
diff --git a/src/tools/miri/tests/ui.rs b/src/tools/miri/tests/ui.rs
index 125371daa8a..2c1561ea056 100644
--- a/src/tools/miri/tests/ui.rs
+++ b/src/tools/miri/tests/ui.rs
@@ -6,11 +6,23 @@ use std::{env, process::Command};
 
 use colored::*;
 use regex::bytes::Regex;
+use ui_test::build_manager::BuildManager;
 use ui_test::color_eyre::eyre::{Context, Result};
-use ui_test::{
-    status_emitter, CommandBuilder, Config, Format, Match, Mode, OutputConflictHandling,
-    RustfixMode,
-};
+use ui_test::custom_flags::edition::Edition;
+use ui_test::dependencies::DependencyBuilder;
+use ui_test::per_test_config::TestConfig;
+use ui_test::spanned::Spanned;
+use ui_test::{status_emitter, CommandBuilder, Config, Format, Match, OutputConflictHandling};
+
+#[derive(Copy, Clone, Debug)]
+enum Mode {
+    Pass,
+    /// Requires annotations
+    Fail,
+    /// Not used for tests, but for `miri run --dep`
+    RunDep,
+    Panic,
+}
 
 fn miri_path() -> PathBuf {
     PathBuf::from(env::var("MIRI").unwrap_or_else(|_| env!("CARGO_BIN_EXE_miri").into()))
@@ -77,32 +89,52 @@ fn miri_config(target: &str, path: &str, mode: Mode, with_dependencies: bool) ->
 
     let mut config = Config {
         target: Some(target.to_owned()),
-        stderr_filters: stderr_filters().into(),
-        stdout_filters: stdout_filters().into(),
-        mode,
         program,
         out_dir: PathBuf::from(std::env::var_os("CARGO_TARGET_DIR").unwrap()).join("miri_ui"),
-        edition: Some("2021".into()), // keep in sync with `./miri run`
         threads: std::env::var("MIRI_TEST_THREADS")
             .ok()
             .map(|threads| NonZero::new(threads.parse().unwrap()).unwrap()),
         ..Config::rustc(path)
     };
 
+    config.comment_defaults.base().exit_status = match mode {
+        Mode::Pass => Some(0),
+        Mode::Fail => Some(1),
+        Mode::RunDep => None,
+        Mode::Panic => Some(101),
+    }
+    .map(Spanned::dummy)
+    .into();
+
+    config.comment_defaults.base().require_annotations =
+        Spanned::dummy(matches!(mode, Mode::Fail)).into();
+
+    config.comment_defaults.base().normalize_stderr =
+        stderr_filters().iter().map(|(m, p)| (m.clone(), p.to_vec())).collect();
+    config.comment_defaults.base().normalize_stdout =
+        stdout_filters().iter().map(|(m, p)| (m.clone(), p.to_vec())).collect();
+
+    // keep in sync with `./miri run`
+    config.comment_defaults.base().add_custom("edition", Edition("2021".into()));
+
     if with_dependencies {
         // Set the `cargo-miri` binary, which we expect to be in the same folder as the `miri` binary.
         // (It's a separate crate, so we don't get an env var from cargo.)
-        config.dependency_builder.program = {
+        let mut program = CommandBuilder::cargo();
+        program.program = {
             let mut prog = miri_path();
             prog.set_file_name(format!("cargo-miri{}", env::consts::EXE_SUFFIX));
             prog
         };
         let builder_args = ["miri", "run"]; // There is no `cargo miri build` so we just use `cargo miri run`.
-        config.dependency_builder.args = builder_args.into_iter().map(Into::into).collect();
-        config.dependencies_crate_manifest_path =
-            Some(Path::new("test_dependencies").join("Cargo.toml"));
+        program.args = builder_args.into_iter().map(Into::into).collect();
+        let crate_manifest_path = Path::new("test_dependencies").join("Cargo.toml");
         // Reset `RUSTFLAGS` to work around <https://github.com/rust-lang/rust/pull/119574#issuecomment-1876878344>.
-        config.dependency_builder.envs.push(("RUSTFLAGS".into(), None));
+        program.envs.push(("RUSTFLAGS".into(), None));
+        config.comment_defaults.base().set_custom(
+            "dependencies",
+            DependencyBuilder { program, crate_manifest_path, build_std: None },
+        );
     }
     config
 }
@@ -140,8 +172,6 @@ fn run_tests(
         }
     }
     config.program.args.push("-Zui-testing".into());
-    config.program.args.push("--target".into());
-    config.program.args.push(target.into());
 
     // If we're testing the native-lib functionality, then build the shared object file for testing
     // external C function calls and push the relevant compiler flag.
@@ -153,14 +183,13 @@ fn run_tests(
     }
 
     // Handle command-line arguments.
-    let args = ui_test::Args::test()?;
-    let default_bless = env::var_os("RUSTC_BLESS").is_some_and(|v| v != "0");
-    config.with_args(&args, default_bless);
-    if let OutputConflictHandling::Error(msg) = &mut config.output_conflict_handling {
-        *msg = "./miri test --bless".into();
-    }
+    let mut args = ui_test::Args::test()?;
+    args.bless |= env::var_os("RUSTC_BLESS").is_some_and(|v| v != "0");
+    config.with_args(&args);
+    config.bless_command = Some("./miri test --bless".into());
+
     if env::var_os("MIRI_SKIP_UI_CHECKS").is_some() {
-        assert!(!default_bless, "cannot use RUSTC_BLESS and MIRI_SKIP_UI_CHECKS at the same time");
+        assert!(!args.bless, "cannot use RUSTC_BLESS and MIRI_SKIP_UI_CHECKS at the same time");
         config.output_conflict_handling = OutputConflictHandling::Ignore;
     }
     eprintln!("   Compiler: {}", config.program.display());
@@ -171,7 +200,7 @@ fn run_tests(
         // The files we're actually interested in (all `.rs` files).
         ui_test::default_file_filter,
         // This could be used to overwrite the `Config` on a per-test basis.
-        |_, _, _| {},
+        |_, _| {},
         (
             match args.format {
                 Format::Terse => status_emitter::Text::quiet(),
@@ -287,47 +316,28 @@ fn main() -> Result<()> {
     ui(Mode::Pass, "tests/pass", &target, WithoutDependencies, tmpdir.path())?;
     ui(Mode::Pass, "tests/pass-dep", &target, WithDependencies, tmpdir.path())?;
     ui(Mode::Panic, "tests/panic", &target, WithDependencies, tmpdir.path())?;
-    ui(
-        Mode::Fail { require_patterns: true, rustfix: RustfixMode::Disabled },
-        "tests/fail",
-        &target,
-        WithoutDependencies,
-        tmpdir.path(),
-    )?;
-    ui(
-        Mode::Fail { require_patterns: true, rustfix: RustfixMode::Disabled },
-        "tests/fail-dep",
-        &target,
-        WithDependencies,
-        tmpdir.path(),
-    )?;
+    ui(Mode::Fail, "tests/fail", &target, WithoutDependencies, tmpdir.path())?;
+    ui(Mode::Fail, "tests/fail-dep", &target, WithDependencies, tmpdir.path())?;
     if cfg!(unix) {
         ui(Mode::Pass, "tests/native-lib/pass", &target, WithoutDependencies, tmpdir.path())?;
-        ui(
-            Mode::Fail { require_patterns: true, rustfix: RustfixMode::Disabled },
-            "tests/native-lib/fail",
-            &target,
-            WithoutDependencies,
-            tmpdir.path(),
-        )?;
+        ui(Mode::Fail, "tests/native-lib/fail", &target, WithoutDependencies, tmpdir.path())?;
     }
 
     Ok(())
 }
 
 fn run_dep_mode(target: String, args: impl Iterator<Item = OsString>) -> Result<()> {
-    let mut config = miri_config(
-        &target,
-        "",
-        Mode::Yolo { rustfix: RustfixMode::Disabled },
-        /* with dependencies */ true,
-    );
-    config.program.args.clear(); // remove the `--error-format` that ui_test adds by default
-    let dep_args = config.build_dependencies()?;
+    let mut config = miri_config(&target, "", Mode::RunDep, /* with dependencies */ true);
+    config.comment_defaults.base().custom.remove("edition"); // `./miri` adds an `--edition` in `args`, so don't set it twice
+    config.fill_host_and_target()?;
+    config.program.args = args.collect();
+
+    let test_config = TestConfig::one_off_runner(config.clone(), PathBuf::new());
 
-    let mut cmd = config.program.build(&config.out_dir);
-    cmd.args(dep_args);
+    let build_manager = BuildManager::one_off(config);
+    let mut cmd = test_config.config.program.build(&test_config.config.out_dir);
+    // Build dependencies
+    test_config.apply_custom(&mut cmd, &build_manager).unwrap();
 
-    cmd.args(args);
     if cmd.spawn()?.wait()?.success() { Ok(()) } else { std::process::exit(1) }
 }