The figurative meaning comes from Confucius in 《
论语·
公冶长》 (the Analects, Book 5):
朽木不可雕也,
粪土之墙不可圬也 — 'rotten wood cannot be carved, a wall of dung cannot be plastered'. Confucius said this of his student Zai Yu, who slept during the day. Today
朽木 alone, and especially the chengyu
朽木不可雕, brands someone as unteachable.