9882: fix: Don't call deprecated `compile` regex method r=lnicola a=lnicola

Fixes #9872

It looks like `compile` expects to be called like `RegExp.compile("foo", "m")`, so calling `.compile()` on an existing regex replaces it with an empty one.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
This commit is contained in:
bors[bot] 2021-08-14 07:39:46 +00:00 committed by GitHub
commit 49dbb74a0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -133,7 +133,7 @@ export async function getRustcId(dir: string): Promise<string> {
// do not memoize the result because the toolchain may change between runs // do not memoize the result because the toolchain may change between runs
const data = await execute(`${rustcPath} -V -v`, { cwd: dir }); const data = await execute(`${rustcPath} -V -v`, { cwd: dir });
const rx = /commit-hash:\s(.*)$/m.compile(); const rx = /commit-hash:\s(.*)$/m;
return rx.exec(data)![1]; return rx.exec(data)![1];
} }