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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
use std::fmt;
use std::path::{Path, PathBuf};
use crate::generate::archetypes::Archetype;
use crate::generate::templates::TemplateError;
use crate::spec::types::OpSpec;
/// Generator failure.
#[derive(Debug)]
pub enum GenError {
/// The generation plan is internally inconsistent.
InvalidPlan {
/// Actionable reason the plan cannot be generated.
reason: String,
},
/// Template rendering failed.
Template(
/// Underlying template subsystem error.
TemplateError,
),
/// Generated Rust failed syntax validation.
InvalidRust {
/// Test name whose generated file failed parsing.
test_name: String,
/// Parser diagnostic.
reason: String,
},
/// Writing a generated file failed.
Io(
/// Underlying filesystem error.
std::io::Error,
),
/// Two tuples produced the same deterministic test name.
NameCollision(
/// Colliding deterministic test function name.
String,
),
/// The generator's independence certificate rejected an emitted test
/// because it would compute its expected value from the op under test
/// (tautology). See [`independence::verify_test_independence`] for the
/// specific rule that fired.
TautologicalTest {
/// The test function name that was rejected.
test_name: String,
/// The op under test whose call path appeared on the expected
/// binding's right-hand side.
op: String,
/// Source line of the offending binding.
line: usize,
/// The forbidden call path the certificate matched.
call_path: String,
/// Actionable hint — forwarded verbatim from the certificate.
hint: String,
},
/// Multiple errors occurred during generation.
Multiple(
/// Underlying errors.
Vec<GenError>,
),
/// Arity mismatch between archetype input and op signature.
ArityMismatch {
/// Expected arity from op signature.
expected: usize,
/// Actual arity from archetype input.
actual: usize,
/// Op id for context.
op: &'static str,
},
}