Skip to content
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

Design meeting: Decide about the future for consts in patterns #220

Closed
RalfJung opened this issue Sep 24, 2023 · 0 comments
Closed

Design meeting: Decide about the future for consts in patterns #220

RalfJung opened this issue Sep 24, 2023 · 0 comments
Labels
meeting-proposal Proposal for a lang team design meeting T-lang

Comments

@RalfJung
Copy link
Member

RalfJung commented Sep 24, 2023

Summary

We allow using (some) constants in patterns. However, we cannot allow all of them: some just don't have a way of being compared, such as unions; others get rejected for being "not structural-match", as defined in RFC 1445. The structural-match check had some holes so some constants that we do accept get linted as "this will be an error in the future". These lints were introduced a long time ago and have been warn-by-default since Rust 1.48, close to 3 years ago. Since then the pattern matching implementation in the compiler changed a lot and our ideas of what we do and don't want to do with pattern matching also changed. We also realized there are some gaps in what the RFC discusses, such as raw pointers.

It's time to figure out where we want to go with this.

Background reading

Design meeting document: https://hackmd.io/@CV5q1SRASEuY8WfOgd_3iQ/rk-b3D6Ja

Some relevant related issues:

About this issue

This issue corresponds to a lang-team design meeting proposal. It corresponds to a possible topic of discussion that may be scheduled for deeper discussion during one of our design meetings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meeting-proposal Proposal for a lang team design meeting T-lang
Projects
Development

No branches or pull requests

2 participants