hack to work around RA quirk

This commit is contained in:
Ralf Jung 2021-11-25 17:35:14 -05:00
parent 4f0faed6d2
commit 5d71528e4d
2 changed files with 6 additions and 2 deletions

3
cargo-miri/miri Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
# Hack to work around https://github.com/rust-analyzer/rust-analyzer/issues/10793.
exec "$(dirname "$0")"/../miri "$@"

5
miri
View file

@ -39,10 +39,11 @@ EOF
TARGET=$(rustc --version --verbose | grep "^host:" | cut -d ' ' -f 2)
SYSROOT=$(rustc --print sysroot)
LIBDIR=$SYSROOT/lib/rustlib/$TARGET/lib
MIRIDIR=$(dirname "$0")
if readlink -e . &>/dev/null; then
# This platform supports `readlink -e`.
MIRIDIR=$(readlink -e "$MIRIDIR")
MIRIDIR=$(dirname "$(readlink -e "$0")")
else
MIRIDIR=$(dirname "$0")
fi
if ! test -d "$LIBDIR"; then
echo "Something went wrong determining the library dir."