Visit an existing file and type M-x rename-visited-file RET /path/to/existing/directory/ending/with/slash/ RET and notice that the command half succeeds. The file is successfully copied to the target directory, because 'rename-file' handles directories. 'set-visited-file-name' doesn't handle directories and signals an error.