In which pali canon texts does the Buddha mention a craving for nonexistence? I'm just curious to see what it means in its wider context. I suspect its mentioned in a number of different places but any reference will be good.
The Buddha mentions the 'craving' in his first sermon, which is/was the Dhammacakkappavattana Sutta: Setting the Wheel of Dhamma in Motion, in which he describes the 'four noble truths'.
"Now this, monks, is the noble truth of stress: Birth is stressful, aging is stressful, death is stressful; sorrow, lamentation, pain, distress, & despair are stressful; association with the unbeloved is stressful, separation from the loved is stressful, not getting what is wanted is stressful. In short, the five clinging-aggregates are stressful.
"And this, monks, is the noble truth of the origination of stress: the craving that makes for further becoming — accompanied by passion & delight, relishing now here & now there — i.e., craving for sensual pleasure, craving for becoming, craving for non-becoming.
"And this, monks, is the noble truth of the cessation of stress: the remainderless fading & cessation, renunciation, relinquishment, release, & letting go of that very craving.
"And this, monks, is the noble truth of the way of practice leading to the cessation of stress: precisely this Noble Eightfold Path — right view, right resolve, right speech, right action, right livelihood, right effort, right mindfulness, right concentration.
See also Vibhava-tanha (craving not to be).
Note that this commentary equates that with what's called annihilation-ism, a.k.a. materialism (ucchedavaada):
99 Kāma-taṇhā is hankering after and becoming attached to pleasures of the senses. Bhava- taṇhā is hankering after and becoming attached to continued existence, either the current sensual existence or a better and higher existence in the rūpa (fine material) or arūpa (non-material) brahmā realms, or becoming attached to the rūpa and arūpa jhānas. Vibhava- taṇhā is hankering after and becoming attached to the idea that there is no kamma for rebirth, and hence no future existence.
Pali discourses that use this three-fold typology include DN 15, DN 22, MN 44, SN 22.22, SN 22.103, SN 22.104, SN 22.105, SN 38.10, SN 39.10, SN 45.170, SN 56.11, SN 56.13 and SN 56.14.
For example, DN 15 says e.g.,
[...] craving for sensuality, craving for becoming, craving for no becoming [...]