Skip to content

Weird use issue #66

@timsueberkrueb

Description

@timsueberkrueb

Hey, I ran into this compiler error which I don't understand. Minimal example:

use logos::Logos;

#[derive(Logos)]
enum Token {
    #[error]
    Error,
    #[end]
    End,
}

mod example {
    use super::Token;

    fn test() {
        let t = Token::End;
    }
}

I get the following compiler error:

error: macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths
  --> src/main.rs:12:9
   |
12 |     use super::Token;
   |         ^^^^^^^^^^^^
   |
   = note: #[deny(macro_expanded_macro_exports_accessed_by_absolute_paths)] on by default
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #52234 <https://github.com/rust-lang/rust/issues/52234>
note: the macro is defined here
  --> src/main.rs:3:10
   |
3  | #[derive(Logos)]
   |          ^^^^^

Interestingly, I cannot reproduce this error with a dummy proc_macro derive I just wrote trying to debug this.
This is on 1.31 stable and I'm using Logos 0.9. Am I missing something? Thanks a lot in advance :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions