Ultrasound-assisted construction of halogen-bonded nanosized cocrystals that exhibit thermosensitive luminescence.