Skip to content

Conversation

@estebank
Copy link
Contributor

@estebank estebank commented Dec 8, 2025

Fix #149660.

@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 8, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 8, 2025

r? @madsmtm

rustbot has assigned @madsmtm.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Comment on lines 10 to 19
error[E0747]: unresolved item provided when a constant was expected
--> $DIR/const-argument-typo.rs:8:11
|
LL | foo::<CONS>();
| ^^^^
|
help: if this generic argument was intended as a const parameter, surround it with braces
|
LL | foo::<{ CONS }>();
| + +
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This shouldn't be shown. When naively silencing it, an inference error is displayed instead, which is just as bad.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Second commit addresses this.

@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Dec 8, 2025

Some changes occurred in need_type_info.rs

cc @lcnr

HIR ty lowering was modified

cc @fmease

@rust-log-analyzer

This comment has been minimized.

@estebank estebank changed the title On name resolution error in parameter list, suggest possible const typo On name resolution error in parameter list, suggest possible const typo and avoid unnecessary second error Dec 12, 2025
Copy link
Contributor

@madsmtm madsmtm left a comment

Choose a reason for hiding this comment

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

I'm unfamiliar with how delayed errors and PathSource works, so I'm probably not the right reviewer for determining if this is the correct solution.

The test changes look correct though, so feel free to either reassign, or just r=me if you don't think this is controversial.

View changes since this review

Comment on lines +1038 to +1043
if self.diag_metadata.currently_processing_generic_args
&& matches!(source, PathSource::Type)
{
source = PathSource::TypeParam;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

It's not clear to me why we're overriding this only here, and not at a "higher" level (such as in smart_resolve_report_errors)?

@madsmtm madsmtm 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 Dec 13, 2025
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.

Resolve error in const params doesn't do fuzzy search for consts

4 participants