Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.

Commit d244f66

Browse files
committed
Provide helpful error message if not using nightly.
1 parent 892a95c commit d244f66

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/parse_and_replace.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ fn compile(file: &Path, mode: &str) -> Result<Output, Error> {
5454
fn compile_and_get_json_errors(file: &Path, mode: &str) -> Result<String, Error> {
5555
let res = compile(file, mode)?;
5656
let stderr = String::from_utf8(res.stderr)?;
57+
if stderr.contains("is only accepted on the nightly compiler") {
58+
panic!("rustfix tests require a nightly compiler");
59+
}
5760

5861
match res.status.code() {
5962
Some(0) | Some(1) | Some(101) => Ok(stderr),
@@ -160,7 +163,7 @@ fn test_rustfix_with_file<P: AsRef<Path>>(file: P, mode: &str) -> Result<(), Err
160163
))?;
161164
let expected_suggestions =
162165
rustfix::get_suggestions_from_json(&expected_json, &HashSet::new(), filter_suggestions)
163-
.context("could not load expected suggesitons")?;
166+
.context("could not load expected suggestions")?;
164167

165168
ensure!(
166169
expected_suggestions == suggestions,

0 commit comments

Comments
 (0)