(rvalue: &Rvalue<'tcx>)
| 506 | } |
| 507 | } |
| 508 | |
| 509 | fn process_rvalue(rvalue: &Rvalue<'tcx>) -> Vec<Option<AccessPattern<'tcx>>> { |
| 510 | match rvalue { |
| 511 | Rvalue::Use(operand) | Rvalue::Repeat(operand, _) | Rvalue::Cast(_, operand, _) => { |
| 512 | vec![Self::process_operand(operand)] |
| 513 | } |
| 514 | // Regard `p = &*q` as `p = q` |
| 515 | Rvalue::Ref(_, _, place) | Rvalue::RawPtr(_, place) => match place.as_ref() { |
| 516 | PlaceRef { |
| 517 | local: l, |
| 518 | projection: [ProjectionElem::Deref, ref remain @ ..], |
| 519 | } => vec![Some(AccessPattern::Direct(PlaceRef { |
| 520 | local: l, |
| 521 | projection: remain, |
| 522 | }))], |
| 523 | _ => vec![Some(AccessPattern::Ref(place.as_ref()))], |
| 524 | }, |
| 525 | Rvalue::Aggregate(_, fields) => { |
| 526 | let fields = fields.iter().map(Self::process_operand).collect::<Vec<_>>(); |
| 527 | fields |
| 528 | } |
| 529 | _ => vec![], |
| 530 | } |
| 531 | } |
| 532 | |
| 533 | /// dest: *const T = Vec::as_ptr(arg: &Vec<T>) => |
nothing calls this directly
no outgoing calls
no test coverage detected