File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use std::fs::remove_file;
55use std:: path:: Path ;
66use std:: process:: Command ;
77
8- use rustfmt_config_proc_macro:: rustfmt_only_ci_test;
8+ use rustfmt_config_proc_macro:: { nightly_only_test , rustfmt_only_ci_test} ;
99
1010/// Run the rustfmt executable and return its output.
1111fn rustfmt ( args : & [ & str ] ) -> ( String , String ) {
@@ -207,3 +207,15 @@ fn rustfmt_emits_error_when_control_brace_style_is_always_next_line() {
207207 let ( _stdout, stderr) = rustfmt ( & args) ;
208208 assert ! ( !stderr. contains( "error[internal]: left behind trailing whitespace" ) )
209209}
210+
211+ #[ nightly_only_test]
212+ #[ test]
213+ fn rustfmt_generates_no_error_if_failed_format_code_in_doc_comments ( ) {
214+ // See also https://github.com/rust-lang/rustfmt/issues/6109
215+
216+ let file = "tests/target/issue-6109.rs" ;
217+ let args = [ "--config" , "format_code_in_doc_comments=true" , file] ;
218+ let ( stdout, stderr) = rustfmt ( & args) ;
219+ assert ! ( stderr. is_empty( ) ) ;
220+ assert ! ( stdout. is_empty( ) ) ;
221+ }
Original file line number Diff line number Diff line change 1+ /// Some doc comment with code snippet:
2+ ///```
3+ /// '\u{1F}
4+ /// ```
5+ pub struct Code { }
6+
7+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments