Skip to content

Conversation

@scrabsha
Copy link
Contributor

@scrabsha scrabsha commented Dec 4, 2025

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 4, 2025
@rust-log-analyzer

This comment has been minimized.

Comment on lines +1114 to +1122
tcx.dcx().emit_err(errors::MisspelledFeature {
span,
misspelled_name,
actual_name,
suggestion: span,
});
}
None => {
tcx.dcx().emit_err(errors::UnknownFeature { span, feature });
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am not happy of having two error types representing roughly the same error. using only UnknownFeature here means we need to be able to refer to Some<Ident> when creating the suggestion, which is (as far as i can tell) not a thing. i would love to be able to do the following:

#[derive(Diagnostic)]
#[diag(passes_unknown_feature, code = E0635)]
pub(crate) struct UnknownFeature {
    #[primary_span]
    pub span: Span,
    pub feature: Symbol,
    #[suggestion(
        style = "verbose",
        code = "{actual_name}",
        applicability = "maybe-incorrect"
    )]
    pub actual_name: Option<(Span, Symbol)>,
}

i'll try to see how feasible it is to add support for this ^ (or some variation of it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants