The recently proposed trans-Planckian censorship conjecture (TCC) amounts to the claim that inflation models with an inflationary energy scale larger than Λinfmax∼109GeV belong to the swampland, i.e., cannot be embedded into a consistent theory of quantum gravity. In this paper, we point out that this constraint can be readily satisfied in D-term hybrid inflation (DHI), which is a well-motivated inflation scenario in the context of supersymmetric grand unification. In DHI, the amplitude of the primordial scalar power spectrum originates from a Fayet–Iliopoulos term of the order of the unification scale, ξ∼1016GeV. At the same time, the TCC results in an upper bound on the corresponding gauge coupling constant of gmax∼10−14. We are able to show that this constraint translates into an upper bound on the gravitino mass of m3/2max∼10MeV, which opens the possibility that dark matter is accounted for by thermally produced gravitinos, if the reheating temperature is close to Treh∼100TeV. Interestingly enough, a somewhat similar gravitino mass range has recently been derived in a model that aims at explaining dark energy in terms of axion quintessence and resolving the Hubble tension by means of decaying gravitino dark matter.