File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -192,8 +192,11 @@ impl Translate for BufferEmitter {
192192impl Emitter for BufferEmitter {
193193 fn emit_diagnostic ( & mut self , diag : & Diagnostic ) {
194194 let mut buffer = self . buffer . borrow_mut ( ) ;
195- // FIXME(davidtwco): need to support translation here eventually
196- buffer. messages . push ( format ! ( "error from rustc: {}" , diag. message[ 0 ] . 0 . expect_str( ) ) ) ;
195+
196+ let fluent_args = self . to_fluent_args ( diag. args ( ) ) ;
197+ let translated_main_message = self . translate_message ( & diag. message [ 0 ] . 0 , & fluent_args) ;
198+
199+ buffer. messages . push ( format ! ( "error from rustc: {}" , translated_main_message) ) ;
197200 if diag. is_error ( ) {
198201 buffer. has_errors = true ;
199202 }
Original file line number Diff line number Diff line change @@ -99,3 +99,9 @@ pub fn indent_after_fenced() {}
9999/// ```
100100pub fn invalid ( ) { }
101101//~^^^^ WARNING could not parse code block as Rust code
102+
103+ /// ```
104+ /// fn wook_at_my_beautifuw_bwaces_plz() {);
105+ /// ```
106+ pub fn uwu ( ) { }
107+ //~^^^^ WARNING could not parse code block as Rust code
Original file line number Diff line number Diff line change @@ -150,5 +150,20 @@ help: mark blocks that do not contain Rust code as text
150150LL | /// ```text
151151 | ++++
152152
153- warning: 12 warnings emitted
153+ warning: could not parse code block as Rust code
154+ --> $DIR/invalid-syntax.rs:103:5
155+ |
156+ LL | /// ```
157+ | _____^
158+ LL | | /// fn wook_at_my_beautifuw_bwaces_plz() {);
159+ LL | | /// ```
160+ | |_______^
161+ |
162+ = note: error from rustc: mismatched closing delimiter: `)`
163+ help: mark blocks that do not contain Rust code as text
164+ |
165+ LL | /// ```text
166+ | ++++
167+
168+ warning: 13 warnings emitted
154169
You can’t perform that action at this time.
0 commit comments