Skip to content

[BUG] doc! macro not exported (needed for define_color!. #413

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

Closed
hpux735 opened this issue Sep 8, 2022 · 1 comment
Closed

[BUG] doc! macro not exported (needed for define_color!. #413

hpux735 opened this issue Sep 8, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@hpux735
Copy link

hpux735 commented Sep 8, 2022

Describe the bug
I was working on some custom palettes, and I looked how they were made in the upstream code. It seems like define_color! is the way to do it. I tried using it myself, but the compiler complained that it couldn't access the doc! macro.

To Reproduce
Try to make a color yourself:

use plotters::define_color;

define_color!(MOODY_BLUE, 0, 63, 92, "*Moody Blue*");

fn main() { }

the compiler will complain:

error[E0432]: unresolved import `plotters::doc`
 --> src/bin/plotters.rs:7:30
  |
7 | use plotters::{define_color, doc};
  |                              ^^^ no `doc` in the root

error: cannot determine resolution for the macro `doc`
  --> src/bin/plotters.rs:10:1
   |
10 | define_color!(MOODY_BLUE, 255, 255, 255, "*Moody Blue*");
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports
   = note: this error originates in the macro `define_color` (in Nightly builds, run with -Z macro-backtrace for more info)

Version Information
Compiling plotters v0.3.3

The fix is as easy as adding #[macro_export] on line 6

@hpux735 hpux735 added the bug Something isn't working label Sep 8, 2022
@AaronErhardt
Copy link
Member

Closed via #419

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants