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

E0045 needs to be updated to new format #35501

Closed
sophiajt opened this issue Aug 8, 2016 · 3 comments
Closed

E0045 needs to be updated to new format #35501

sophiajt opened this issue Aug 8, 2016 · 3 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Comments

@sophiajt
Copy link
Contributor

sophiajt commented Aug 8, 2016

From: src/test/compile-fail/E0045.rs

Error E0045 needs a span_label, updating it from:

error[E0045]: variadic function must have C calling convention
  --> src/test/compile-fail/E0045.rs:11:17
   |
11 | extern "Rust" { fn foo(x: u8, ...); } //~ ERROR E0045
   |                 ^^^^^^^^^^^^^^^^^^^

To:

error[E0045]: variadic function must have C calling convention
  --> src/test/compile-fail/E0045.rs:11:17
   |
11 | extern "Rust" { fn foo(x: u8, ...); } //~ ERROR E0045
   |                 ^^^^^^^^^^^^^^^^^^^ variadics require C calling conventions

Bonus: Underline only the variadic part of the call.

error[E0045]: variadic function must have C calling convention
  --> src/test/compile-fail/E0045.rs:11:17
   |
11 | extern "Rust" { fn foo(x: u8, ...); } //~ ERROR E0045
   |                               ^^^ variadics require C calling conventions
@sophiajt sophiajt added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. A-diagnostics Area: Messages for errors, warnings, and lints E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Aug 8, 2016
@mikhail-m1
Copy link
Contributor

mikhail-m1 commented Aug 9, 2016

I'd like to discus bonus part fix,

I've find out than function (FnDecl) with ellipsis doesn't contain span information about ellipsis.
I see three variants to solve it but each has some minus:

  • evaluate span position from FnDecl items, start take from last argument, end from result or decl span. minus - not exact match, may be some bugs in multiline cases.
  • add ellipsis span information in to FnDecl. Minus - too big change for the issue
  • add ellipsis as fn arg, need to fix another parts of compiler

May be you could provide better solution or help me choose one.

@sophiajt
Copy link
Contributor Author

sophiajt commented Aug 9, 2016

After playing with it, I think you're right. This seems like it would take updating how FnDecl handles variadic fns in a more robust way. This doesn't seem worth it, since this isn't really a fully supported feature (I think it's only for C interop?)

Fun to poke around and see what was available, though.

@sophiajt
Copy link
Contributor Author

sophiajt commented Aug 9, 2016

Yeah, let's mark this bonus as "not worth it, for now". We might come back to it later if more span information gets put in.

mikhail-m1 added a commit to mikhail-m1/rust that referenced this issue Aug 10, 2016
steveklabnik added a commit to steveklabnik/rust that referenced this issue Aug 10, 2016
…athandturner

Updated E0045 to new error format (no bonus)

Part of rust-lang#35501
r? @jonathandturner
sophiajt pushed a commit to sophiajt/rust that referenced this issue Aug 10, 2016
…athandturner

Updated E0045 to new error format (no bonus)

Part of rust-lang#35501
r? @jonathandturner
sophiajt pushed a commit to sophiajt/rust that referenced this issue Aug 11, 2016
…athandturner

Updated E0045 to new error format (no bonus)

Part of rust-lang#35501
r? @jonathandturner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants