Skip to content

injected code results in errors that emacs hates #3530

Closed

Description

@brson

For example:

<core-macros>:3:10: 3:61 note: in expansion of #error

Emacs wants to load <core-macros> and interrupts your workflow to prompt for it. Injected code should come from files on disk (like intrinsic.rs) and we should use the correct file path when inserting them into the AST, so that the error messages work.

Alternately, we can come up with another way to indicate injected code so that the diagnostic emitter can generate error messages that emacs doesn't complain about. This could be a better solution, since getting dumped into core_macros.rs may not be so useful.

Activity

  1. graydon commented on Sep 19, 2012

    @graydon
    Contributor

    intrinsic.rs is moving to core now that we have #[lang] items; core-macros will also go away when we figure out a mechanism for pulling in syntax extensions and/or macro definitions in other crates.

    In general I think "pointing to source files on disk" isn't going to work so well, since it implies the end-user has a source-file. I'd prefer not to be shipping .rs files as part of the end-user distribution / make install file set.

  2. catamorphism commented on Dec 28, 2012

    @catamorphism
    Contributor

    Bumping to 0.7; this seems like low priority compared to the million and one traits bugs.

  3. catamorphism commented on Apr 25, 2013

    @catamorphism
    Contributor

    Not critical for 0.7. Nominating for milestone 5, production-ready.

  4. graydon commented on May 9, 2013

    @graydon
    Contributor

    should say something that does not make emacs mad, but there is no file to point to.

  5. graydon commented on May 9, 2013

    @graydon
    Contributor

    accepted for production-ready milestone

  6. emberian commented on Jul 7, 2013

    @emberian
    Contributor

    still relevant

  7. bblum commented on Aug 19, 2013

    @bblum
    Contributor

    these macro errors produce a "note: expansion site" message, right? perhaps the emacs plugin could be configured to recognise a string such as "" and look for the expansion site message below.

  8. pnkfelix commented on Aug 27, 2013

    @pnkfelix
    Contributor

    part of #8793

  9. pnkfelix commented on Jan 22, 2014

    @pnkfelix
    Contributor

    assigning P-low.

  10. steveklabnik commented on Jan 21, 2015

    @steveklabnik
    Contributor

    Triage: I don't use emacs, but these errors are the same, so I'm guessing this is still the same.

  11. steveklabnik commented on Feb 2, 2015

    @steveklabnik
    Contributor
  12. added a commit that references this issue on Dec 15, 2018
    f3a0c60
  13. added a commit that references this issue on Dec 17, 2018
    640c7ff
  14. added a commit that references this issue on May 15, 2021
  15. added a commit that references this issue on May 4, 2024
    b0bdbcc
  16. added a commit that references this issue on Aug 21, 2026
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 lintsP-lowLow priority

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions