rust/compiler/rustc_hir_analysis/src
León Orell Valerian Liehr b3604de1df
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](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
2024-05-22 19:04:44 +02:00
..
check Rollup merge of #125266 - workingjubilee:stream-plastic-love, r=RalfJung,nikic 2024-05-21 12:47:06 +02:00
coherence Rename Unsafe to Safety 2024-05-17 18:33:37 -03:00
collect Make P parameter explicit 2024-05-16 14:23:47 -04:00
errors Explicitly mention Self 2024-04-20 11:39:43 -04:00
hir_ty_lowering Rollup merge of #125015 - fmease:pat-tys-proh-gen-args-on-ct-params, r=spastorino 2024-05-22 19:04:44 +02:00
impl_wf_check Apply nits 2024-05-13 16:55:58 -04:00
outlives Uplift OutlivesPredicate, remove a bunch of unnecessary associated types from Interner 2024-05-21 17:00:45 -04:00
structured_errors Rename Generics::params to Generics::own_params 2024-05-09 20:58:46 -04:00
variance Add and use generics.is_empty() and generics.is_own_empty, rather than using generics' attributes 2024-05-19 11:10:56 -03:00
autoderef.rs Make builtin_deref just return a Ty 2024-05-09 22:55:00 -04:00
bounds.rs Rename ToPredicate for Upcast 2024-05-16 14:23:47 -04:00
check_unused.rs Rename TyCtxt::struct_span_lint_hir as TyCtxt::node_span_lint. 2024-01-23 08:09:01 +11:00
collect.rs Implement BOXED_SLICE_INTO_ITER 2024-05-20 19:21:30 -04:00
constrained_generic_params.rs Auto merge of #125076 - compiler-errors:alias-term, r=lcnr 2024-05-13 22:20:43 +00:00
errors.rs Auto merge of #124356 - fmease:fewer-magic-numbers-in-names, r=lcnr 2024-05-01 00:04:36 +00:00
hir_wf_check.rs Remove extern crate rustc_middle from rustc_hir_analysis. 2024-05-13 08:04:47 +10:00
impl_wf_check.rs Rename Generics::params to Generics::own_params 2024-05-09 20:58:46 -04:00
lib.rs Add and use generics.is_empty() and generics.is_own_empty, rather than using generics' attributes 2024-05-19 11:10:56 -03:00
structured_errors.rs Rename StructuredDiagnostic as StructuredDiag. 2024-03-05 12:15:12 +11:00