diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/expectations/replace_template_alias.rs | 15 | ||||
-rw-r--r-- | tests/headers/replace_template_alias.hpp | 23 |
2 files changed, 38 insertions, 0 deletions
diff --git a/tests/expectations/replace_template_alias.rs b/tests/expectations/replace_template_alias.rs new file mode 100644 index 00000000..61a2fbcc --- /dev/null +++ b/tests/expectations/replace_template_alias.rs @@ -0,0 +1,15 @@ +/* automatically generated by rust-bindgen */ + + +#![allow(non_snake_case)] + + +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Rooted<T> { + pub ptr: MaybeWrapped<T>, +} +/// But the replacement type does use T! +/// +/// <div rustbindgen replaces="MaybeWrapped" /> +pub type MaybeWrapped<T> = T; diff --git a/tests/headers/replace_template_alias.hpp b/tests/headers/replace_template_alias.hpp new file mode 100644 index 00000000..6ceae4e5 --- /dev/null +++ b/tests/headers/replace_template_alias.hpp @@ -0,0 +1,23 @@ +// bindgen-flags: -- --std=c++14 + +namespace JS { +namespace detail { + +/// Notice how this doesn't use T. +template <typename T> +using MaybeWrapped = int; + +} + +template <typename T> +class Rooted { + detail::MaybeWrapped<T> ptr; +}; + +} + +/// But the replacement type does use T! +/// +/// <div rustbindgen replaces="MaybeWrapped" /> +template <typename T> +using replaces_MaybeWrapped = T; |