Skip to content

Commit 70d35ed

Browse files
afflomclaude
andcommitted
Fix BinOp Debug format in closure-body grammar error
`syn::BinOp` does not implement `Debug` on the CI Rust toolchain, so the emit_term_for_binary fallback arm's `format!("...{:?}...", other)` failed to compile. Replace the formatted message with a fixed-string version that lists the recognised operators without quoting the offending one (its span is already attached via `new_spanned`). Bump version to 0.3.6 (uor-foundation@0.3.5 was already published before the consumer-smoke step in v0.3.5's CI failed, so the index claims that slot — bumping to land the BinOp fix and the ADR-013/TR-08 + ADR-029 substrate work). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent eb53c81 commit 70d35ed

7 files changed

Lines changed: 21 additions & 27 deletions

File tree

Cargo.lock

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ members = [
1818
resolver = "2"
1919

2020
[workspace.package]
21-
version = "0.3.5"
21+
version = "0.3.6"
2222
edition = "2021"
2323
rust-version = "1.83"
2424
license = "Apache-2.0"

codegen/src/sdk_macros.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,13 +1556,10 @@ fn emit_term_for_binary(
15561556
syn::BinOp::BitXor(_) => quote! { ::uor_foundation::PrimitiveOp::Xor },
15571557
syn::BinOp::BitAnd(_) => quote! { ::uor_foundation::PrimitiveOp::And },
15581558
syn::BinOp::BitOr(_) => quote! { ::uor_foundation::PrimitiveOp::Or },
1559-
ref other => {
1559+
_ => {
15601560
return Err(syn::Error::new_spanned(
15611561
expr,
1562-
format!(
1563-
"closure violation: binary operator `{:?}` is not in the closure-body grammar; recognised operators are arithmetic (+, -, *), bitwise (^, &, |), and byte-level comparison (<=, <, >=, >)",
1564-
other
1565-
),
1562+
"closure violation: binary operator is not in the closure-body grammar; recognised operators are arithmetic (+, -, *), bitwise (^, &, |), and byte-level comparison (<=, <, >=, >)",
15661563
));
15671564
}
15681565
};

foundation/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ typed Rust traits. Import and implement.
1616

1717
```toml
1818
[dependencies]
19-
uor-foundation = "0.3.5"
19+
uor-foundation = "0.3.6"
2020
```
2121

2222
### HostTypes (target §4.1 W10)

foundation/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
//! UOR Foundation — typed Rust traits for the complete ontology.
44
//!
5-
//! Version: 0.3.5
5+
//! Version: 0.3.6
66
//!
77
//! This crate exports every ontology class as a trait, every property as a
88
//! method, and every named individual as a constant. Implementations import

lean4/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# UOR Foundation — Lean 4 Formalization
22

33
Machine-generated Lean 4 structures, enums, and constants for the
4-
[UOR Foundation](https://uor.foundation/) ontology (v0.3.5).
4+
[UOR Foundation](https://uor.foundation/) ontology (v0.3.6).
55

66
**Do not edit manually** — regenerated by [UOR-Framework](https://github.com/UOR-Foundation/UOR-Framework).
77

uor-foundation-sdk/src/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,13 +1509,10 @@ fn emit_term_for_binary(
15091509
syn::BinOp::BitXor(_) => quote! { ::uor_foundation::PrimitiveOp::Xor },
15101510
syn::BinOp::BitAnd(_) => quote! { ::uor_foundation::PrimitiveOp::And },
15111511
syn::BinOp::BitOr(_) => quote! { ::uor_foundation::PrimitiveOp::Or },
1512-
ref other => {
1512+
_ => {
15131513
return Err(syn::Error::new_spanned(
15141514
expr,
1515-
format!(
1516-
"closure violation: binary operator `{:?}` is not in the closure-body grammar; recognised operators are arithmetic (+, -, *), bitwise (^, &, |), and byte-level comparison (<=, <, >=, >)",
1517-
other
1518-
),
1515+
"closure violation: binary operator is not in the closure-body grammar; recognised operators are arithmetic (+, -, *), bitwise (^, &, |), and byte-level comparison (<=, <, >=, >)",
15191516
));
15201517
}
15211518
};

0 commit comments

Comments
 (0)