File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -1913,6 +1913,8 @@ pybind11::object PyValue::maybeDownCast() {
19131913 " mlirTypeID was expected to be non-null." );
19141914 std::optional<pybind11::function> valueCaster =
19151915 PyGlobals::get ().lookupValueCaster (mlirTypeID, mlirTypeGetDialect (type));
1916+ // py::return_value_policy::move means use std::move to move the return value
1917+ // contents into a new instance that will be owned by Python.
19161918 py::object thisObj = py::cast (this , py::return_value_policy::move);
19171919 if (!valueCaster)
19181920 return thisObj;
Original file line number Diff line number Diff line change @@ -366,7 +366,7 @@ def dont_cast_int_shouldnt_register(v):
366366 ...
367367
368368 except RuntimeError as e :
369- # CHECK: Value caster is already registered: <function testValueCasters.<locals>. cast_int at
369+ # CHECK: Value caster is already registered: {{.*}} cast_int
370370 print (e )
371371
372372 @register_value_caster (IntegerType .static_typeid , replace = True )
You can’t perform that action at this time.
0 commit comments