1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! Compile-fail snapshots of the diagnostics the derives and the typed builders own.
//!
//! Each `tests/ui/*.rs` case feeds the crate a description it refuses and pins the compile error
//! against a `.stderr` snapshot, so a reworded or dropped message, or a span that moved off the
//! offending field, fails the build. The `tests/ui_build/*.rs` cases are refused while the crate
//! builds rather than while it is checked (a `const` evaluated per instantiation), so they run
//! under `cargo build`, next to a case that builds.
//!
//! The snapshots record one toolchain's exact wording, so they run on the stable toolchain this
//! repository selects, and only when `RUN_UI_TESTS=1`. To refresh them after an intentional
//! message change, run on stable and read every changed snapshot before committing it:
//!
//! ```text
//! TRYBUILD=overwrite RUN_UI_TESTS=1 cargo test -p ruststream-sqlx --all-features --test ui
//! ```
use env;
/// Whether this run skips the snapshots, and whether skipping them is allowed.
///
/// `RUN_UI_TESTS=1` opts in. `REQUIRE_UI_TESTS=1` says a skip is not acceptable in this run: the
/// gates set it wherever they set the opt-in, so a dropped or misspelled opt-in fails the run
/// instead of passing with nothing checked.
///
/// # Panics
///
/// Panics when a run that requires the snapshots is not set up to run them.