Skip to content

E0045 needs to be updated to new format #35501

Description

@sophiajt

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

Activity

  1. added
    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
    A-diagnosticsArea: Messages for errors, warnings, and lints
    E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
    on Aug 8, 2016
  2. mikhail-m1 commented on Aug 9, 2016

    @mikhail-m1
    Contributor

    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.

  3. sophiajt commented on Aug 9, 2016

    @sophiajt
    ContributorAuthor

    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.

  4. sophiajt commented on Aug 9, 2016

    @sophiajt
    ContributorAuthor

    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.

  5. added a commit that references this issue on Aug 10, 2016
    88e318b
  6. added a commit that references this issue on Aug 10, 2016
  7. added 2 commits that reference this issue on Aug 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions