Skip to content

Commit

Permalink
Workaround rust nightly borrowcheck error (rust-lang#1860)
Browse files Browse the repository at this point in the history
Surprisingly, this fixes the error filed at rust-lang#1860!

This seems suspicious, perhaps indicative of a bug in Rust's non-lexical
lifetime handling?

The lifetimes in the `handlebars::Renderable::render` method signature
are quite complicated, and its unclear to me whether or not Rust is
catching some new safety edge-case that wasn't previously handled
correctly...

Possibly related to `drop` order, which I *think* is related to the
order of binding statements?
  • Loading branch information
mitchmindtree authored and rubenmoor committed Aug 5, 2022
1 parent 4c7a260 commit 1107207
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/renderer/html_handlebars/helpers/navigation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ fn render(
_h.template()
.ok_or_else(|| RenderError::new("Error with the handlebars template"))
.and_then(|t| {
let mut local_rc = rc.clone();
let local_ctx = Context::wraps(&context)?;
let mut local_rc = rc.clone();
t.render(r, &local_ctx, &mut local_rc, out)
})?;

Expand Down

0 comments on commit 1107207

Please sign in to comment.