Skip to content

Type Collector meta-issue #73

@gtrepta

Description

@gtrepta

struct TyCollector<'tcx> {
tcx: TyCtxt<'tcx>,
types: TyMap,
resolved: HashSet<stable_mir::ty::Ty>,
}

TODO

  • Emit signatures for monomorphized FnDefs

    TyKind::RigidTy(RigidTy::FnDef(def, ref args)) => {
    self.resolved.insert(*ty);
    let instance = Instance::resolve(def, args).unwrap();
    self.visit_instance(instance)
    }

    fn visit_instance(&mut self, instance: Instance) -> ControlFlow<<Self as Visitor>::Break> {
    let fn_abi = instance.fn_abi().unwrap();
    let mut inputs_outputs: Vec<stable_mir::ty::Ty> =
    fn_abi.args.iter().map(|arg_abi| arg_abi.ty).collect();
    inputs_outputs.push(fn_abi.ret.ty);
    inputs_outputs.super_visit(self)
    }

    The resolved argument and return types get added to the collector's TyMap, but should we also add the type for the resolved function signature?

  • Investigate CoroutineWitness

    // Break on CoroutineWitnesses, because they aren't expected when getting the layout
    TyKind::RigidTy(RigidTy::CoroutineWitness(..)) => ControlFlow::Break(()),

  • Investigate whether or not we're adding unmonomorphized/mir to the type map.
    Look into anything offered by the compiler interface like predicates, or match/print statements we can come up with to catch anything.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions