1
Fork 0

rustc: tweak comments on InstanceDef.

This commit is contained in:
Ana-Maria Mihalache 2020-03-11 15:20:31 +00:00 committed by Eduard-Mihai Burtescu
parent 51ea260ee7
commit bc8ff3fe8e

View file

@ -40,10 +40,9 @@ pub enum InstanceDef<'tcx> {
/// `<fn() as FnTrait>::call_*` /// `<fn() as FnTrait>::call_*`
/// `DefId` is `FnTrait::call_*`. /// `DefId` is `FnTrait::call_*`.
/// ///
/// NB: the (`fn` pointer) type must be monomorphic for MIR shims to work. /// NB: the (`fn` pointer) type must currently be monomorphic to avoid double substitution
// FIXME(eddyb) support generating shims for a "shallow type", /// problems with the MIR shim bodies. `Instance::resolve` enforces this.
// e.g. `fn(_, _) -> _` instead of requiring a fully monomorphic // FIXME(#69925) support polymorphic MIR shim bodies properly instead.
// `fn(Foo, Bar) -> Baz` etc.
FnPtrShim(DefId, Ty<'tcx>), FnPtrShim(DefId, Ty<'tcx>),
/// `<dyn Trait as Trait>::fn`, "direct calls" of which are implicitly /// `<dyn Trait as Trait>::fn`, "direct calls" of which are implicitly
@ -63,18 +62,16 @@ pub enum InstanceDef<'tcx> {
/// The `Option<Ty<'tcx>>` is either `Some(T)`, or `None` for empty drop /// The `Option<Ty<'tcx>>` is either `Some(T)`, or `None` for empty drop
/// glue. /// glue.
/// ///
/// NB: the type must be monomorphic for MIR shims to work. /// NB: the type must currently be monomorphic to avoid double substitution
// FIXME(eddyb) support generating shims for a "shallow type", /// problems with the MIR shim bodies. `Instance::resolve` enforces this.
// e.g. `Foo<_>` or `[_]` instead of requiring a fully monomorphic // FIXME(#69925) support polymorphic MIR shim bodies properly instead.
// `Foo<Bar>` or `[String]` etc.
DropGlue(DefId, Option<Ty<'tcx>>), DropGlue(DefId, Option<Ty<'tcx>>),
///`<T as Clone>::clone` shim. ///`<T as Clone>::clone` shim.
/// ///
/// NB: the type must be monomorphic for MIR shims to work. /// NB: the type must currently be monomorphic to avoid double substitution
// FIXME(eddyb) support generating shims for a "shallow type", /// problems with the MIR shim bodies. `Instance::resolve` enforces this.
// e.g. `Foo<_>` or `[_]` instead of requiring a fully monomorphic // FIXME(#69925) support polymorphic MIR shim bodies properly instead.
// `Foo<Bar>` or `[String]` etc.
CloneShim(DefId, Ty<'tcx>), CloneShim(DefId, Ty<'tcx>),
} }