From 369f5dea1307b36c6bfcb59f421e7f8eb995a937 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sat, 18 May 2024 12:59:43 -0700 Subject: [PATCH] Silence warnings running embedded unittests. --- src/cargo/util/toml/embedded.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cargo/util/toml/embedded.rs b/src/cargo/util/toml/embedded.rs index 14c57db4576..ed7a2849f7e 100644 --- a/src/cargo/util/toml/embedded.rs +++ b/src/cargo/util/toml/embedded.rs @@ -265,12 +265,12 @@ mod test_expand { macro_rules! si { ($i:expr) => {{ - expand_manifest( - $i, - std::path::Path::new("/home/me/test.rs"), - &GlobalContext::default().unwrap(), - ) - .unwrap_or_else(|err| panic!("{}", err)) + let shell = crate::Shell::from_write(Box::new(Vec::new())); + let cwd = std::env::current_dir().unwrap(); + let home = home::cargo_home_with_cwd(&cwd).unwrap(); + let gctx = GlobalContext::new(shell, cwd, home); + expand_manifest($i, std::path::Path::new("/home/me/test.rs"), &gctx) + .unwrap_or_else(|err| panic!("{}", err)) }}; }