use std::fmt::Debug;

// `--features trace` code names the return type, so doesn't work with `impl Trait`
#[cfg(not(feature = "trace"))]
peg::parser!{
    grammar g() for str {
        pub rule returns_impl_trait() -> impl Debug
            = "" { Box::new(5) }
    }
}

fn main() {
    #[cfg(not(feature = "trace"))]
    assert_eq!(format!("{:?}", g::returns_impl_trait("")), "Ok(5)");
}

use std::fmt::Debug;

peg::parser!{
    grammar g() for str {
        pub rule returns_impl_trait() -> impl Debug
            = "" { Box::new(5) }
    }
}

fn main() {
    assert_eq!(format!("{:?}", g::returns_impl_trait("")), "Ok(5)");
}

--- 
+++ 
@@ -1,5 +1,7 @@
 use std::fmt::Debug;
 
+// `--features trace` code names the return type, so doesn't work with `impl Trait`
+#[cfg(not(feature = "trace"))]
 peg::parser!{
     grammar g() for str {
         pub rule returns_impl_trait() -> impl Debug
@@ -8,5 +10,6 @@
 }
 
 fn main() {
+    #[cfg(not(feature = "trace"))]
     assert_eq!(format!("{:?}", g::returns_impl_trait("")), "Ok(5)");
 }
Disable `impl Trait` test with --features trace

That didn't work due to naming the type in `__peg_result` previously,
and I don't see a good way to avoid that without breaking other things.
