Skip to content

add AnonConstKind to non_trivial_const_arg diagnostics #144324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dvtkrlbs
Copy link
Contributor

@dvtkrlbs dvtkrlbs commented Jul 22, 2025

#142387

r? @compiler-errors

one thing I am not sure about is if AnonConstKind is always available (if not not sure how to make it optional since IntoDiagArg is not implemented for Option). Especially in one of the late diagnostics there is no context to add AnonConstKind to an error (some diagnostics about lifetimes).

@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 Jul 22, 2025
@dvtkrlbs dvtkrlbs marked this pull request as draft July 22, 2025 19:59
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 22, 2025
item: Option<(Ident, ConstantItemKind)>,
f: impl FnOnce(&mut Self),
) {
let f = |this: &mut Self| {
this.with_rib(ValueNS, RibKind::ConstantItem(may_use_generics, item), |this| {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Really not sure bout this one since it is nested ConstantItems

@@ -3337,6 +3337,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
.sess
.is_nightly_build()
.then_some(errors::ParamInNonTrivialAnonConstHelp),
place: AnonConstKind::InlineConst,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no context here so I am just defaulting to InlineConst. I need to fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

3 participants