Skip to content

Commit

Permalink
Use run-make diff output for stable output test
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Nov 29, 2024
1 parent 6b758e2 commit 05e6714
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
12 changes: 12 additions & 0 deletions tests/run-make/missing-unstable-trait-bound/missing-bound.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
error[E0277]: the trait bound `T: Step` is not satisfied
--> missing-bound.rs:2:14
|
2 | for _ in t {}
| ^ the trait `Step` is not implemented for `T`
|
= note: required for `std::ops::Range<T>` to implement `Iterator`
= note: required for `std::ops::Range<T>` to implement `IntoIterator`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0277`.
8 changes: 5 additions & 3 deletions tests/run-make/missing-unstable-trait-bound/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
// Ensure that on stable we don't suggest restricting with an unsafe trait and we continue
// mentioning the rest of the obligation chain.

use run_make_support::{rust_lib_name, rustc};
use run_make_support::{diff, rust_lib_name, rustc};

fn main() {
rustc()
let out = rustc()
.env("RUSTC_BOOTSTRAP", "-1")
.input("missing-bound.rs")
.run_fail()
Expand All @@ -18,5 +18,7 @@ fn main() {
r#"
= note: required for `std::ops::Range<T>` to implement `Iterator`
= note: required for `std::ops::Range<T>` to implement `IntoIterator`"#,
);
)
.stderr_utf8();
diff().expected_file("missing-bound.stderr").actual_text("(stable rustc)", &out).run()
}

0 comments on commit 05e6714

Please sign in to comment.