A workman was crushed underneath soil when an unsafe trench collapsed.