diff options
| author | DianQK <dianqk@dianqk.net> | 2025-02-26 19:54:34 +0800 |
|---|---|---|
| committer | DianQK <dianqk@dianqk.net> | 2025-02-27 12:57:26 +0800 |
| commit | 8089fce101f4ac2ed68c8df080c61102b0210429 (patch) | |
| tree | a7400ec1b517feea55c608876a265db3902344c7 /compiler/rustc_middle/src/ty | |
| parent | 28d3fef3991d52cf7bf3908944191d86b487a815 (diff) | |
| download | rust-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/ty')
| -rw-r--r-- | compiler/rustc_middle/src/ty/instance.rs | 5 |
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). |
