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:
parent
fd4d151aed
commit
86f80d3ba8
2 changed files with 3 additions and 3 deletions
|
@ -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) {
|
fn print_comment(&mut self, cmnt: &comments::Comment) {
|
||||||
match cmnt.style {
|
match cmnt.style {
|
||||||
comments::Mixed => {
|
comments::Mixed => {
|
||||||
self.zerobreak();
|
if !self.is_beginning_of_line() {
|
||||||
|
self.zerobreak();
|
||||||
|
}
|
||||||
if let Some((last, lines)) = cmnt.lines.split_last() {
|
if let Some((last, lines)) = cmnt.lines.split_last() {
|
||||||
self.ibox(0);
|
self.ibox(0);
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,6 @@ fn f() {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -81,7 +80,6 @@ fn f() {
|
||||||
Space 6+2: compare A
|
Space 6+2: compare A
|
||||||
Ogham Space Mark 6+2: compare B
|
Ogham Space Mark 6+2: compare B
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue