Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<FormatReport, ErrorKind> {
self.format_input_inner(input, false)
}
Expand Down
9 changes: 4 additions & 5 deletions src/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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);
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions tests/parser/issue-4126/lib.rs
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
// rustfmt-show_parse_errors: false

mod invalid;
4 changes: 3 additions & 1 deletion tests/parser/issue_4418.rs
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
}
// rustfmt-show_parse_errors: false

}
2 changes: 2 additions & 0 deletions tests/parser/stashed-diag.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// rustfmt-show_parse_errors: false

#![u={static N;}]

fn main() {}
2 changes: 2 additions & 0 deletions tests/parser/stashed-diag2.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// rustfmt-show_parse_errors: false

trait Trait<'1> { s> {}

fn main() {}
4 changes: 3 additions & 1 deletion tests/parser/unclosed-delims/issue_4466.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// rustfmt-show_parse_errors: false

fn main() {
if true {
println!("answer: {}", a_func();
Expand All @@ -8,4 +10,4 @@ fn main() {

fn a_func() -> i32 {
42
}
}
Loading