about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
diff options
context:
space:
mode:
authorDianQK <dianqk@dianqk.net>2025-02-26 19:54:34 +0800
committerDianQK <dianqk@dianqk.net>2025-02-27 12:57:26 +0800
commit8089fce101f4ac2ed68c8df080c61102b0210429 (patch)
treea7400ec1b517feea55c608876a265db3902344c7 /compiler/rustc_middle/src
parent28d3fef3991d52cf7bf3908944191d86b487a815 (diff)
downloadrust-8089fce101f4ac2ed68c8df080c61102b0210429.tar.gz
rust-8089fce101f4ac2ed68c8df080c61102b0210429.zip
Don't infer attributes of virtual calls based on the function body
Diffstat (limited to 'compiler/rustc_middle/src')
-rw-r--r--compiler/rustc_middle/src/ty/instance.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/ty/instance.rs b/compiler/rustc_middle/src/ty/instance.rs
index e9c19331e4a..98ca71b86be 100644
--- a/compiler/rustc_middle/src/ty/instance.rs
+++ b/compiler/rustc_middle/src/ty/instance.rs
@@ -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).