#[derive(Clone, PartialEq)]
pub enum CompareMode {
Nll,
+ Polonius,
}
impl CompareMode {
pub(crate) fn to_str(&self) -> &'static str {
match *self {
CompareMode::Nll => "nll",
+ CompareMode::Polonius => "polonius",
}
}
pub fn parse(s: String) -> CompareMode {
match s.as_str() {
"nll" => CompareMode::Nll,
+ "polonius" => CompareMode::Polonius,
x => panic!("unknown --compare-mode option: {}", x),
}
}
Some(CompareMode::Nll) => {
rustc.args(&["-Zborrowck=mir", "-Ztwo-phase-borrows"]);
}
+ Some(CompareMode::Polonius) => {
+ rustc.args(&["-Zpolonius", "-Zborrowck=mir", "-Ztwo-phase-borrows"]);
+ }
None => {}
}
&self.config.compare_mode,
kind,
);
- if !path.exists() && self.config.compare_mode.is_some() {
- // fallback!
+
+ if !path.exists() {
+ if let Some(CompareMode::Polonius) = self.config.compare_mode {
+ path = expected_output_path(&self.testpaths, self.revision, &Some(CompareMode::Nll), kind);
+ }
+ }
+
+ if !path.exists() {
path = expected_output_path(&self.testpaths, self.revision, &None, kind);
}