(func: &Function)
| 3608 | } |
| 3609 | |
| 3610 | fn is_special_method(func: &Function) -> SpecialMethod { |
| 3611 | if matches!(func.kind, FunctionKind::Static(_)) { |
| 3612 | if func.name.starts_with("[resource-drop]") { |
| 3613 | SpecialMethod::ResourceDrop |
| 3614 | } else if func.name.starts_with("[resource-new]") { |
| 3615 | SpecialMethod::ResourceNew |
| 3616 | } else if func.name.starts_with("[resource-rep]") { |
| 3617 | SpecialMethod::ResourceRep |
| 3618 | } else if func.name.starts_with("[dtor]") { |
| 3619 | SpecialMethod::Dtor |
| 3620 | } else if func.name == "$alloc" { |
| 3621 | SpecialMethod::Allocate |
| 3622 | } else { |
| 3623 | SpecialMethod::None |
| 3624 | } |
| 3625 | } else { |
| 3626 | SpecialMethod::None |
| 3627 | } |
| 3628 | } |
| 3629 | |
| 3630 | /// Sort the specified types topologically, taking the parameter and result |
| 3631 | /// types of resource functions into consideration. |
no outgoing calls
no test coverage detected