mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
b3604de1df
Pattern types: Prohibit generic args on const params Addresses https://github.com/rust-lang/rust/pull/123689/files#r1562676629. NB: Technically speaking, *not* prohibiting generics args on const params is not a bug as `pattern_types` is an *internal* feature and as such any uncaught misuses of it are considered to be the fault of the user. However, permitting this makes me slightly uncomfortable esp. since we might want to make pattern types available to the public at some point and I don't want this oversight to be able to slip into the language (for comparison, ICEs triggered by the use of internal features are like super fine). Furthermore, this is an ad hoc fix. A more general fix would be changing the representation of the pattern part of pattern types in such a way that it can reuse preexisting lowering routines for exprs / anon consts. See also this [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/pattern.20type.20HIR.20nodes/near/432410768) and #124650. Also note that we currently don't properly typeck the pattern of pat tys. This however is out of scope for this PR. cc ``@oli-obk`` r? ``@spastorino`` as discussed |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
messages.ftl | ||
README.md |
For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.