rust/compiler
Matthias Krüger a1c98ca160
Rollup merge of #132832 - compiler-errors:late-ty, r=cjgillot
Deny capturing late-bound ty/const params in nested opaques

First, this reverts a7f609504c. I can't exactly remember why I approved this specific bit of https://github.com/rust-lang/rust/pull/132466; specifically, I don't know that the purpose of that commit is, and afaict we will never have an opaque that captures late-bound params through a const because opaques can't be used inside of anon consts. Am I missing something `@cjgillot?` Since I can't see a case where this matters, and no tests seem to fail.

The second commit adds a `deny_late_regions: bool` to distinguish `Scope::LateBoundary` which should deny *any* late-bound params or just ty/consts. Then, when resolving opaques we wrap ourselves in a `Scope::LateBoundary { deny_late_regions: false }` so that we deny late-bound ty/const, which fixes a bunch of ICEs that all vaguely look like `impl for<T> Trait<Assoc = impl OtherTrait<T>>`.

I guess this could be achieved other ways; for example, with a different scope kind, or maybe we could just reuse `Scope::Opaque`. But this seems a bit more verbose. I'm open to feedback anyways.

Fixes #131535
Fixes #131637
Fixes #132530

I opted to remove those crashes tests ^ without adding them as regular tests, since they're basically triggering uninteresting late-bound ICEs far off in the trait solver, and the reason that existing tests such as `tests/ui/type-alias-impl-trait/non-lifetime-binder-in-constraint.rs` don't ICE are kinda just coincidental (i.e. due to a missing impl block). I don't really feel motivated to add random permutations to tests just to exercise non-lifetime binders.

r? cjgillot
2024-11-16 21:05:46 +01:00
..
rustc Auto merge of #132282 - Noratrieb:it-is-the-end-of-serial, r=cjgillot 2024-11-12 15:14:56 +00:00
rustc_abi pointee_info_at: fix logic for recursing into enums 2024-11-08 07:35:29 +01:00
rustc_arena
rustc_ast Rollup merge of #132787 - maxcabrajac:fnctxt, r=petrochenkov 2024-11-16 21:05:46 +01:00
rustc_ast_ir
rustc_ast_lowering Auto merge of #130443 - veluca93:legacy-const-generics-fix, r=BoxyUwU 2024-11-16 04:57:15 +00:00
rustc_ast_passes Rollup merge of #132787 - maxcabrajac:fnctxt, r=petrochenkov 2024-11-16 21:05:46 +01:00
rustc_ast_pretty
rustc_attr ensure that all publicly reachable const fn have const stability info 2024-11-10 10:16:26 +01:00
rustc_baked_icu_data Delete the cfg(not(parallel)) serial compiler 2024-11-12 13:38:58 +00:00
rustc_borrowck Rollup merge of #132134 - nnethercote:rm-ResultsVisitable, r=cjgillot 2024-11-16 21:05:44 +01:00
rustc_builtin_macros Rollup merge of #132787 - maxcabrajac:fnctxt, r=petrochenkov 2024-11-16 21:05:46 +01:00
rustc_codegen_cranelift Add a default implementation for CodegenBackend::link 2024-11-09 20:42:56 +00:00
rustc_codegen_gcc Rollup merge of #132702 - 1c3t3a:issue-132615, r=rcvalle 2024-11-12 23:26:41 +01:00
rustc_codegen_llvm Auto merge of #132965 - mati865:cfguard-gnullvm, r=wesleywiser 2024-11-15 00:21:07 +00:00
rustc_codegen_ssa rustc_metadata: Preprocess search paths for better performance 2024-11-15 10:35:33 +01:00
rustc_const_eval check_consts: fix error requesting feature gate when that gate is not actually needed 2024-11-13 12:03:16 +01:00
rustc_data_structures Delete the cfg(not(parallel)) serial compiler 2024-11-12 13:38:58 +00:00
rustc_driver
rustc_driver_impl Auto merge of #132282 - Noratrieb:it-is-the-end-of-serial, r=cjgillot 2024-11-12 15:14:56 +00:00
rustc_error_codes remove support for rustc_safe_intrinsic attribute; use rustc_intrinsic functions instead 2024-11-08 09:16:00 +01:00
rustc_error_messages Delete the cfg(not(parallel)) serial compiler 2024-11-12 13:38:58 +00:00
rustc_errors Auto merge of #132954 - matthiaskrgr:rollup-x3rww9h, r=matthiaskrgr 2024-11-12 18:04:27 +00:00
rustc_expand Rollup merge of #132787 - maxcabrajac:fnctxt, r=petrochenkov 2024-11-16 21:05:46 +01:00
rustc_feature Rollup merge of #132552 - taiki-e:sparc-target-feature, r=workingjubilee 2024-11-09 10:52:03 +01:00
rustc_fluent_macro
rustc_fs_util
rustc_graphviz
rustc_hir Rollup merge of #132144 - adetaylor:receiver-trait-itself, r=wesleywiser 2024-11-11 21:58:29 +01:00
rustc_hir_analysis Rollup merge of #132832 - compiler-errors:late-ty, r=cjgillot 2024-11-16 21:05:46 +01:00
rustc_hir_pretty compiler: Switch to rustc_abi in hir_pretty, lint_defs, and mir_build 2024-10-30 22:38:49 -07:00
rustc_hir_typeck Auto merge of #132943 - matthiaskrgr:rollup-164l3ej, r=matthiaskrgr 2024-11-12 08:15:38 +00:00
rustc_incremental replace manual time convertions with std ones 2024-11-03 15:51:39 +03:00
rustc_index
rustc_index_macros
rustc_infer Consolidate type system const evaluation under traits::evaluate_const 2024-11-12 02:54:03 +00:00
rustc_interface rustc_metadata: Preprocess search paths for better performance 2024-11-15 10:35:33 +01:00
rustc_lexer Reject raw lifetime followed by \' as well 2024-10-30 01:13:18 +00:00
rustc_lint Rollup merge of #132956 - maxcabrajac:coroutine_kind, r=petrochenkov 2024-11-15 23:38:10 +01:00
rustc_lint_defs Mark never_type_fallback_flowing_into_unsafe as a semantic change 2024-11-14 06:01:14 +01:00
rustc_llvm PassWrapper: disable UseOdrIndicator for Asan Win32 2024-11-14 04:20:18 +08:00
rustc_log
rustc_macros
rustc_metadata rustc_metadata: Preprocess search paths for better performance 2024-11-15 10:35:33 +01:00
rustc_middle Rollup merge of #132978 - WaffleLapkin:very-semantic-change-kind, r=compiler-errors 2024-11-15 23:38:10 +01:00
rustc_mir_build Auto merge of #132943 - matthiaskrgr:rollup-164l3ej, r=matthiaskrgr 2024-11-12 08:15:38 +00:00
rustc_mir_dataflow Remove ResultsVisitable. 2024-11-05 10:18:03 +11:00
rustc_mir_transform Rollup merge of #132134 - nnethercote:rm-ResultsVisitable, r=cjgillot 2024-11-16 21:05:44 +01:00
rustc_monomorphize ABI checks: add support for tier2 arches 2024-11-12 22:34:31 +01:00
rustc_next_trait_solver Consolidate type system const evaluation under traits::evaluate_const 2024-11-12 02:54:03 +00:00
rustc_parse Trim extra space when suggesting removing bad let 2024-11-13 13:19:13 +00:00
rustc_parse_format
rustc_passes Rollup merge of #132541 - RalfJung:const-stable-extern-crate, r=compiler-errors 2024-11-12 18:11:04 +01:00
rustc_pattern_analysis compiler: Remove unused rustc_target from Cargo.tomls 2024-11-03 13:38:47 -08:00
rustc_privacy Simplify some places that deal with generic parameter defaults 2024-11-11 21:29:18 +01:00
rustc_query_impl Delete the cfg(not(parallel)) serial compiler 2024-11-12 13:38:58 +00:00
rustc_query_system Auto merge of #132282 - Noratrieb:it-is-the-end-of-serial, r=cjgillot 2024-11-12 15:14:56 +00:00
rustc_resolve Rollup merge of #132787 - maxcabrajac:fnctxt, r=petrochenkov 2024-11-16 21:05:46 +01:00
rustc_sanitizers compiler: Add rustc_abi to _sanitizers 2024-11-02 20:31:47 -07:00
rustc_serialize
rustc_session rustc_metadata: Preprocess search paths for better performance 2024-11-15 10:35:33 +01:00
rustc_smir Rollup merge of #132131 - celinval:smir-crate-defs, r=compiler-errors 2024-11-07 18:48:22 -08:00
rustc_span Rollup merge of #128197 - Alexendoo:span-ctxt, r=davidtwco 2024-11-14 20:45:12 +01:00
rustc_symbol_mangling ty::BrK -> ty::BoundRegionKind::K 2024-11-04 04:45:52 +00:00
rustc_target Rollup merge of #132842 - veluca93:abi-checks-tier2, r=workingjubilee 2024-11-13 21:04:23 +01:00
rustc_trait_selection Rollup merge of #132971 - BoxyUwU:handle_infers_in_anon_consts, r=compiler-errors 2024-11-13 22:43:37 -08:00
rustc_traits TypingMode 🤔 2024-10-29 17:01:24 +01:00
rustc_transmute
rustc_ty_utils Make fn_abi_sanity_check a bit stricter 2024-11-07 15:54:40 +00:00
rustc_type_ir Rename the FIXMEs, remove a few that dont matter anymore 2024-11-03 18:59:41 +00:00
rustc_type_ir_macros
stable_mir Rollup merge of #132161 - celinval:smir-fix-indent, r=compiler-errors 2024-11-08 18:51:28 +11:00