@@ -44,15 +44,17 @@ impl<T> MyOption<T> {
44
44
}
45
45
}
46
46
47
- // summary=repo::test;<crate::option::MyOption>::as_ref;Argument[self].Variant[crate::option::MyOption::MySome(0)];ReturnValue.Variant[crate::option::MyOption::MySome(0)];value;dfc-generated
47
+ // NOTE: The returned value inside the variant should be inside a `Reference`, requires handling
48
+ // `ref` in patterns.
49
+ // summary=repo::test;<crate::option::MyOption>::as_ref;Argument[self].Reference.Variant[crate::option::MyOption::MySome(0)];ReturnValue.Variant[crate::option::MyOption::MySome(0)];value;dfc-generated
48
50
pub fn as_ref ( & self ) -> MyOption < & T > {
49
51
match * self {
50
52
MySome ( ref x) => MySome ( x) ,
51
53
MyNone => MyNone ,
52
54
}
53
55
}
54
56
55
- // summary=repo::test;<crate::option::MyOption>::as_mut;Argument[self].Variant[crate::option::MyOption::MySome(0)];ReturnValue.Variant[crate::option::MyOption::MySome(0)];value;dfc-generated
57
+ // summary=repo::test;<crate::option::MyOption>::as_mut;Argument[self].Reference. Variant[crate::option::MyOption::MySome(0)];ReturnValue.Variant[crate::option::MyOption::MySome(0)];value;dfc-generated
56
58
pub fn as_mut ( & mut self ) -> MyOption < & mut T > {
57
59
match * self {
58
60
MySome ( ref mut x) => MySome ( x) ,
@@ -285,30 +287,34 @@ impl<T> MyOption<T> {
285
287
}
286
288
}
287
289
288
- // MISSING: summary=repo::test;<crate::option::MyOption>::insert;Argument[0];ReturnValue;value;dfc-generated
289
- // SPURIOUS-summary=repo::test;<crate::option::MyOption>::insert;Argument[self].Variant[crate::option::MyOption::MySome(0)];ReturnValue;value;dfc-generated
290
+ // summary=repo::test;<crate::option::MyOption>::insert;Argument[0];Argument[self].Reference.Variant[crate::option::MyOption::MySome(0)];value;dfc-generated
291
+ // The below should be `ReturnValue.Reference` and not just `ReturnValue`.
292
+ // SPURIOUS-summary=repo::test;<crate::option::MyOption>::insert;Argument[0];ReturnValue;value;dfc-generated
293
+ // The content of `self` is overwritten so it does not flow to the return value.
294
+ // SPURIOUS-summary=repo::test;<crate::option::MyOption>::insert;Argument[self].Reference.Variant[crate::option::MyOption::MySome(0)];ReturnValue;value;dfc-generated
290
295
pub fn insert ( & mut self , value : T ) -> & mut T {
291
296
* self = MySome ( value) ;
292
297
293
298
// SAFETY: the code above just filled the MyOption
294
299
unsafe { self . as_mut ( ) . unwrap_unchecked ( ) }
295
300
}
296
301
297
- // summary=repo::test;<crate::option::MyOption>::get_or_insert;Argument[self].Variant[crate::option::MyOption::MySome(0)];ReturnValue;value;dfc-generated
298
- // MISSING: repo::test;<crate::option::MyOption>::get_or_insert;Argument[0];ReturnValue;value;dfc-generated
302
+ // summary=repo::test;<crate::option::MyOption>::get_or_insert;Argument[0];Argument[self].Reference.Variant[crate::option::MyOption::MySome(0)];value;dfc-generated
303
+ // summary=repo::test;<crate::option::MyOption>::get_or_insert;Argument[0];ReturnValue;value;dfc-generated
304
+ // summary=repo::test;<crate::option::MyOption>::get_or_insert;Argument[self].Reference.Variant[crate::option::MyOption::MySome(0)];ReturnValue;value;dfc-generated
299
305
pub fn get_or_insert ( & mut self , value : T ) -> & mut T {
300
306
self . get_or_insert_with ( || value)
301
307
}
302
308
303
- // summary=repo::test;<crate::option::MyOption>::get_or_insert_default;Argument[self].Variant[crate::option::MyOption::MySome(0)];ReturnValue;value;dfc-generated
309
+ // summary=repo::test;<crate::option::MyOption>::get_or_insert_default;Argument[self].Reference. Variant[crate::option::MyOption::MySome(0)];ReturnValue;value;dfc-generated
304
310
pub fn get_or_insert_default ( & mut self ) -> & mut T
305
311
where
306
312
T : Default ,
307
313
{
308
314
self . get_or_insert_with ( T :: default)
309
315
}
310
316
311
- // summary=repo::test;<crate::option::MyOption>::get_or_insert_with;Argument[self].Variant[crate::option::MyOption::MySome(0)];ReturnValue;value;dfc-generated
317
+ // summary=repo::test;<crate::option::MyOption>::get_or_insert_with;Argument[self].Reference. Variant[crate::option::MyOption::MySome(0)];ReturnValue;value;dfc-generated
312
318
// MISSING: Mutating `self` parameter.
313
319
pub fn get_or_insert_with < F > ( & mut self , f : F ) -> & mut T
314
320
where
@@ -329,7 +335,7 @@ impl<T> MyOption<T> {
329
335
mem:: replace ( self , MyNone )
330
336
}
331
337
332
- // summary=repo::test;<crate::option::MyOption>::take_if;Argument[self].Variant[crate::option::MyOption::MySome(0)];Argument[0].Parameter[0];value;dfc-generated
338
+ // summary=repo::test;<crate::option::MyOption>::take_if;Argument[self].Reference. Variant[crate::option::MyOption::MySome(0)];Argument[0].Parameter[0];value;dfc-generated
333
339
// MISSING: Uses `take` which doesn't have flow
334
340
pub fn take_if < P > ( & mut self , predicate : P ) -> MyOption < T >
335
341
where
@@ -378,7 +384,7 @@ impl<T, U> MyOption<(T, U)> {
378
384
}
379
385
380
386
impl < T > MyOption < & T > {
381
- // summary=repo::test;<crate::option::MyOption>::copied;Argument[self].Variant[crate::option::MyOption::MySome(0)];ReturnValue.Variant[crate::option::MyOption::MySome(0)];value;dfc-generated
387
+ // summary=repo::test;<crate::option::MyOption>::copied;Argument[self].Variant[crate::option::MyOption::MySome(0)].Reference ;ReturnValue.Variant[crate::option::MyOption::MySome(0)];value;dfc-generated
382
388
pub fn copied ( self ) -> MyOption < T >
383
389
where
384
390
T : Copy ,
@@ -404,7 +410,7 @@ impl<T> MyOption<&T> {
404
410
}
405
411
406
412
impl < T > MyOption < & mut T > {
407
- // summary=repo::test;<crate::option::MyOption>::copied;Argument[self].Variant[crate::option::MyOption::MySome(0)];ReturnValue.Variant[crate::option::MyOption::MySome(0)];value;dfc-generated
413
+ // summary=repo::test;<crate::option::MyOption>::copied;Argument[self].Variant[crate::option::MyOption::MySome(0)].Reference ;ReturnValue.Variant[crate::option::MyOption::MySome(0)];value;dfc-generated
408
414
pub fn copied ( self ) -> MyOption < T >
409
415
where
410
416
T : Copy ,
@@ -474,14 +480,14 @@ impl<T> From<T> for MyOption<T> {
474
480
}
475
481
476
482
impl < ' a , T > From < & ' a MyOption < T > > for MyOption < & ' a T > {
477
- // summary=repo::test;<crate::option::MyOption as crate::convert::From>::from;Argument[0].Variant[crate::option::MyOption::MySome(0)];ReturnValue.Variant[crate::option::MyOption::MySome(0)];value;dfc-generated
483
+ // summary=repo::test;<crate::option::MyOption as crate::convert::From>::from;Argument[0].Reference. Variant[crate::option::MyOption::MySome(0)];ReturnValue.Variant[crate::option::MyOption::MySome(0)];value;dfc-generated
478
484
fn from ( o : & ' a MyOption < T > ) -> MyOption < & ' a T > {
479
485
o. as_ref ( )
480
486
}
481
487
}
482
488
483
489
impl < ' a , T > From < & ' a mut MyOption < T > > for MyOption < & ' a mut T > {
484
- // summary=repo::test;<crate::option::MyOption as crate::convert::From>::from;Argument[0].Variant[crate::option::MyOption::MySome(0)];ReturnValue.Variant[crate::option::MyOption::MySome(0)];value;dfc-generated
490
+ // summary=repo::test;<crate::option::MyOption as crate::convert::From>::from;Argument[0].Reference. Variant[crate::option::MyOption::MySome(0)];ReturnValue.Variant[crate::option::MyOption::MySome(0)];value;dfc-generated
485
491
fn from ( o : & ' a mut MyOption < T > ) -> MyOption < & ' a mut T > {
486
492
o. as_mut ( )
487
493
}
0 commit comments