ISLE: reject multi-term rules with explicit priorities (#5663)
In multi-terms, all matching rules fire. We treat the result as an unordered set of values, so setting rule priorities is meaningless. We want to prohibit relying on the rule match order in this case. Also, codegen can produce invalid Rust if rules with different priorities both match against a multi-term. We first documented this symptom in #5647. As far as I can figure, prohibiting rule priorities prevents all possible instances of that bug. At some point in the future we might decide we want to carefully define semantics for multi-term result ordering, at which point we can revisit this.
This commit is contained in:
@@ -15,8 +15,12 @@ pub fn run_pass(filename: &str) {
|
||||
}
|
||||
|
||||
pub fn run_fail(filename: &str) {
|
||||
if build(filename).is_ok() {
|
||||
panic!("test {} passed unexpectedly", filename);
|
||||
match build(filename) {
|
||||
Ok(_) => panic!("test {} passed unexpectedly", filename),
|
||||
Err(err) => {
|
||||
// Log the actual errors for use with `cargo test -- --nocapture`
|
||||
println!("failed, as expected:\n{:?}", err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user