Self-doped p–n junctions in two-dimensional In2X3 van der Waals materials