rust/compiler
Matthias Krüger 363d158cd8
Rollup merge of #111215 - BoxyUwU:resolve_anon_consts_differently, r=cjgillot
Various changes to name resolution of anon consts

Sorry this PR is kind of all over the place ^^'

Fixes #111012

- Rewrites anon const nameres to all go through `fn resolve_anon_const` explicitly instead of `visit_anon_const` to ensure that we do not accidentally resolve anon consts as if they are allowed to use generics when they aren't. Also means that we dont have bits of code for resolving anon consts that will get out of sync (i.e. legacy const generics and resolving path consts that were parsed as type arguments)
- Renames two of the `LifetimeRibKind`, `AnonConst -> ConcreteAnonConst` and `ConstGeneric -> ConstParamTy`
- Noticed while doing this that under `generic_const_exprs` all lifetimes currently get resolved to errors without any error being emitted which was causing a bunch of tests to pass without their bugs having been fixed, incidentally fixed that in this PR and marked those tests as `// known-bug:`. I'm fine to break those since `generic_const_exprs` is a very unstable incomplete feature and this PR _does_ make generic_const_exprs "less broken" as a whole, also I can't be assed to figure out what the underlying causes of all of them are. This PR reopens #77357 #83993
- Changed `generics_of` to stop providing generics and predicates to enum variant discriminant anon consts since those are not allowed to use generic parameters
- Updated the error for non 'static lifetime in const arguments and the error for non 'static lifetime in const param tys to use `derive(Diagnostic)`

I have a vague idea why const-arg-in-const-arg.rs, in-closure.rs and simple.rs have started failing which is unfortunate since these were deliberately made to work, I think lifetime resolution being broken just means this regressed at some point and nobody noticed because the tests were not testing anything :( I'm fine breaking these too for the same reason as the tests for #77357 #83993. I couldn't get `// known-bug` to work for these ICEs and just kept getting different stderr between CI and local `--bless` so I just removed them and will create an issue to track re-adding (and fixing) the bugs if this PR lands.

r? `@cjgillot` cc `@compiler-errors`
2023-05-09 20:49:32 +02:00
..
rustc
rustc_abi Reorder to keep duplicate checks in sync. 2023-05-05 16:30:32 -07:00
rustc_apfloat
rustc_arena Deny the unsafe_op_in_unsafe_fn lint in 2023-04-28 21:00:54 -07:00
rustc_ast Rollup merge of #111215 - BoxyUwU:resolve_anon_consts_differently, r=cjgillot 2023-05-09 20:49:32 +02:00
rustc_ast_lowering Rollup merge of #111215 - BoxyUwU:resolve_anon_consts_differently, r=cjgillot 2023-05-09 20:49:32 +02:00
rustc_ast_passes Add feature gate 2023-05-05 21:44:48 +02:00
rustc_ast_pretty Migrate offset_of from a macro to builtin # syntax 2023-05-05 21:44:13 +02:00
rustc_attr Improve check-cfg diagnostics (part 2) 2023-05-05 13:06:48 +02:00
rustc_baked_icu_data Regen baked data 2023-05-02 10:45:16 -07:00
rustc_borrowck Rollup merge of #110583 - Ezrashaw:tweak-make-mut-spans, r=estebank 2023-05-09 12:33:45 +05:30
rustc_builtin_macros Rollup merge of #110694 - est31:builtin, r=petrochenkov 2023-05-09 12:33:45 +05:30
rustc_codegen_cranelift use EarlyBinder in tcx.(try_)subst_mir_and_normalize_erasing_regions 2023-05-06 22:32:39 -06:00
rustc_codegen_gcc Add todo for filter landing pad 2023-05-07 12:38:47 +01:00
rustc_codegen_llvm Rollup merge of #104070 - nbdd0121:unwind, r=Amanieu 2023-05-08 09:30:21 -07:00
rustc_codegen_ssa Rollup merge of #110304 - cchiw:master, r=davidtwco 2023-05-09 12:33:44 +05:30
rustc_const_eval use EarlyBinder in tcx.(try_)subst_mir_and_normalize_erasing_regions 2023-05-06 22:32:39 -06:00
rustc_data_structures Rollup merge of #111252 - matthewjasper:min-spec-improvements, r=compiler-errors 2023-05-09 12:33:46 +05:30
rustc_driver
rustc_driver_impl Rollup merge of #111004 - clubby789:migrate-mir-transform, r=oli-obk 2023-05-08 09:30:22 -07:00
rustc_error_codes Rollup merge of #111215 - BoxyUwU:resolve_anon_consts_differently, r=cjgillot 2023-05-09 20:49:32 +02:00
rustc_error_messages Rollup merge of #111104 - Manishearth:icuup, r=compiler-errors 2023-05-03 16:42:50 -07:00
rustc_errors Rollup merge of #111004 - clubby789:migrate-mir-transform, r=oli-obk 2023-05-08 09:30:22 -07:00
rustc_expand Rollup merge of #108801 - fee1-dead-contrib:c-str, r=compiler-errors 2023-05-05 18:40:33 +05:30
rustc_feature Rollup merge of #110694 - est31:builtin, r=petrochenkov 2023-05-09 12:33:45 +05:30
rustc_fluent_macro Remove unused synstructure dep 2023-04-22 22:03:33 +01:00
rustc_fs_util
rustc_graphviz enable rust_2018_idioms for doctests 2023-05-07 00:12:29 +03:00
rustc_hir Rollup merge of #108801 - fee1-dead-contrib:c-str, r=compiler-errors 2023-05-05 18:40:33 +05:30
rustc_hir_analysis Rollup merge of #111215 - BoxyUwU:resolve_anon_consts_differently, r=cjgillot 2023-05-09 20:49:32 +02:00
rustc_hir_pretty Rip it out 2023-05-01 16:15:13 +08:00
rustc_hir_typeck Rollup merge of #110504 - compiler-errors:tweak-borrow-sugg, r=cjgillot 2023-05-09 12:33:44 +05:30
rustc_incremental Rollup merge of #111024 - saethlin:stringify-full-svh, r=oli-obk 2023-05-04 08:09:04 +02:00
rustc_index Decorative changes to IndexVec 2023-04-24 13:53:37 +00:00
rustc_infer Rollup merge of #109410 - fmease:iat-alias-kind-inherent, r=compiler-errors 2023-05-08 09:30:21 -07:00
rustc_interface Auto merge of #109421 - mhammerly:extern-force-option, r=petrochenkov 2023-05-06 11:24:37 +00:00
rustc_lexer address comments 2023-05-02 10:32:07 +00:00
rustc_lint Rollup merge of #109410 - fmease:iat-alias-kind-inherent, r=compiler-errors 2023-05-08 09:30:21 -07:00
rustc_lint_defs Auto merge of #106621 - ozkanonur:enable-elided-lifetimes-for-doctests, r=Mark-Simulacrum 2023-05-08 04:50:28 +00:00
rustc_llvm Rollup merge of #111274 - cuviper:print-target-cpus, r=Mark-Simulacrum 2023-05-06 23:32:03 +02:00
rustc_log Stabilize IsTerminal 2023-04-10 17:24:23 +09:00
rustc_macros Rollup merge of #111120 - chenyukang:yukang-suggest-let, r=Nilstrieb 2023-05-09 12:33:46 +05:30
rustc_metadata Auto merge of #109421 - mhammerly:extern-force-option, r=petrochenkov 2023-05-06 11:24:37 +00:00
rustc_middle Auto merge of #111371 - compiler-errors:revert-110907, r=petrochenkov 2023-05-09 15:16:17 +00:00
rustc_mir_build Rollup merge of #108801 - fee1-dead-contrib:c-str, r=compiler-errors 2023-05-05 18:40:33 +05:30
rustc_mir_dataflow Make PlaceMention a non-mutating use. 2023-04-29 16:14:33 +00:00
rustc_mir_transform Auto merge of #111358 - compiler-errors:rollup-yv27vrp, r=compiler-errors 2023-05-08 21:00:50 +00:00
rustc_monomorphize use EarlyBinder in tcx.(try_)subst_mir_and_normalize_erasing_regions 2023-05-06 22:32:39 -06:00
rustc_parse Rollup merge of #111120 - chenyukang:yukang-suggest-let, r=Nilstrieb 2023-05-09 12:33:46 +05:30
rustc_parse_format Fix typos in compiler 2023-04-10 22:02:52 +02:00
rustc_passes Auto merge of #111014 - klensy:no-rc, r=WaffleLapkin 2023-05-04 20:49:23 +00:00
rustc_plugin_impl Add rustc_fluent_macro to decouple fluent from rustc_macros 2023-04-18 18:56:22 +00:00
rustc_privacy Auto merge of #111371 - compiler-errors:revert-110907, r=petrochenkov 2023-05-09 15:16:17 +00:00
rustc_query_impl Remove QueryEngine trait 2023-04-26 07:46:13 +02:00
rustc_query_system Restrict From<S> for {D,Subd}iagnosticMessage. 2023-05-03 08:44:39 +10:00
rustc_resolve Revert "Populate effective visibilities in rustc_privacy" 2023-05-08 21:47:44 +00:00
rustc_serialize Factor out more repeated code in {write,read}_leb128!. 2023-05-04 13:52:14 +10:00
rustc_session Rollup merge of #105354 - BlackHoleFox:apple-deployment-printer, r=oli-obk 2023-05-08 19:41:48 +09:00
rustc_smir Add GeneratorDrop terminator to SMIR 2023-05-05 10:34:55 -03:00
rustc_span Limit lifetime of format_args!() with inlined args. 2023-05-09 16:08:40 +02:00
rustc_symbol_mangling Rollup merge of #105452 - rcvalle:rust-cfi-3, r=bjorn3 2023-05-03 16:42:48 -07:00
rustc_target Rollup merge of #111332 - loongarch-rs:inline-asm, r=Amanieu 2023-05-08 19:41:51 +09:00
rustc_trait_selection Rollup merge of #111252 - matthewjasper:min-spec-improvements, r=compiler-errors 2023-05-09 12:33:46 +05:30
rustc_traits IAT: Introduce AliasKind::Inherent 2023-05-04 16:59:10 +02:00
rustc_transmute Remove unused TypeFoldable/TypeVisitable impls. 2023-04-26 15:19:50 +10:00
rustc_ty_utils Fix miscompilation when adding default method to Future 2023-05-08 17:06:48 +02:00
rustc_type_ir IAT: Introduce AliasKind::Inherent 2023-05-04 16:59:10 +02:00