Skip to content
Myr

Merge pull request #298 from dtolnay/constblock

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Support const block syntax in ensure! macro

authored by David Tolnay · committed by GitHub · parents 80d4c8d, b249287 · Browse files · 1 file+5 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−0 removed

  • other:+5 added−0 removed

1 file+5 added−0 removed

modified:src/ensure.rs+5 added
229 unmodified lines
230 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($unsafe:tt $block:tt $($dup:tt)*) unsafe {$($body:tt)*} $($rest:tt)*) => {231 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $unsafe $block) $($parse)*} ($($rest)*) $($rest)*)232 };233234 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($const:tt $block:tt $($dup:tt)*) const {$($body:tt)*} $($rest:tt)*) => {235 // TODO: this is mostly useless due to https://github.com/rust-lang/rust/issues/86730236 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $const $block) $($parse)*} ($($rest)*) $($rest)*)237 };238239 (0 $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} $dup:tt $lit:literal $($rest:tt)*) => {240 $crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $lit) $($parse)*} ($($rest)*) $($rest)*)241 };242
597 unmodified lines