Skip to content

Commit bc8ff3f

Browse files
anyskaeddyb
authored andcommitted
rustc: tweak comments on InstanceDef.
1 parent 51ea260 commit bc8ff3f

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/librustc/ty/instance.rs

+9-12
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,9 @@ pub enum InstanceDef<'tcx> {
4040
/// `<fn() as FnTrait>::call_*`
4141
/// `DefId` is `FnTrait::call_*`.
4242
///
43-
/// NB: the (`fn` pointer) type must be monomorphic for MIR shims to work.
44-
// FIXME(eddyb) support generating shims for a "shallow type",
45-
// e.g. `fn(_, _) -> _` instead of requiring a fully monomorphic
46-
// `fn(Foo, Bar) -> Baz` etc.
43+
/// NB: the (`fn` pointer) type must currently be monomorphic to avoid double substitution
44+
/// problems with the MIR shim bodies. `Instance::resolve` enforces this.
45+
// FIXME(#69925) support polymorphic MIR shim bodies properly instead.
4746
FnPtrShim(DefId, Ty<'tcx>),
4847

4948
/// `<dyn Trait as Trait>::fn`, "direct calls" of which are implicitly
@@ -63,18 +62,16 @@ pub enum InstanceDef<'tcx> {
6362
/// The `Option<Ty<'tcx>>` is either `Some(T)`, or `None` for empty drop
6463
/// glue.
6564
///
66-
/// NB: the type must be monomorphic for MIR shims to work.
67-
// FIXME(eddyb) support generating shims for a "shallow type",
68-
// e.g. `Foo<_>` or `[_]` instead of requiring a fully monomorphic
69-
// `Foo<Bar>` or `[String]` etc.
65+
/// NB: the type must currently be monomorphic to avoid double substitution
66+
/// problems with the MIR shim bodies. `Instance::resolve` enforces this.
67+
// FIXME(#69925) support polymorphic MIR shim bodies properly instead.
7068
DropGlue(DefId, Option<Ty<'tcx>>),
7169

7270
///`<T as Clone>::clone` shim.
7371
///
74-
/// NB: the type must be monomorphic for MIR shims to work.
75-
// FIXME(eddyb) support generating shims for a "shallow type",
76-
// e.g. `Foo<_>` or `[_]` instead of requiring a fully monomorphic
77-
// `Foo<Bar>` or `[String]` etc.
72+
/// NB: the type must currently be monomorphic to avoid double substitution
73+
/// problems with the MIR shim bodies. `Instance::resolve` enforces this.
74+
// FIXME(#69925) support polymorphic MIR shim bodies properly instead.
7875
CloneShim(DefId, Ty<'tcx>),
7976
}
8077

0 commit comments

Comments
 (0)