about summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2024-05-22 19:04:44 +0200
committerGitHub <noreply@github.com>2024-05-22 19:04:44 +0200
commitb3604de1df24393189f7c8e8741dfd6b98cd892e (patch)
treee0bd166fc6272bd48a567d54cc6fb8bd25fe4d61 /compiler/rustc_parse/src
parent76d4bfb1c62e6e0a6fc64ceaa39472b0790419c7 (diff)
parent7faa879486f6aa2871634b54cef3f886591ef323 (diff)
downloadrust-b3604de1df24393189f7c8e8741dfd6b98cd892e.tar.gz
rust-b3604de1df24393189f7c8e8741dfd6b98cd892e.zip
Rollup merge of #125015 - fmease:pat-tys-proh-gen-args-on-ct-params, r=spastorino
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
Diffstat (limited to 'compiler/rustc_parse/src')
0 files changed, 0 insertions, 0 deletions