Skip to content

Compiler sometimes crashes with stack overflow when html! is used inside Render impl #183

Closed
@FinnStokes

Description

@FinnStokes

Sometimes, using the html macro inside an impl can cause rustc to crash with a stack overflow. A simplified example that reproduces the crash is

use maud::{html, Markup, Render, DOCTYPE};

pub struct Theme;

impl Render for Theme {
    fn render(&self) -> Markup {
        html! {}
    }
}

pub struct Note;

impl Note {
    pub fn render_html(&self) -> Markup {
        html! {
            (DOCTYPE)
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions