File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -565,7 +565,7 @@ fn generate(config: &Config) -> Result<(), Box<dyn Error>> {
565565 match field. c_type . as_str ( ) {
566566 "rbs_string" => {
567567 writeln ! ( file, " #[must_use]" ) ?;
568- writeln ! ( file, " pub fn {}(&self) -> RBSString {{" , field. name) ?;
568+ writeln ! ( file, " pub fn {}(&self) -> RBSString<'a> {{" , field. name) ?;
569569 writeln ! (
570570 file,
571571 " RBSString::new(unsafe {{ &(*self.pointer).{} }})" ,
Original file line number Diff line number Diff line change @@ -238,14 +238,18 @@ impl Iterator for RBSLocationRangeListIter {
238238}
239239
240240#[ derive( Debug ) ]
241- pub struct RBSString {
241+ pub struct RBSString < ' a > {
242242 pointer : * const rbs_string_t ,
243+ marker : PhantomData < & ' a rbs_string_t > ,
243244}
244245
245- impl RBSString {
246+ impl < ' a > RBSString < ' a > {
246247 #[ must_use]
247248 pub fn new ( pointer : * const rbs_string_t ) -> Self {
248- Self { pointer }
249+ Self {
250+ pointer,
251+ marker : PhantomData ,
252+ }
249253 }
250254
251255 #[ must_use]
You can’t perform that action at this time.
0 commit comments