File tree 2 files changed +20
-1
lines changed
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;
5
5
use std:: path:: Path ;
6
6
use std:: process:: Command ;
7
7
8
- use rustfmt_config_proc_macro:: rustfmt_only_ci_test;
8
+ use rustfmt_config_proc_macro:: { nightly_only_test , rustfmt_only_ci_test} ;
9
9
10
10
/// Run the rustfmt executable and return its output.
11
11
fn rustfmt ( args : & [ & str ] ) -> ( String , String ) {
@@ -207,3 +207,15 @@ fn rustfmt_emits_error_when_control_brace_style_is_always_next_line() {
207
207
let ( _stdout, stderr) = rustfmt ( & args) ;
208
208
assert ! ( !stderr. contains( "error[internal]: left behind trailing whitespace" ) )
209
209
}
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