custom_error icon indicating copy to clipboard operation
custom_error copied to clipboard

Macro importing core causes compilation failure

Open duckfromdiscord opened this issue 8 months ago • 1 comments

If you have a module called core and you define it on the same level it does not work

pub mod core;

use ::core::fmt;
use custom_error::custom_error;

custom_error! { pub SomeError
    Something = "hello"
}

This does not compile, it says

failed to resolve: could not find `fmt` in `core`
could not find `fmt` in `core

actual error occuring in lib.rs line 271

duckfromdiscord avatar May 28 '25 23:05 duckfromdiscord

Indeed, our usage of core should be replaced with ::core.

Can you please make a pull request, fixing the issue and adding a test?

lovasoa avatar May 29 '25 12:05 lovasoa