File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -137,3 +137,23 @@ fn test_struct_with_lifetime() {
137137 assert ! ( rs. contains( "fn __f(arg0: ::cxx::UniquePtr<StructWithLifetime>) {" ) ) ;
138138 assert ! ( rs. contains( "impl<'a> self::Drop for super::StructWithLifetime<'a>" ) ) ;
139139}
140+
141+ #[ test]
142+ fn test_original_lifetimes_used_in_impls ( ) {
143+ let rs = bridge ( quote ! {
144+ mod ffi {
145+ struct Context <' sess> {
146+ session: & ' sess str ,
147+ }
148+ struct Server <' srv> {
149+ ctx: UniquePtr <Context <' srv>>,
150+ }
151+ struct Client <' clt> {
152+ ctx: UniquePtr <Context <' clt>>,
153+ }
154+ }
155+ } ) ;
156+
157+ // Verify if `'sess` vs `'clt` vs `'srv` lifetime name will be used in the generated code.
158+ assert ! ( rs. contains( "impl<'sess> ::cxx::memory::UniquePtrTarget for Context<'sess> {" ) ) ;
159+ }
You can’t perform that action at this time.
0 commit comments