-
Notifications
You must be signed in to change notification settings - Fork 153
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
Compiler sometimes crashes with stack overflow when html! is used inside Render impl #183
Comments
This seems to be because the html macro inserts In my case I am solving it by putting the problem impl inside its own submodule. In the simplified example, this becomes: use maud::{html, Markup, DOCTYPE};
mod theme {
use maud::{html, Markup, Render};
pub struct Theme;
impl Render for Theme {
fn render(&self) -> Markup {
html! {}
}
}
}
pub use theme::Theme;
pub struct Note;
impl Note {
pub fn render_html(&self) -> Markup {
html! {
(DOCTYPE)
}
}
} |
I ran into the same issue, but the suggested workaround at rust-lang/rust#55779 (comment) (adding |
Was wrestling with this for an hour and thought I was crazy. |
Looks like this was fixed upstream. It still reproduces on stable 1.56.0, but works fine on the latest nightly.
I'll go ahead and close this issue, but leave it pinned for visibility. |
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
The text was updated successfully, but these errors were encountered: