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

unreachable is ambiguous (glob import vs any other name from outer scope during import/macro resolution) #638

Closed
Dirbaio opened this issue Nov 26, 2021 · 0 comments

Comments

@Dirbaio
Copy link
Contributor

Dirbaio commented Nov 26, 2021

If you use defmt::* then try to use the defmt::Format derive, you get this error:

error[E0659]: `unreachable` is ambiguous (glob import vs any other name from outer scope during import/macro resolution)
  --> /home/dirbaio/akiles/firmware/ak-common/src/copylist.rs:18:30
   |
18 | #[derive(Copy, Clone, Debug, defmt::Format)]
   |                              ^^^^^^^^^^^^^ ambiguous name
   |
   = note: `unreachable` could refer to a macro from prelude
note: `unreachable` could also refer to the macro imported here
  --> /home/dirbaio/akiles/firmware/ak-common/src/copylist.rs:4:5
   |
4  | use defmt::*;
   |     ^^^^^^^^
   = help: consider adding an explicit import of `unreachable` to disambiguate
   = help: or use `self::unreachable` to refer to this macro unambiguously
   = note: this error originates in the derive macro `defmt::Format` (in Nightly bui`lds, run with -Z macro-backtrace for more info)

The fix would probably be specifiying ::core::unreachable!() in the macro output?

bors bot added a commit that referenced this issue Nov 26, 2021
639: Use fully qualified `defmt::unreachable!()` in macros. Fixes #638. r=jonathanpallant a=Dirbaio



Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
@bors bors bot closed this as completed in ebcc6da Nov 26, 2021
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