Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Unknown feature names are not reported if there are other errors #58390

Closed

Description

@jminer

I just added an impl that I thought should be valid now with rust-lang/rfcs#2451, but I got a compiler error. So I found the RFC and copied the feature name re_rebalancing_coherence from it. However, I still got the compile error, so I spent a while trying to figure out if the impl was really valid. Eventually, I tried commenting out the impl, and then (thanks to #52644), the compiler told me the feature was unknown (it has been renamed to re_rebalance_coherence). The impl was valid using the correct feature name. I didn't get the error saying the feature name was invalid because of the error caused by the feature name being invalid.

I think the compiler should report unknown feature names even if there are other errors. For example: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=e46fde7bf4076220df3005d702df9cbb doesn't report the feature name is invalid. With box syntax, it suggests "help: add #![feature(box_syntax)] to the crate attributes to enable" but the coherence error didn't.

Feel free to close this issue if you don't think it is worth fixing.

Activity

  1. added
    A-diagnostics
    on Feb 12, 2019
  2. euclio commented on Feb 14, 2019

    @euclio
    Contributor

    I'd like to work on this.

  3. euclio commented on Feb 14, 2019

    @euclio
    Contributor

    The challenge here is that the current logic for reporting unknown features doesn't get run until stability checking. So, if there's an error before then, then the check doesn't run. While it's possible for us to get language features up-front for error reporting, library features are collected much later. So, before we can report unknown feature names earlier, we have to figure out how to collect the library names earlier.

  4. added
    C-enhancement
    T-compiler
    on Jun 11, 2020
  5. estebank commented on Sep 28, 2025

    @estebank
    Contributor

    Current output:

    error: `box_syntax` has been removed
     --> src/main.rs:5:13
      |
    5 |     let x = box 5;
      |             ^^^^^
      |
    help: use `Box::new()` instead
      |
    5 -     let x = box 5;
    5 +     let x = Box::new(5);
      |
    
    error[E0635]: unknown feature `box_syntax2`
     --> src/main.rs:2:12
      |
    2 | #![feature(box_syntax2)]
      |            ^^^^^^^^^^^
    

    Tried other cases to check that the error is still being emitted even if there are other errors.

  6. added
    E-needs-test
    and removed
    C-enhancement
    on Sep 28, 2025
  7. zakrad commented on Aug 7, 2026

    @zakrad
    Contributor

    @rustbot claim

  8. added a commit that references this issue on Aug 7, 2026
    b4fc9b7
  9. added a commit that references this issue on Aug 7, 2026
    da74d6b
  10. added a commit that references this issue on Aug 8, 2026
    3f3be51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-diagnosticsE-needs-testT-compiler

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions