-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
generic_arg_infer impl is prone to bugs in hir visitors #112110
Copy link
Copy link
Closed
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)F-generic_arg_inferUsing `_` as a const argument: #![feature(generic_arg_infer)]`Using `_` as a const argument: #![feature(generic_arg_infer)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)F-generic_arg_inferUsing `_` as a const argument: #![feature(generic_arg_infer)]`Using `_` as a const argument: #![feature(generic_arg_infer)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
The current issue with the implementation is that there are too many ways of representing infer vars in the
hir. We haveTyKind::Infer,GenericArg::Infer, andArrayLen::Infer. It would be too easy for someone to check only for aTyKind::Infergeneric arg but forget aboutGenericArg::Infer, or check both of those but forget aboutArrayLen::Infer.At this moment I'm not entirely sure what the best way of fixing this is. rust-lang/compiler-team#480 was an attempt to fix this but it was too broad (attempted to also support unbraced const param arguments), did not solve
ArrayLen::Infer, and I'm not even sure how nice removingTyKind::Inferwould be since we usehir::Tyin places for things that arent generic args.Originally posted by @BoxyUwU in #85077 (comment)