This approach (ab)uses that trashed items can have naming conflicts and that one can change their parents, even though direct replacing ("moving") is forbidden.