Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macro codegen hangs forever when trying to mix Unicase and normal strings #299

Open
DelSkayn opened this issue Oct 19, 2023 · 0 comments
Open

Comments

@DelSkayn
Copy link

When trying to use the proc macro to build a map, whenever you try to mix strings and unicase strings the macro generates a compile error.

However when a unicase string matches a normal string the macro just runs forever without progressing.

I know what I tried to do is probably not supported but because the macro kept running forever it prevented the code from compiling and it took me quite a while to figure out what was happening. So it would be nice if this was fixed.

Below a minimal reproduction.

use phf::phf_map;
use unicase::UniCase;

pub(crate) static KEYWORDS: phf::Map<UniCase<&'static str>, usize> = phf_map! {
    "foo" => 0,
    UniCase::ascii("FOO") => 0
};

fn main(){
    KEYWORDS.get("foo").unwap();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant