Seven-Streams commented on code in PR #685:
URL: https://github.com/apache/tvm-ffi/pull/685#discussion_r3651208228
##########
rust/tvm-ffi-macros/src/object_macros.rs:
##########
@@ -31,6 +31,11 @@ pub fn derive_object(input: proc_macro::TokenStream) ->
TokenStream {
let type_key = get_attr(&derive_input, "type_key")
.map(attr_to_str)
.expect("Expect #[type_key = \"<my_type_key>\"] attribute");
+ let type_final = match get_attr(&derive_input, "type_final") {
Review Comment:
I think `type_final` can be `false` in cpp side?
##########
rust/tvm-ffi/src/match_any.rs:
##########
Review Comment:
Tests should not be here. why we have another file for `match_any`
##########
rust/tvm-ffi/src/extra/module.rs:
##########
Review Comment:
Why we need to add modules here instead of in tests
##########
rust/tvm-ffi/src/object.rs:
##########
@@ -50,6 +50,11 @@ unsafe impl<T: Send + Sync + ObjectCore> Sync for
ObjectArc<T> {}
pub unsafe trait ObjectCore: Sized + 'static {
/// the type key of the object
const TYPE_KEY: &'static str;
+ /// Whether every instance of this type has exactly `Self::type_index()`.
+ ///
+ /// A final type must never have a registered subtype.
+ #[doc(hidden)]
Review Comment:
I'm not sure if it's necessary. I think `ObjectCore` is not designed to be
exposed to users.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]