Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions rs_bindings_from_cc/test/type_alias/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ fn test_return_value() {
assert_eq!(return_underlying(i), 42);
}

#[gtest]
fn test_return_alias() {
use type_alias::return_alias;
assert_eq!(return_alias(42), 42);
}

/// Vector aliases are not supported (yet???).
#[gtest]
fn test_vector_alias() {
Expand Down
4 changes: 2 additions & 2 deletions rs_bindings_from_cc/test/type_alias/type_alias.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#ifndef CRUBIT_RS_BINDINGS_FROM_CC_TEST_TYPE_ALIAS_TYPE_ALIAS_H_
#define CRUBIT_RS_BINDINGS_FROM_CC_TEST_TYPE_ALIAS_TYPE_ALIAS_H_

#pragma clang lifetime_elision

namespace ns {
using Int = int;
}
Expand All @@ -16,6 +14,8 @@ using ns::Int;
// compiles.
inline int return_underlying(Int i) { return i; }

inline Int return_alias(int i) { return i; }

// This one, however, should NOT receive bindings.
using MyVector __attribute__((vector_size(16))) = int;
inline void VectorFunction(MyVector v) {}
Expand Down