Skip to content

Commit 95db40f

Browse files
committed
Allowed vectors to be passed to build_pointer_cast
1 parent e7b31b8 commit 95db40f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -783,14 +783,14 @@ impl Builder {
783783
}
784784

785785
// SubType: <F, T>(&self, from: &PointerValue<F>, to: &PointerType<T>, name: &str) -> PointerValue<T> {
786-
pub fn build_pointer_cast(&self, from: &PointerValue, to: &PointerType, name: &str) -> PointerValue {
786+
pub fn build_pointer_cast<T: PointerMathValue>(&self, from: &T, to: &T::BaseType, name: &str) -> T {
787787
let c_string = CString::new(name).expect("Conversion to CString failed unexpectedly");
788788

789789
let value = unsafe {
790790
LLVMBuildPointerCast(self.builder, from.as_value_ref(), to.as_type_ref(), c_string.as_ptr())
791791
};
792792

793-
PointerValue::new(value)
793+
T::new(value)
794794
}
795795

796796
// SubType: <I>(&self, op, lhs: &IntValue<I>, rhs: &IntValue<I>, name) -> IntValue<bool> { ?

0 commit comments

Comments
 (0)