Skip to content

missing edition note is silenced by any flag #164116

Open

Description

@matthiaskrgr

rust-lang/compiler-team#1019 states

Implementation-wise, the changes are minimal if we go with a plain unsilenceable note: #158102

The warning seems to be silenced however, as soon as we pass any commandline arg, such --crate-type lib or -g for example.
Is this the intended behaviour?

cc #160243

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 10, 2026
  2. hanna-kruppe commented on Oct 10, 2026

    @hanna-kruppe
    Contributor

    This is apparently intentional: #158102 (comment)

    But I agree that the warning is significantly less useful if it only fires in this narrow case.

    cc @estebank

  3. estebank commented on Oct 10, 2026

    @estebank
    Contributor

    The people that need the alert are the ones that are not using any flags, the benefit gets incrementally less the more "competent" the user is.

    We can tweak the logic to trigger more, but trigerring less seemed like the safest thing to stabilize.

  4. hanna-kruppe commented on Oct 10, 2026

    @hanna-kruppe
    Contributor

    FWIW I've been in favor of the MCP because I also often invoke rustc myself and forget about the edition defaulting to 2015, and I usually remember that I have to add other flags for whatever I'm trying to do.

  5. matthiaskrgr commented on Oct 10, 2026

    @matthiaskrgr
    MemberAuthor

    I get the idea and it seems sensible imo.
    The "always print a message when no args are passed" approach broke parts of my fuzzing machinery which previously did not pass "--edition=2015" explicitly and would assume "if rustc exits with no output AND bad exit code, we have some kind of bug". But that was quickly fixed by adding the 2015 edition explicitly

    This was probably discussed already but I feel like it would be a bit smoother and consistent if this was an on-by-default lint like implicit_edition_fallback which could be turned off via the old and reliable. Then the "styling" of the message would also fit in with all the other warnings that we have. My first initial reaction when I saw the message was "huh did someone forget to remove a debug print?" 😅 🙈

    But if you say "I don't wanna invest an hour turning this very niche thing into a lint" I also understand that.

  6. estebank commented on Oct 10, 2026

    @estebank
    Contributor

    @matthiaskrgr my concern was more about not implying that it is a mistake to use 2015, but at the same time we're trying to eliminate bare notes, so eprintln seemed like the reasonable solution.

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

    C-bugCategory: This is a bug.needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions