pprust: adjust mixed comment printing

This commit adjusts the pretty printing of mixed comments so that the
initial zero-break isn't emitted at the beginning of the line. Through
this, the `block-comment-wchar` test can have the `pp-exact` file
removed, as it no longer converges from pretty printing of the source.

Signed-off-by: David Wood <david@davidtw.co>
This commit is contained in:
David Wood 2020-08-02 15:27:03 +01:00
parent fd4d151aed
commit 86f80d3ba8
No known key found for this signature in database
GPG Key ID: 2592E76C87381FD9
2 changed files with 3 additions and 3 deletions

View File

@ -450,7 +450,9 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
fn print_comment(&mut self, cmnt: &comments::Comment) {
match cmnt.style {
comments::Mixed => {
self.zerobreak();
if !self.is_beginning_of_line() {
self.zerobreak();
}
if let Some((last, lines)) = cmnt.lines.split_last() {
self.ibox(0);

View File

@ -73,7 +73,6 @@ fn f() {
*/
/* */
/*
@ -81,7 +80,6 @@ fn f() {
Space 6+2: compare A
Ogham Space Mark 6+2: compare B
*/
/**/
/*