{"record":{"id":"23dca06f9fed756d","repo":"sxyazi/yazi","slug":"unsupported","errorCode":"Unsupported","errorMessage":"trash is not supported on this platform","messagePattern":"trash is not supported on this platform","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"warning","filePath":"yazi-fs/src/trash/unsupported/trash.rs","lineNumber":12,"sourceCode":"use std::{io, path::Path};\n\nuse super::super::{TrashEntries, TrashEntry, TrashId};\nuse crate::{cha::Cha, file::File};\n\npub struct Trash;\n\nimpl Trash {\n\tpub fn new() -> io::Result<Self> { Ok(Self) }\n\n\tpub fn list(&self, _entry: Option<&TrashEntry>) -> io::Result<Vec<TrashEntry>> {\n\t\tErr(io::Error::new(io::ErrorKind::Unsupported, \"trash is not supported on this platform\"))\n\t}\n\n\tpub fn entry(&self, _id: &TrashId) -> io::Result<TrashEntry> {\n\t\tErr(io::Error::new(io::ErrorKind::Unsupported, \"trash is not supported on this platform\"))\n\t}\n\n\tpub fn metadata(&self, _entry: &TrashEntry, _: bool) -> io::Result<Cha> {\n\t\tErr(io::Error::new(io::ErrorKind::Unsupported, \"trash is not supported on this platform\"))\n\t}\n\n\tpub(crate) fn revalidate(\n\t\t&self,\n\t\t_entry: Option<&TrashEntry>,\n\t\t_current: &File,\n\t) -> io::Result<Option<File>> {\n\t\tErr(io::Error::new(io::ErrorKind::Unsupported, \"trash is not supported on this platform\"))\n\t}\n","sourceCodeStart":1,"sourceCodeEnd":30,"githubUrl":"https://github.com/sxyazi/yazi/blob/5f901b886b14de1f17460b6e52e9de5d67f8aba9/yazi-fs/src/trash/unsupported/trash.rs#L1-L30","documentation":"On platforms without trash support, the unsupported Trash backend is compiled in and every operation returns io::ErrorKind::Unsupported. list() unconditionally throws this — trash listing is simply not available on this platform.","triggerScenarios":"Calling Trash::list() (or any Trash API) on a platform compiled with the unsupported backend (e.g. non-macOS/Windows without a trash implementation).","commonSituations":"Running yazi on a platform lacking trash support, or a build where the trash feature is disabled; code paths assuming a working trash backend.","solutions":["Check platform support before invoking trash APIs and hide/disable trash UI","Use a manual 'move to folder' fallback instead of the trash","Build for a platform with a supported trash backend"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"match trash.list(None) {\n    Err(e) if e.kind() == io::ErrorKind::Unsupported => show_fallback_view(),\n    other => other?,\n}","preventionTips":["Detect platform trash support at startup and disable trash features","Provide a move-to-folder fallback when Unsupported is returned","Avoid assuming a trash backend exists in cross-platform code"],"tags":["unsupported","platform","trash"],"backgroundTag":"unsupported-platform","analyzedSha":"5f901b886b14de1f17460b6e52e9de5d67f8aba9","analyzedAt":"2026-09-02T18:38:25.566Z","contentChangedAt":"2026-09-02T18:38:25.566Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}