Energy bandgaps are observed to increase with decreasing diameter due to quantum confinement in quasi-one-dimensional semiconductor nanostructures or nanowires. A similar effect is observed in semimetal nanowires for sufficiently small wire diameters: A bandgap is induced, and the semimetal nanowire becomes a semiconductor. We demonstrate that on the length scale on which the semimetal semiconductor transition occurs, this enables the use of bandgap engineering to form a field-effect transistor near atomic dimensions and eliminates the need for doping in the transistor's source, channel, or drain. By removing the requirement to supply free carriers by introducing dopant impurities, quantum confinement allows for a materials engineering to overcome the primary obstacle to fabricating sub-5 nm transistors, enabling aggressive scaling to near atomic limits.