uselessgoddess

Results 39 comments of uselessgoddess

Cool. But it doesn't work with [`const trait` together `const fn`](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=60101d1f5a9eaaed6774bd0929759edd)

I'm not pro in macros, can you explain what the reason may be

Thanks, but this is too detailed. ~~I asked because the following code also doesn't work.~~ But I can't figure out why doesn't recurse into `{}` blocks ```rust macro_rules! cfg_const_trait_munch {...

> Since the macro only has to munch over the function declaration (since it jumps the body in on token tree), the following version works fine and is easier to...

> Also, the macro doesn't recurse into `{}` blocks (which saves a lot of recursive calls), so it has to be used at the level that `const` shows up; that...

all this time I misunderstood `$($t:tt)*` and `$t:tt`. Thanks :)

@CAD97 Is panic considered an allowed style in `const` functions? For example, `unwrap_borrowed` etc. can be `const`

> 1. To match over `beef::Cow`, `.into() -> std::Cow` needs to be `const`. Or, as noted, `.as_borrowed().unwrap()` works via the unstably const `Option::unwrap` to strip the formatted context from the...

I don't find a way to do something similar to `if consteval` from C++ Maybe now only `TryFrom` can be `const,` but `Result::unwrap` is not const now, users will have...

But it doesn't look like good code