Skip to content

Tracking Issue for _ as a const argument: feature(generic_arg_infer) #85077

Open
@JulianKnodt

Description

@JulianKnodt

This is a tracking issue for the RFC GenericArg::Infer
The feature gate for the issue is #![feature(generic_arg_infer)].

What is GenericArg::Infer?

Currently, rustc supports type inference. That is, given a function fn(T), it can infer the type of T based on its usage. Const-generics also has limited support for inference, such as for arrays, we can infer N: usize in some usages [T; N]. In order to expand inference for consts, it's necessary to lift the current specialized type Ty::Infer into GenericArg::Infer, as GenericArg covers both consts and types, whereas Ty::Infer can only be used in the place of types. This will eventually allow for consts to be inferred in all the same locations as types.

About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.

Steps

Unresolved Questions

  • Should hir::Ty::Infer be removed? No just make it unreachable for hir visitors and in GenericArg::Ty position

Implementation history

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCF-generic_arg_inferUsing `_` as a const argument: #![feature(generic_arg_infer)]`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions