From c47f40c890ac80fa4e13a29b5566606182cb5e5d Mon Sep 17 00:00:00 2001 From: YetAnotherMinion <yam@thinkalexandria.com> Date: Thu, 19 Jul 2018 10:36:12 -0400 Subject: [PATCH] fix: update benchmarks to build with 0.18.x, document required compiler feature flags change --- CHANGELOG.md | 4 ++++ benchmarks/benches/complicated_maud.rs | 8 ++++---- benchmarks/benches/maud.rs | 7 ++++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 038660b..3303765 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ ## [0.18.1] - 2018-07-18 - [Fixed] Update to rustc 1.29.0-nightly (1ecf6929d 2018-07-16) +- `proc_macro` has been stabilized on 1.29.0-nightly + (https://github.com/rust-lang/rust/pull/52081#issue-199544227) which changes + the features required to use maud. Replace `#![feature(proc_macro)]` in your + crate that uses maud and use `#![feature(use_extern_macros)]` instead. ## [0.18.0] - 2018-07-15 diff --git a/benchmarks/benches/complicated_maud.rs b/benchmarks/benches/complicated_maud.rs index 8d69253..b1c848c 100644 --- a/benchmarks/benches/complicated_maud.rs +++ b/benchmarks/benches/complicated_maud.rs @@ -1,4 +1,4 @@ -#![feature(proc_macro, test)] +#![feature(test, use_extern_macros, proc_macro_non_items)] extern crate maud; extern crate test; @@ -46,7 +46,7 @@ mod btn { fn render(&self) -> Markup { match self.req_meth { RequestMethod::Get => { - html! { a.btn href=(self.path) (self.label) } + html! { a.btn href=(self.path) { (self.label) } } } RequestMethod::Post => { html! { @@ -64,7 +64,7 @@ fn layout<S: AsRef<str>>(title: S, inner: Markup) -> Markup { html! { html { head { - title (title.as_ref()) + title { (title.as_ref()) } } body { (inner) @@ -89,7 +89,7 @@ fn render_complicated_template(b: &mut test::Bencher) { @for entry in &teams { div { - strong (entry.name) + strong { (entry.name) } (Button::new("Edit", "edit")) (Button::new("Delete", "edit") .with_method(RequestMethod::Post)) diff --git a/benchmarks/benches/maud.rs b/benchmarks/benches/maud.rs index a9e17ad..ac946c4 100644 --- a/benchmarks/benches/maud.rs +++ b/benchmarks/benches/maud.rs @@ -1,5 +1,6 @@ #![feature(plugin, test)] -#![feature(proc_macro)] +#![feature(use_extern_macros, proc_macro_non_items)] + extern crate maud; @@ -26,14 +27,14 @@ fn render_template(b: &mut test::Bencher) { html! { html { head { - title (year) + title { (year) } } body { h1 { "CSL " (year) } ul { @for (i, team) in teams.iter().enumerate() { li.champion[i == 0] { - b (team.name) ": " (team.score) + b { (team.name) ": " (team.score) } } } }