diff --git a/src/lib.rs b/src/lib.rs index 6a5a9c4f742..b59b5ebeb04 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -460,7 +460,7 @@ impl<'b, T: Write + 'b> Session<'b, T> { } /// The main entry point for Rustfmt. Formats the given input according to the - /// given config. `out` is only necessary if required by the configuration. + /// session's config. pub fn format(&mut self, input: Input) -> Result { self.format_input_inner(input, false) } diff --git a/src/test/mod.rs b/src/test/mod.rs index 36e6aa84fc2..8413b73f24e 100644 --- a/src/test/mod.rs +++ b/src/test/mod.rs @@ -19,7 +19,7 @@ use crate::{ }; use rustfmt_config_proc_macro::nightly_only_test; -use tracing::{debug, warn}; +use tracing::debug; mod configuration_snippet; mod mod_resolver; @@ -534,7 +534,9 @@ fn stdin_parser_panic_caught() { // See issue #3239. for text in ["{", "}"].iter().cloned().map(String::from) { let mut buf = vec![]; - let mut session = Session::new(Default::default(), Some(&mut buf)); + let mut config = Config::default(); + config.set().show_parse_errors(false); + let mut session = Session::new(config, Some(&mut buf)); let _ = session.format(Input::Text(text)); assert!(session.has_parsing_errors()); @@ -774,9 +776,6 @@ fn read_config(filename: &Path) -> Config { for (key, val) in &sig_comments { if key != "target" && key != "config" && key != "unstable" { config.override_value(key, val); - if config.is_default(key) { - warn!("Default value {} used explicitly for {}", val, key); - } } } diff --git a/tests/parser/issue-4126/lib.rs b/tests/parser/issue-4126/lib.rs index aac63e3557f..68b904cd316 100644 --- a/tests/parser/issue-4126/lib.rs +++ b/tests/parser/issue-4126/lib.rs @@ -1 +1,3 @@ +// rustfmt-show_parse_errors: false + mod invalid; diff --git a/tests/parser/issue_4418.rs b/tests/parser/issue_4418.rs index ff30235f076..ed148f84e46 100644 --- a/tests/parser/issue_4418.rs +++ b/tests/parser/issue_4418.rs @@ -1 +1,3 @@ -} \ No newline at end of file +// rustfmt-show_parse_errors: false + +} diff --git a/tests/parser/stashed-diag.rs b/tests/parser/stashed-diag.rs index 3b0b543e610..836e25658c3 100644 --- a/tests/parser/stashed-diag.rs +++ b/tests/parser/stashed-diag.rs @@ -1,3 +1,5 @@ +// rustfmt-show_parse_errors: false + #![u={static N;}] fn main() {} diff --git a/tests/parser/stashed-diag2.rs b/tests/parser/stashed-diag2.rs index 579a69def16..1fe6802d35b 100644 --- a/tests/parser/stashed-diag2.rs +++ b/tests/parser/stashed-diag2.rs @@ -1,3 +1,5 @@ +// rustfmt-show_parse_errors: false + trait Trait<'1> { s> {} fn main() {} diff --git a/tests/parser/unclosed-delims/issue_4466.rs b/tests/parser/unclosed-delims/issue_4466.rs index 2c2c81c91d1..452a0c1d3aa 100644 --- a/tests/parser/unclosed-delims/issue_4466.rs +++ b/tests/parser/unclosed-delims/issue_4466.rs @@ -1,3 +1,5 @@ +// rustfmt-show_parse_errors: false + fn main() { if true { println!("answer: {}", a_func(); @@ -8,4 +10,4 @@ fn main() { fn a_func() -> i32 { 42 -} \ No newline at end of file +} diff --git a/tests/source/imports_granularity_one.rs b/tests/source/imports/imports_granularity_one.rs similarity index 100% rename from tests/source/imports_granularity_one.rs rename to tests/source/imports/imports_granularity_one.rs diff --git a/tests/target/imports_granularity_one.rs b/tests/target/imports/imports_granularity_one.rs similarity index 100% rename from tests/target/imports_granularity_one.rs rename to tests/target/imports/imports_granularity_one.rs