This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm-tirx.git
The following commit(s) were added to refs/heads/main by this push:
new 56762d15d [Rust] Bump tvm-ffi to c244bc5f; mark subtypes of immutable
types immutable (#225)
56762d15d is described below
commit 56762d15d457ea94c5c95a4bc52941cd971ded5e
Author: Tianqi Chen <[email protected]>
AuthorDate: Sat Nov 7 16:02:23 2026 -0500
[Rust] Bump tvm-ffi to c244bc5f; mark subtypes of immutable types immutable
(#225)
Bump 3rdparty/tvm-ffi from 3718ae5b to apache/tvm-ffi c244bc5f
(apache/tvm-ffi#960) and mark subtypes of immutable object types
immutable, which tvm-ffi now requires at compile time: an immutable
parent's references cross threads, and a subtype reference can be
recovered from them.
- Regenerated bindings: `sym.CanonicalExpr`, `sym.SplitExpr`,
`sym.SumExpr`, `sym.IterMapExpr` and `transform.BasePassInstrument` gain
`#[type_immutable]`.
- `OpObj` declares `#[type_immutable]` in place of its hand-written
`ImmutableObject` impl, which the derive now needs to see.
- Types defined in Rust under `Type` or `Expr` (examples, tests, doc
examples and the extension guide's `ComplexType`) declare `immutable`.
- A test uses `expect_err`, now that `Any` implements `Debug`.
- `OpDef::set_attr`/`replace_attr` reject opaque-pointer values (a
pointer attribute could outlive its target); only the hook setters store
one.
- Imports of `DefRegionKind`, `InplaceMode`, `StructuralVisitorView` and
`StructuralMutatorView` use the tvm-ffi root re-exports.
- The Rust `AddObj` doc snippet shows `#[type_immutable]`.
---
3rdparty/tvm-ffi | 2 +-
docs/ir_guides/working_with_ir_in_rust.rst | 1 +
examples/extension_guides/rust/src/lib.rs | 2 +-
examples/ir_guides/rust/src/lib.rs | 7 +++----
rust/examples/define_ir.rs | 2 +-
rust/src/ir/op.rs | 7 +++----
rust/src/ir/op_def.rs | 19 +++++++++++++++----
rust/src/ir/transform/instrument.rs | 1 +
rust/src/ir/type_def.rs | 2 +-
rust/src/lib.rs | 4 ++--
rust/src/macro/def_expr_op_overloads.rs | 2 +-
rust/src/sym/analyzer.rs | 3 +++
rust/src/sym/iter_affine_map.rs | 1 +
.../tirx/structural_map_with_constraint_context.rs | 4 ++--
.../tirx/structural_mutate_with_constraint_context.rs | 7 +++----
.../tirx/structural_visit_with_constraint_context.rs | 6 ++++--
.../tirx/structural_walk_with_constraint_context.rs | 6 ++++--
rust/tests/ir/op_def.rs | 2 +-
rust/tests/ir/prim/op.rs | 2 +-
rust/tests/ir/type.rs | 2 +-
.../tirx/structural_map_with_constraint_context.rs | 3 +--
.../tirx/structural_mutate_with_constraint_context.rs | 5 +++--
.../tirx/structural_visit_with_constraint_context.rs | 4 ++--
.../tirx/structural_walk_with_constraint_context.rs | 5 +++--
24 files changed, 59 insertions(+), 40 deletions(-)
diff --git a/3rdparty/tvm-ffi b/3rdparty/tvm-ffi
index 3718ae5bf..c244bc5fc 160000
--- a/3rdparty/tvm-ffi
+++ b/3rdparty/tvm-ffi
@@ -1 +1 @@
-Subproject commit 3718ae5bfae64fd38e1258f8c7305bde827a7e43
+Subproject commit c244bc5fcbaac54bbc6f0563fccf302cb570388a
diff --git a/docs/ir_guides/working_with_ir_in_rust.rst
b/docs/ir_guides/working_with_ir_in_rust.rst
index 32dc4ed3c..89f29a155 100644
--- a/docs/ir_guides/working_with_ir_in_rust.rst
+++ b/docs/ir_guides/working_with_ir_in_rust.rst
@@ -200,6 +200,7 @@ This is the newtype pattern. Simplified from the crate, the
pair is:
#[repr(C)]
#[derive(Object)]
#[type_key = "prim.Add"]
+ #[type_immutable]
pub struct AddObj {
base_: ExprObj,
pub a: PrimExpr,
diff --git a/examples/extension_guides/rust/src/lib.rs
b/examples/extension_guides/rust/src/lib.rs
index d025c3839..1a8082a65 100644
--- a/examples/extension_guides/rust/src/lib.rs
+++ b/examples/extension_guides/rust/src/lib.rs
@@ -36,7 +36,7 @@ use tvm_tirx::tvm_ffi::{
// begin type
/// A complex number whose real and imaginary parts share a scalar type.
-#[rs_object("my_ext.ComplexType", final)]
+#[rs_object("my_ext.ComplexType", final, immutable)]
pub struct ComplexTypeObj {
base_: TypeObj,
pub dtype: PrimType,
diff --git a/examples/ir_guides/rust/src/lib.rs
b/examples/ir_guides/rust/src/lib.rs
index 39cab8495..fafdc6ae5 100644
--- a/examples/ir_guides/rust/src/lib.rs
+++ b/examples/ir_guides/rust/src/lib.rs
@@ -33,12 +33,11 @@ use tvm_tirx::sym::{Analyzer, ConstraintContext,
ProofStrength};
use
tvm_tirx::tirx::structural_map_with_constraint_context::structural_map_with_constraint_context;
use
tvm_tirx::tirx::structural_walk_with_constraint_context::structural_walk_with_constraint_context;
use tvm_tirx::tirx::Function;
-use tvm_tirx::tvm_ffi::extra::structural_mutate::StructuralMutatorView;
-use tvm_tirx::tvm_ffi::extra::structural_visit::{DefRegionKind,
StructuralVisitorView};
use tvm_tirx::tvm_ffi::object::ObjectIdentity;
use tvm_tirx::tvm_ffi::{
- self, dispatch, match_any, Any, AnyView, Array, MutationView,
ObjectRefCore, Result, Unchanged,
- UnchangedOr, VisitInterrupt, WalkOrder, WalkResult,
+ self, dispatch, match_any, Any, AnyView, Array, DefRegionKind,
MutationView, ObjectRefCore,
+ Result, StructuralMutatorView, StructuralVisitorView, Unchanged,
UnchangedOr, VisitInterrupt,
+ WalkOrder, WalkResult,
};
/// A Python list of strings.
diff --git a/rust/examples/define_ir.rs b/rust/examples/define_ir.rs
index afd3d772d..46e639454 100644
--- a/rust/examples/define_ir.rs
+++ b/rust/examples/define_ir.rs
@@ -49,7 +49,7 @@ fn loop_index(call: &CallObj) -> Result<Array<Var>> {
// A type, which Python constructs from its fields, `T.ExamplePair(T.int32,
T.float32)`, as it
// constructs a C++ type.
/// The type of a pair of values.
-#[rs_object("tirx.ExamplePairType", final)]
+#[rs_object("tirx.ExamplePairType", final, immutable)]
pub struct ExamplePairTypeObj {
base_: TypeObj,
pub first: Type,
diff --git a/rust/src/ir/op.rs b/rust/src/ir/op.rs
index ebe38dbe4..9b56eceac 100644
--- a/rust/src/ir/op.rs
+++ b/rust/src/ir/op.rs
@@ -59,6 +59,9 @@ use tvm_ffi::String;
#[derive(tvm_ffi::derive::Object)]
#[type_key = "ir.Op"]
#[type_final]
+// `ir.Op` is not `_type_mutable`: registration finishes initializing an
entry, and a shared one
+// is never mutated after.
+#[type_immutable]
pub struct OpObj {
base_: ExprObj,
/// The dense, process-local index of the operator into the attribute
columns; never
@@ -100,10 +103,6 @@ const _: () = {
assert!(::core::mem::offset_of!(OpObj, validator_is_custom) == 152);
};
-// SAFETY: `ir.Op` is not `_type_mutable`: registration finishes initializing
an entry, and a
-// shared one is never mutated after.
-unsafe impl tvm_ffi::object::ImmutableObject for OpObj {}
-
/// The validator slot of an operator: an opaque pointer to a C ABI adapter,
written while the
/// operator is registered and only read after, so it may be shared as the
rest of `OpObj` is.
#[repr(transparent)]
diff --git a/rust/src/ir/op_def.rs b/rust/src/ir/op_def.rs
index f6cdb7922..244b3f430 100644
--- a/rust/src/ir/op_def.rs
+++ b/rust/src/ir/op_def.rs
@@ -142,17 +142,17 @@ impl OpDef {
}
/// Register the value of the attribute `key` for the operator; a value
already registered
- /// fails the chain with a `ValueError`.
+ /// fails the chain with a `ValueError`, and an opaque pointer with a
`TypeError`.
pub fn set_attr<T: Into<Any>>(self, key: AttrKey<T>, value: impl Into<T>)
-> Self {
let value: T = value.into();
- self.attr(key.name, value.into(), false)
+ self.value_attr(key.name, value.into(), false)
}
/// Register the value of the attribute `key` for the operator, replacing
a value already
- /// registered.
+ /// registered; an opaque pointer fails the chain with a `TypeError`.
pub fn replace_attr<T: Into<Any>>(self, key: AttrKey<T>, value: impl
Into<T>) -> Self {
let value: T = value.into();
- self.attr(key.name, value.into(), true)
+ self.value_attr(key.name, value.into(), true)
}
/// Remove the operator's value of the attribute `key`; a missing value is
ignored, and live
@@ -226,6 +226,17 @@ impl OpDef {
self.attr("FRegionValidate", unsafe { hook.into_any() }, false)
}
+ /// [`attr`](Self::attr) for a value that is not a hook. Native code calls
an opaque pointer
+ /// in a hook column as a function, and operator attributes live for the
process, so only the
+ /// hook setters store one.
+ fn value_attr(self, key: &str, value: Any, replace: bool) -> Self {
+ if value.type_index() == tvm_ffi::TypeIndex::kTVMFFIOpaquePtr as i32 {
+ let message = format!("Attribute {key} cannot be an opaque
pointer");
+ return self.then(|_| Err(Error::new(TYPE_ERROR, &message, "")));
+ }
+ self.attr(key, value, replace)
+ }
+
fn attr(self, key: &str, value: Any, replace: bool) -> Self {
let key = String::from(key);
self.invoke(
diff --git a/rust/src/ir/transform/instrument.rs
b/rust/src/ir/transform/instrument.rs
index 27c21c41e..6fd2ee01e 100644
--- a/rust/src/ir/transform/instrument.rs
+++ b/rust/src/ir/transform/instrument.rs
@@ -88,6 +88,7 @@ pub struct BasePassInstrument {
#[repr(C)]
#[derive(tvm_ffi::derive::Object)]
#[type_key = "transform.BasePassInstrument"]
+#[type_immutable]
pub struct BasePassInstrumentObj {
base_: PassInstrumentObj,
}
diff --git a/rust/src/ir/type_def.rs b/rust/src/ir/type_def.rs
index 7b72f1457..8b9ffd72a 100644
--- a/rust/src/ir/type_def.rs
+++ b/rust/src/ir/type_def.rs
@@ -39,7 +39,7 @@ use tvm_ffi::{Function, ObjectCore, ObjectRefCore, Result,
String};
/// use tvm_tirx::script::script;
/// use tvm_tirx::tvm_ffi::{self, rs_object, IntoObjectRef};
///
-/// #[rs_object("my_ext.PairType", final)]
+/// #[rs_object("my_ext.PairType", final, immutable)]
/// pub struct PairTypeObj {
/// base_: TypeObj,
/// pub first: Type,
diff --git a/rust/src/lib.rs b/rust/src/lib.rs
index 1d5371571..cead6f4c2 100644
--- a/rust/src/lib.rs
+++ b/rust/src/lib.rs
@@ -71,7 +71,7 @@
//! use tvm_tirx::tvm_ffi::{self, Result};
//! # use tvm_tirx::ir::TypeObj;
//! # use tvm_tirx::tvm_ffi::{rs_object, ObjectRefCore};
-//! # #[rs_object("my_ext.PairType", final)]
+//! # #[rs_object("my_ext.PairType", final, immutable)]
//! # pub struct PairTypeObj { base_: TypeObj, pub first: Type, pub second:
Type }
//! # #[derive(Clone, tvm_ffi::derive::ObjectRef)]
//! # #[object_ref(parent = Type)]
@@ -105,7 +105,7 @@
//! use tvm_tirx::ir::{PrimType, Type, TypeObj, UNKNOWN_LOC};
//! use tvm_tirx::tvm_ffi::{self, rs_object, IntoObjectRef, ObjectRefCore};
//!
-//! #[rs_object("my_ext.PairType", final)]
+//! #[rs_object("my_ext.PairType", final, immutable)]
//! pub struct PairTypeObj {
//! base_: TypeObj,
//! pub first: Type,
diff --git a/rust/src/macro/def_expr_op_overloads.rs
b/rust/src/macro/def_expr_op_overloads.rs
index 27e705048..748706a4a 100644
--- a/rust/src/macro/def_expr_op_overloads.rs
+++ b/rust/src/macro/def_expr_op_overloads.rs
@@ -34,7 +34,7 @@
/// use tvm_tirx::sym::Analyzer;
/// use tvm_tirx::tvm_ffi::{self, rs_object, ObjectRefCore};
///
-/// #[rs_object("my_ext.ThreadIndex", final)]
+/// #[rs_object("my_ext.ThreadIndex", final, immutable)]
/// pub struct ThreadIndexObj {
/// base_: ExprObj,
/// pub axis: i64,
diff --git a/rust/src/sym/analyzer.rs b/rust/src/sym/analyzer.rs
index c7aa9b3a3..916cdb543 100644
--- a/rust/src/sym/analyzer.rs
+++ b/rust/src/sym/analyzer.rs
@@ -604,6 +604,7 @@ pub struct CanonicalExpr {
#[repr(C)]
#[derive(tvm_ffi::derive::Object)]
#[type_key = "sym.CanonicalExpr"]
+#[type_immutable]
pub struct CanonicalExprObj {
base_: ExprObj,
}
@@ -634,6 +635,7 @@ pub struct SplitExpr {
#[repr(C)]
#[derive(tvm_ffi::derive::Object)]
#[type_key = "sym.SplitExpr"]
+#[type_immutable]
pub struct SplitExprObj {
base_: CanonicalExprObj,
}
@@ -665,6 +667,7 @@ pub struct SumExpr {
#[repr(C)]
#[derive(tvm_ffi::derive::Object)]
#[type_key = "sym.SumExpr"]
+#[type_immutable]
pub struct SumExprObj {
base_: CanonicalExprObj,
}
diff --git a/rust/src/sym/iter_affine_map.rs b/rust/src/sym/iter_affine_map.rs
index 496c7e15e..ba0e00c6c 100644
--- a/rust/src/sym/iter_affine_map.rs
+++ b/rust/src/sym/iter_affine_map.rs
@@ -89,6 +89,7 @@ pub struct IterMapExpr {
#[repr(C)]
#[derive(tvm_ffi::derive::Object)]
#[type_key = "sym.IterMapExpr"]
+#[type_immutable]
pub struct IterMapExprObj {
base_: ExprObj,
}
diff --git a/rust/src/tirx/structural_map_with_constraint_context.rs
b/rust/src/tirx/structural_map_with_constraint_context.rs
index 478692085..26b6872b6 100644
--- a/rust/src/tirx/structural_map_with_constraint_context.rs
+++ b/rust/src/tirx/structural_map_with_constraint_context.rs
@@ -23,9 +23,9 @@
use std::borrow::BorrowMut;
-use tvm_ffi::extra::structural_visit::DefRegionKind;
use tvm_ffi::{
- Any, AnyView, Dispatcher, IntoDispatcher, MutationView, Object, Result,
UnchangedOr, WalkOrder,
+ Any, AnyView, DefRegionKind, Dispatcher, IntoDispatcher, MutationView,
Object, Result,
+ UnchangedOr, WalkOrder,
};
use super::structural_mutate_with_constraint_context::{
diff --git a/rust/src/tirx/structural_mutate_with_constraint_context.rs
b/rust/src/tirx/structural_mutate_with_constraint_context.rs
index 531e3be33..042e5ceb8 100644
--- a/rust/src/tirx/structural_mutate_with_constraint_context.rs
+++ b/rust/src/tirx/structural_mutate_with_constraint_context.rs
@@ -26,15 +26,14 @@ use std::cell::UnsafeCell;
use tvm_ffi::extra::cold_init_lazy_lock::ColdInitLazyLock;
use tvm_ffi::extra::structural_mutate::{
- InplaceMode, StructuralMutateEngine, StructuralMutatorBase,
StructuralMutatorObj,
- StructuralMutatorView,
+ StructuralMutateEngine, StructuralMutatorBase, StructuralMutatorObj,
};
use tvm_ffi::reflection::TypeAttrColumn;
use tvm_ffi::object::ObjectRef;
use tvm_ffi::tvm_ffi_sys::{TVMFFIAny, TVMFFITypeIndex};
use tvm_ffi::{
- Any, Dispatcher, IntoDispatcher, MutationView, ObjectArc, ObjectCore,
ObjectRefCore, Result,
- UnchangedOr,
+ Any, Dispatcher, InplaceMode, IntoDispatcher, MutationView, ObjectArc,
ObjectCore,
+ ObjectRefCore, Result, StructuralMutatorView, UnchangedOr,
};
use super::StructuralMutatorWithConstraintContextObj;
diff --git a/rust/src/tirx/structural_visit_with_constraint_context.rs
b/rust/src/tirx/structural_visit_with_constraint_context.rs
index 80a8daca6..406c9fbe3 100644
--- a/rust/src/tirx/structural_visit_with_constraint_context.rs
+++ b/rust/src/tirx/structural_visit_with_constraint_context.rs
@@ -26,11 +26,13 @@ use std::cell::UnsafeCell;
use tvm_ffi::extra::cold_init_lazy_lock::ColdInitLazyLock;
use tvm_ffi::extra::structural_visit::{
- StructuralVisitEngine, StructuralVisitorBase, StructuralVisitorObj,
StructuralVisitorView,
+ StructuralVisitEngine, StructuralVisitorBase, StructuralVisitorObj,
};
use tvm_ffi::reflection::TypeAttrColumn;
use tvm_ffi::tvm_ffi_sys::{TVMFFIAny, TVMFFITypeIndex};
-use tvm_ffi::{AnyView, Dispatcher, IntoDispatcher, ObjectCore, Result,
VisitInterrupt};
+use tvm_ffi::{
+ AnyView, Dispatcher, IntoDispatcher, ObjectCore, Result,
StructuralVisitorView, VisitInterrupt,
+};
use super::StructuralVisitorWithConstraintContextObj;
use crate::sym::ConstraintContext;
diff --git a/rust/src/tirx/structural_walk_with_constraint_context.rs
b/rust/src/tirx/structural_walk_with_constraint_context.rs
index c998cbb9c..f69d07d07 100644
--- a/rust/src/tirx/structural_walk_with_constraint_context.rs
+++ b/rust/src/tirx/structural_walk_with_constraint_context.rs
@@ -21,8 +21,10 @@
//! on every value with the facts in scope there, to observe the value, not to
rewrite it.
use std::borrow::BorrowMut;
-use tvm_ffi::extra::structural_visit::DefRegionKind;
-use tvm_ffi::{Any, AnyView, Dispatcher, IntoDispatcher, Result,
VisitInterrupt, WalkOrder, WalkResult};
+use tvm_ffi::{
+ Any, AnyView, DefRegionKind, Dispatcher, IntoDispatcher, Result,
VisitInterrupt, WalkOrder,
+ WalkResult,
+};
use crate::sym::ConstraintContext;
use super::structural_visit_with_constraint_context::{
diff --git a/rust/tests/ir/op_def.rs b/rust/tests/ir/op_def.rs
index 307f239ab..fe3417fa1 100644
--- a/rust/tests/ir/op_def.rs
+++ b/rust/tests/ir/op_def.rs
@@ -407,7 +407,7 @@ fn accept(_call: &CallObj) -> Result<()> {
}
/// A type and a count, registered with the operators when the test binary
loads.
-#[rs_object("rust_test.BlockType", final)]
+#[rs_object("rust_test.BlockType", final, immutable)]
pub struct BlockTypeObj {
base_: TypeObj,
pub elem: Type,
diff --git a/rust/tests/ir/prim/op.rs b/rust/tests/ir/prim/op.rs
index c5aedb5fc..3e512942c 100644
--- a/rust/tests/ir/prim/op.rs
+++ b/rust/tests/ir/prim/op.rs
@@ -489,7 +489,7 @@ fn select_folding_and_the_first_error() {
};
let direct =
global("prim._OpTruncDiv").call_tuple((Expr::from(&f), Expr::from(&x),
UnknownLoc::new()));
- let direct = direct.err().expect("the native operation raises");
+ let direct = direct.expect_err("the native operation raises");
assert_eq!(error.kind(), direct.kind());
assert_eq!(error.message(), direct.message());
// The type system rejects `string + 1`; the check a non-PrimType operand
needs fails.
diff --git a/rust/tests/ir/type.rs b/rust/tests/ir/type.rs
index 594161f66..3dffd1097 100644
--- a/rust/tests/ir/type.rs
+++ b/rust/tests/ir/type.rs
@@ -119,7 +119,7 @@ fn types_agree_with_cpp() {
}
/// A pair of types with a tag, defined in Rust.
-#[rs_object("testing.rust.PairType", final)]
+#[rs_object("testing.rust.PairType", final, immutable)]
pub struct PairTypeObj {
base_: TypeObj,
/// The first element.
diff --git a/rust/tests/tirx/structural_map_with_constraint_context.rs
b/rust/tests/tirx/structural_map_with_constraint_context.rs
index bb5fb867a..c50b48835 100644
--- a/rust/tests/tirx/structural_map_with_constraint_context.rs
+++ b/rust/tests/tirx/structural_map_with_constraint_context.rs
@@ -24,9 +24,8 @@ use tvm_tirx::sym::{
BindingConstraintObj, ConstraintContext, PredicateConstraintObj,
RangeConstraintObj,
};
use
tvm_tirx::tirx::structural_map_with_constraint_context::structural_map_with_constraint_context
as map;
-use tvm_tirx::tvm_ffi::extra::structural_visit::DefRegionKind;
use tvm_tirx::tvm_ffi::{
- Any, AnyView, Error, ObjectRefCore, Result, Unchanged, WalkOrder,
RUNTIME_ERROR,
+ Any, AnyView, DefRegionKind, Error, ObjectRefCore, Result, Unchanged,
WalkOrder, RUNTIME_ERROR,
};
use super::{int32, op};
diff --git a/rust/tests/tirx/structural_mutate_with_constraint_context.rs
b/rust/tests/tirx/structural_mutate_with_constraint_context.rs
index be99365bf..86ded3449 100644
--- a/rust/tests/tirx/structural_mutate_with_constraint_context.rs
+++ b/rust/tests/tirx/structural_mutate_with_constraint_context.rs
@@ -25,8 +25,9 @@ use
tvm_tirx::tirx::structural_mutate_with_constraint_context::{
structural_mutate_with_constraint_context as mutate,
StructuralMutatorWithConstraintContextView as View,
};
-use tvm_tirx::tvm_ffi::extra::structural_visit::DefRegionKind;
-use tvm_tirx::tvm_ffi::{dispatch, Any, MutationView, ObjectRefCore, Result,
Unchanged, UnchangedOr};
+use tvm_tirx::tvm_ffi::{
+ dispatch, Any, DefRegionKind, MutationView, ObjectRefCore, Result,
Unchanged, UnchangedOr,
+};
use super::{int32, op};
use crate::common::serial;
diff --git a/rust/tests/tirx/structural_visit_with_constraint_context.rs
b/rust/tests/tirx/structural_visit_with_constraint_context.rs
index 92fc9a9c1..1d7276712 100644
--- a/rust/tests/tirx/structural_visit_with_constraint_context.rs
+++ b/rust/tests/tirx/structural_visit_with_constraint_context.rs
@@ -24,9 +24,9 @@ use tvm_tirx::sym::{Constraint, ConstraintContext,
PredicateConstraintObj, Range
use tvm_tirx::tirx::structural_visit_with_constraint_context::{
structural_visit_with_constraint_context as visit,
StructuralVisitorWithConstraintContextView,
};
-use tvm_tirx::tvm_ffi::extra::structural_visit::DefRegionKind;
use tvm_tirx::tvm_ffi::{
- dispatch, AnyView, Array, Error, Map, ObjectRefCore, Result,
VisitInterrupt, RUNTIME_ERROR,
+ dispatch, AnyView, Array, DefRegionKind, Error, Map, ObjectRefCore,
Result, VisitInterrupt,
+ RUNTIME_ERROR,
};
use super::int32;
diff --git a/rust/tests/tirx/structural_walk_with_constraint_context.rs
b/rust/tests/tirx/structural_walk_with_constraint_context.rs
index 7be710df6..2cb1c34f8 100644
--- a/rust/tests/tirx/structural_walk_with_constraint_context.rs
+++ b/rust/tests/tirx/structural_walk_with_constraint_context.rs
@@ -24,8 +24,9 @@ use tvm_tirx::sym::{
Analyzer, BindingConstraintObj, ConstraintContext, PredicateConstraintObj,
RangeConstraintObj,
};
use
tvm_tirx::tirx::structural_walk_with_constraint_context::structural_walk_with_constraint_context
as walk;
-use tvm_tirx::tvm_ffi::extra::structural_visit::DefRegionKind;
-use tvm_tirx::tvm_ffi::{AnyView, Error, ObjectRefCore, Result, WalkOrder,
WalkResult, RUNTIME_ERROR};
+use tvm_tirx::tvm_ffi::{
+ AnyView, DefRegionKind, Error, ObjectRefCore, Result, WalkOrder,
WalkResult, RUNTIME_ERROR,
+};
use super::int32;
use crate::common::serial;