{"record":{"id":"9f7012cab50d7601","repo":"rust-lang/rust-analyzer","slug":"not-implemented-9f7012","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/paths/src/lib.rs","lineNumber":300,"sourceCode":"\n    pub fn file_name(&self) -> Option<&str> {\n        self.0.file_name()\n    }\n    pub fn extension(&self) -> Option<&str> {\n        self.0.extension()\n    }\n    pub fn file_stem(&self) -> Option<&str> {\n        self.0.file_stem()\n    }\n    pub fn as_os_str(&self) -> &OsStr {\n        self.0.as_os_str()\n    }\n    pub fn as_str(&self) -> &str {\n        self.0.as_str()\n    }\n    #[deprecated(note = \"use Display instead\")]\n    pub fn display(&self) -> ! {\n        unimplemented!()\n    }\n    #[deprecated(note = \"use std::fs::metadata().is_ok() instead\")]\n    pub fn exists(&self) -> ! {\n        unimplemented!()\n    }\n\n    pub fn components(&self) -> Utf8Components<'_> {\n        self.0.components()\n    }\n    // endregion:delegate-methods\n}\n\nimpl fmt::Display for AbsPath {\n    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n        fmt::Display::fmt(&self.0, f)\n    }\n}\n","sourceCodeStart":282,"sourceCodeEnd":318,"githubUrl":"https://github.com/rust-lang/rust-analyzer/blob/e8f7e90aa3e7b26aa9a000200f606c1078da99ec/crates/paths/src/lib.rs#L282-L318","documentation":"AbsPath::display() in the paths crate is a deliberate trap: it always panics with 'not implemented' and never returns. It exists only so that code accidentally calling the old Path::display()-style API fails loudly at runtime, pushing users toward the Display trait implementation instead. The function is also marked #[deprecated] to catch uses at compile time.","triggerScenarios":"Calling abs_path.display() on an AbsPath/AbsPathBuf value in any code linked against this crate; compiling with the deprecation warning ignored (deny nothing) and running the code path that calls it.","commonSituations":"Migrating code from std::path::PathBuf to AbsPathBuf and mechanically keeping .display() calls; following older rust-analyzer example code that predates the Display-based API.","solutions":["Replace .display() with the Display trait, e.g. format!(\"{}\", path) or write!(out, \"{}\", path)","Use path.as_str() when a &str is needed","Fix the deprecation warning so the call is removed before shipping"],"exampleFix":"// before\nprintln!(\"{}\", abs_path.display());\n// after\nprintln!(\"{}\", abs_path); // or abs_path.as_str()","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// This panics and cannot be caught; fix at the source.\n// Avoid: path.display()\n// Use instead:\nlet s: &str = path.as_str();\nlet rendered: String = path.to_string(); // via Display","preventionTips":["Deny deprecation warnings (#![deny(deprecated)]) so calls fail at compile time","Use Display formatting (format!/println!) for AbsPath values","Use as_str() when a &str is needed","Never port std::path::Path method calls mechanically onto AbsPath"],"tags":["rust","panic","deprecated-api","paths"],"backgroundTag":"not-implemented-panic","analyzedSha":"e8f7e90aa3e7b26aa9a000200f606c1078da99ec","analyzedAt":"2026-09-03T21:08:06.959Z","contentChangedAt":"2026-09-03T21:08:06.959Z","schemaVersion":2},"datasetVersion":"2026-09-11T07:07:21.782Z"}