1
Fork 0

Don't infer attributes of virtual calls based on the function body

This commit is contained in:
DianQK 2025-02-26 19:54:34 +08:00
parent 28d3fef399
commit 8089fce101
No known key found for this signature in database
5 changed files with 52 additions and 60 deletions

View file

@ -111,8 +111,9 @@ pub enum InstanceKind<'tcx> {
/// Dynamic dispatch to `<dyn Trait as Trait>::fn`.
///
/// This `InstanceKind` does not have callable MIR. Calls to `Virtual` instances must be
/// codegen'd as virtual calls through the vtable.
/// This `InstanceKind` may have a callable MIR as the default implementation.
/// Calls to `Virtual` instances must be codegen'd as virtual calls through the vtable.
/// *This means we might not know exactly what is being called.*
///
/// If this is reified to a `fn` pointer, a `ReifyShim` is used (see `ReifyShim` above for more
/// details on that).