Fix UB in the access of Priority for asyc executors

The `Priority` was generated on the stack in the dispatcher
which caused it to be dropped after usage. This is now fixed
by having the `Priority` being a static variable for executors
This commit is contained in:
Emil Fresk 2022-08-05 11:28:02 +02:00
parent b48a95e879
commit 46a3f2befd
5 changed files with 42 additions and 15 deletions

View file

@ -46,7 +46,14 @@ impl<'a> CargoCommand<'a> {
features,
mode,
} => {
let mut args = vec![self.name(), "--example", example, "--target", target];
let mut args = vec![
"+nightly",
self.name(),
"--example",
example,
"--target",
target,
];
if let Some(feature_name) = features {
args.extend_from_slice(&["--features", feature_name]);
@ -61,7 +68,7 @@ impl<'a> CargoCommand<'a> {
features,
mode,
} => {
let mut args = vec![self.name(), "--examples", "--target", target];
let mut args = vec!["+nightly", self.name(), "--examples", "--target", target];
if let Some(feature_name) = features {
args.extend_from_slice(&["--features", feature_name]);