Skip to content

Commit bb74d13

Browse files
committed
fix: use createTempPath for Rust
1 parent 67abf6e commit bb74d13

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/grammars/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,8 @@ const OtherGrammars = {
520520
if (windows) {
521521
return [`/c rustc ${filepath} && ${filename.slice(0, Number(-4) + 1 || undefined)}.exe`]
522522
} else {
523-
return ["-c", `rustc '${filepath}' -o /tmp/rs.out && /tmp/rs.out`]
523+
const tempOutFile = GrammarUtils.createTempPath("rs-", ".out")
524+
return ["-c", `rustc '${filepath}' -o ${tempOutFile} && ${tempOutFile}`]
524525
}
525526
},
526527
},

0 commit comments

Comments
 (0)