From d0e96ed3310a289354cf7358a19fce02254cba40 Mon Sep 17 00:00:00 2001 From: topecongiro Date: Sun, 17 Mar 2019 12:26:45 +0900 Subject: [PATCH] Do not look for external modules when the input is from stdin --- src/formatting.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/formatting.rs b/src/formatting.rs index 56adfa9b1a3..a23c312bd2a 100644 --- a/src/formatting.rs +++ b/src/formatting.rs @@ -624,6 +624,10 @@ fn parse_crate( syntax::source_map::FileName::Custom("stdin".to_owned()), text, ) + .map(|mut parser| { + parser.recurse_into_file_modules = false; + parser + }) .map_err(|diags| { diags .into_iter()