  A search for high-mass dielectron and dimuon resonances in the mass range of
250 GeV to 6 TeV is presented. The data were recorded by the ATLAS experiment
in proton-proton collisions at a centre-of-mass energy of $\sqrt{s}=$13 TeV
during Run 2 of the Large Hadron Collider and correspond to an integrated
luminosity of 139 fb$^{-1}$. A functional form is fitted to the dilepton
invariant-mass distribution to model the contribution from background
processes, and a generic signal shape is used to determine the significance of
observed deviations from this background estimate. No significant deviation is
observed and upper limits are placed at the 95% confidence level on the
fiducial cross-section times branching ratio for various resonance width
hypotheses. The derived limits are shown to be applicable to spin-0, spin-1 and
spin-2 signal hypotheses. For a set of benchmark models, the limits are
converted into lower limits on the resonance mass and reach 4.5 TeV for the
E6-motivated $Z^\prime_\psi$ boson. Also presented are limits on Heavy Vector
Triplet model couplings.
