Skip to content

Macro expansion moves comments around. #75332

Open
@steffahn

Description

@steffahn
pub fn bar() {
    println!("Hello, World!");
}


// hello...

pub fn foo() {
    /*
    some
    comment
    */
}

// ...world!

(Playground)

Macro Expansion:

#![feature(prelude_import)]
#[prelude_import]
use std::prelude::v1::*;
#[macro_use]
extern crate std;
pub fn bar() {


    // hello...

    /*
    some
    comment
    */

    // ...world!
    {
        ::std::io::_print(::core::fmt::Arguments::new_v1(&["Hello, World!\n"],
                                                         &match () {
                                                              () => [],
                                                          }));
    };
}
pub fn foo() { }

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-prettyArea: Pretty printing (including `-Z unpretty`)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions