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

Fix build error "field, not a method" for line and column #47

Closed
wants to merge 1 commit into from

Conversation

ClementWalter
Copy link
Contributor

Fix build

Current behavior

Not sure how the CI could pass otherwise, just pulling the repo and running cargo build raises this error

$ cargo build --locked
   Compiling genco-macros v0.17.6 (/Users/clementwalter/Documents/genco/genco-macros)
error[E0599]: no method named `line` found for struct `proc_macro::LineColumn` in the current scope
  --> genco-macros/src/fake.rs:26:24
   |
26 |             line: span.line(),
   |                        ^^^^-- help: remove the arguments
   |                        |
   |                        field, not a method

error[E0599]: no method named `column` found for struct `proc_macro::LineColumn` in the current scope
  --> genco-macros/src/fake.rs:27:26
   |
27 |             column: span.column(),
   |                          ^^^^^^-- help: remove the arguments
   |                          |
   |                          field, not a method

error[E0599]: no method named `line` found for struct `proc_macro::LineColumn` in the current scope
  --> genco-macros/src/fake.rs:36:24
   |
36 |             line: span.line(),
   |                        ^^^^-- help: remove the arguments
   |                        |
   |                        field, not a method

error[E0599]: no method named `column` found for struct `proc_macro::LineColumn` in the current scope
  --> genco-macros/src/fake.rs:37:26
   |
37 |             column: span.column(),
   |                          ^^^^^^-- help: remove the arguments
   |                          |
   |                          field, not a method

For more information about this error, try `rustc --explain E0599`.
error: could not compile `genco-macros` (lib) due to 4 previous errors

I have actually face this when compiling a repo depending on genco.

@udoprog
Copy link
Owner

udoprog commented Sep 28, 2023

You seem to be using an older nightly.

Since I want to support the most recent version this would have to rely on version detection instead for me to merge.

See build.rs, you could possible extend it to support older nightly versions (with a different cfg). But primarily I'd suggest you try and update nightly.

@udoprog
Copy link
Owner

udoprog commented Jan 28, 2024

This should be fixed.

@udoprog udoprog closed this Jan 28, 2024
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

Successfully merging this pull request may close these issues.

2 participants