Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate piles of extra semicolons from expanded code #221

Merged
merged 1 commit into from Jun 18, 2022
Merged

Commits on Jun 18, 2022

  1. Eliminate piles of extra semicolons from expanded code

    Look at `cargo rustc --profile=check -- -Zunpretty=expanded` of the
    following program:
    
        use quote::quote;
        fn main() {
            let _ = quote!(1 + 1);
        }
    
    Before:
    
        use quote::quote;
        fn main() {
            let _ =
                {
                    let mut _s = ::quote::__private::TokenStream::new();
                    ;
                    ;
                    ;
                    ::quote::__private::parse(&mut _s, "1");
                    ;
                    ::quote::__private::push_add(&mut _s);
                    ;
                    ::quote::__private::parse(&mut _s, "1");
                    ;
                    ;
                    ;
                    ;
                    _s
                };
        }
    
    After:
    
        use quote::quote;
        fn main() {
            let _ =
                {
                    let mut _s = ::quote::__private::TokenStream::new();
                    ::quote::__private::parse(&mut _s, "1");
                    ::quote::__private::push_add(&mut _s);
                    ::quote::__private::parse(&mut _s, "1");
                    _s
                };
        }
    dtolnay committed Jun 18, 2022
    Copy the full SHA
    541878c View commit details
    Browse the repository at this point in the history