leptos-rs / leptos

Build fast web applications with Rust.
https://leptos.dev
MIT License
15.31k stars 599 forks source link

leptos_macro 0.6.11 leptos::view! breaks with some comments #2549

Closed g2p closed 2 months ago

g2p commented 2 months ago

Describe the bug

I have uploaded a reproducer at https://github.com/g2p/leptos-comments-bug. Cargo.lock uses leptos 0.6.10 and cargo check works.

The view! macro is called in src/app.rs with:

    <Router>
        <div>
        <!-- "Test comment" -->
        </div>
    …

Aside from the comment change and the dependencies locked at 0.6.10 the project is just cargo generate --git https://github.com/leptos-rs/start-axum.

After running cargo update --precise 0.6.11 -p leptos_macro (or just cargo update, which will update more leptos dependencies), cargo check breaks with the error:

error[E0061]: this method takes 1 argument but 0 arguments were supplied
    --> src/app.rs:10:5
     |
10   | /     view! {
11   | |         // injects a stylesheet into the document <head>
12   | |         // id=leptos means cargo-leptos will hot-reload this stylesheet
13   | |         <Stylesheet id="leptos" href="/pkg/comments-bug.css"/>
...    |
29   | |         </Router>
30   | |     }
     | |_____^ an argument is missing
     |
note: method defined here
    --> ~/.cargo/registry/src/github.com-1ecc6299db9ec823/leptos_dom-0.6.10/src/html.rs:1069:12
     |
1069 |     pub fn child(self, child: impl IntoView) -> Self {
     |            ^^^^^
     = note: this error originates in the macro `view` (in Nightly builds, run with -Z macro-backtrace for more info)
help: provide the argument
     |
30   |     }(/* child */)
     |      +++++++++++++

For more information about this error, try `rustc --explain E0061`.
error: could not compile `comments-bug` (lib) due to 1 previous error

Leptos Dependencies

leptos = "0.6"
leptos_axum = { version = "0.6", optional = true }
leptos_meta = "0.6"
leptos_router = "0.6"

See reproducer, the breakage occurs with leptos_macro 0.6.11

To Reproduce See above