about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbhould287 <bhould287@gmail.com>2023-04-01 21:29:05 +0100
committerbhould287 <bhould287@gmail.com>2023-04-03 16:16:48 +0100
commit3b22352d0d16034e112e58b032f1bf0fc1c818ba (patch)
tree0f2d2f0be9449990d1a3fcedcfc53223146d1c5c
parent9e53b6544f77de0f4bfb64413014c9ebd832d133 (diff)
downloadrust-3b22352d0d16034e112e58b032f1bf0fc1c818ba.tar.gz
rust-3b22352d0d16034e112e58b032f1bf0fc1c818ba.zip
Fix bug with getting parent directories in `lookup_conf_file`
-rw-r--r--clippy_lints/src/utils/conf.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/clippy_lints/src/utils/conf.rs b/clippy_lints/src/utils/conf.rs
index 25626897b51..896a01af37d 100644
--- a/clippy_lints/src/utils/conf.rs
+++ b/clippy_lints/src/utils/conf.rs
@@ -478,7 +478,8 @@ pub fn lookup_conf_file() -> io::Result<(Option<PathBuf>, Vec<String>)> {
     // If neither of those exist, use ".".
     let mut current = env::var_os("CLIPPY_CONF_DIR")
         .or_else(|| env::var_os("CARGO_MANIFEST_DIR"))
-        .map_or_else(|| PathBuf::from("."), PathBuf::from);
+        .map_or_else(|| PathBuf::from("."), PathBuf::from)
+        .canonicalize()?;
 
     let mut found_config: Option<PathBuf> = None;
     let mut warnings = vec![];