rust/compiler
Matthias Krüger 57370828b9
Rollup merge of #115834 - compiler-errors:binder-vars, r=jackh726
Properly consider binder vars in `HasTypeFlagsVisitor`

Given a PolyTraitRef like `for<'a> Ty: Trait` (where neither `Ty` nor `Trait` mention `'a`), we do *not* return true for `.has_type_flags(TypeFlags::HAS_LATE_BOUND)`, even though binders are supposed to act as if they have late-bound vars even if they don't mention them in their bound value: 31ae3b2bdb. This is because we use `HasTypeFlagsVisitor`, which only computes the type flags for `Ty`, `Const` and `Region` and `Predicates`, and we consequently skip any binders (and setting flags for their vars) that are not contained in one of these types.

This ends up causing a problem, because when we call `TyCtxt::erase_regions` (which both erases regions *and* anonymizes bound vars), we will skip such a PolyTraitRef, not anonymizing it, and therefore not making it structurally equal to other binders. This breaks vtable computations.

This PR computes the flags for all binders we enter in `HasTypeFlagsVisitor` if we're looking for `TypeFlags::HAS_LATE_BOUND` (or `TypeFlags::HAS_{RE,TY,CT}_LATE_BOUND`).

Fixes #115807
2023-09-14 19:12:32 +02:00
..
rustc inline format!() args up to and including rustc_middle 2023-07-30 13:18:33 +02:00
rustc_abi turns out Layout has some more things to worry about -- move ABI comparison into helper function 2023-09-08 09:14:07 +02:00
rustc_arena Bump cfg(bootstrap) 2023-08-23 20:05:14 -04:00
rustc_ast improve AttrTokenStream 2023-09-04 20:07:28 +08:00
rustc_ast_lowering cleanup on messages 2023-09-12 07:27:17 +08:00
rustc_ast_passes Auto merge of #115131 - frank-king:feature/unnamed-fields-lite, r=petrochenkov 2023-08-24 12:52:35 +00:00
rustc_ast_pretty Auto merge of #115131 - frank-king:feature/unnamed-fields-lite, r=petrochenkov 2023-08-24 12:52:35 +00:00
rustc_attr Auto merge of #114201 - Centri3:explicit-repr-rust, r=WaffleLapkin 2023-08-25 00:02:54 +00:00
rustc_baked_icu_data
rustc_borrowck cleanup on messages 2023-09-12 07:27:17 +08:00
rustc_builtin_macros Rename the feature, but not the attribute, to coverage_attribute 2023-09-08 12:46:09 +01:00
rustc_codegen_cranelift make it more clear which functions create fresh AllocId 2023-09-14 07:27:31 +02:00
rustc_codegen_gcc treat host effect params as erased generics in codegen 2023-09-14 07:34:35 +00:00
rustc_codegen_llvm Auto merge of #115817 - fee1-dead-contrib:fix-codegen, r=oli-obk 2023-09-14 13:42:30 +00:00
rustc_codegen_ssa Auto merge of #115817 - fee1-dead-contrib:fix-codegen, r=oli-obk 2023-09-14 13:42:30 +00:00
rustc_const_eval don't force all slice-typed ConstValue to be ConstValue::Slice 2023-09-14 11:56:55 +02:00
rustc_data_structures Bring back verbose_generic_activity_with_arg 2023-09-13 13:41:19 +02:00
rustc_driver
rustc_driver_impl Auto merge of #115735 - bjorn3:better_list_crate_metadata, r=wesleywiser 2023-09-13 10:23:57 +00:00
rustc_error_codes Auto merge of #114656 - bossmc:rework-no-coverage-attr, r=oli-obk 2023-09-14 01:05:18 +00:00
rustc_error_messages Bump cfg(bootstrap) 2023-08-23 20:05:14 -04:00
rustc_errors Auto merge of #115418 - Zoxc:freeze-source, r=oli-obk 2023-09-08 17:20:23 +00:00
rustc_expand Enable incremental-relative-spans by default. 2023-09-07 20:21:13 +00:00
rustc_feature Fix the error message for #![feature(no_coverage)] 2023-09-14 13:01:54 +10:00
rustc_fluent_macro
rustc_fs_util
rustc_graphviz
rustc_hir replace doc occurrences of ItemLikeVisitor 2023-09-05 22:40:36 +02:00
rustc_hir_analysis Auto merge of #115699 - RalfJung:interpret-abi-compat, r=oli-obk 2023-09-12 03:34:55 +00:00
rustc_hir_pretty Auto merge of #114545 - fee1-dead-contrib:lower-impl-effect, r=oli-obk 2023-08-08 19:23:41 +00:00
rustc_hir_typeck Rollup merge of #115765 - asquared31415:cast_diag, r=WaffleLapkin 2023-09-12 06:34:46 +02:00
rustc_incremental Avoid a source_span query when encoding Spans into query results 2023-09-08 02:08:52 +02:00
rustc_index Auto merge of #115094 - Mark-Simulacrum:bootstrap-update, r=ozkanonur 2023-08-24 11:10:52 +00:00
rustc_infer treat host effect params as erased generics in codegen 2023-09-14 07:34:35 +00:00
rustc_interface Auto merge of #115735 - bjorn3:better_list_crate_metadata, r=wesleywiser 2023-09-13 10:23:57 +00:00
rustc_lexer Update lexer emoji diagnostics to Unicode 15.0 2023-07-29 08:47:21 +08:00
rustc_lint Auto merge of #115825 - cjgillot:expr-field-lint, r=compiler-errors 2023-09-14 06:29:23 +00:00
rustc_lint_defs Auto merge of #112038 - Nemo157:edition-2024-unsafe_op_in_unsafe_fn, r=RalfJung 2023-09-14 11:52:08 +00:00
rustc_llvm Rollup merge of #115358 - durin42:compress-debuginfo, r=oli-obk 2023-09-09 00:28:19 +02:00
rustc_log inline format!() args up to and including rustc_middle 2023-07-30 13:18:33 +02:00
rustc_macros Bump cfg(bootstrap) 2023-08-23 20:05:14 -04:00
rustc_metadata Auto merge of #115735 - bjorn3:better_list_crate_metadata, r=wesleywiser 2023-09-13 10:23:57 +00:00
rustc_middle Rollup merge of #115834 - compiler-errors:binder-vars, r=jackh726 2023-09-14 19:12:32 +02:00
rustc_mir_build make it more clear which functions create fresh AllocId 2023-09-14 07:27:31 +02:00
rustc_mir_dataflow Support non-scalar constants. 2023-09-11 16:29:41 +00:00
rustc_mir_transform Auto merge of #115817 - fee1-dead-contrib:fix-codegen, r=oli-obk 2023-09-14 13:42:30 +00:00
rustc_monomorphize Auto merge of #115817 - fee1-dead-contrib:fix-codegen, r=oli-obk 2023-09-14 13:42:30 +00:00
rustc_parse Only suggest turbofish in patterns if we may recover 2023-09-12 16:38:59 +02:00
rustc_parse_format Replace data_structures dependency with index in rustc_parse_format 2023-09-05 19:11:50 +02:00
rustc_passes Auto merge of #114656 - bossmc:rework-no-coverage-attr, r=oli-obk 2023-09-14 01:05:18 +00:00
rustc_plugin_impl
rustc_privacy Rollup merge of #115727 - fee1-dead-contrib:effect-fallback, r=oli-obk 2023-09-11 17:03:31 +02:00
rustc_query_impl Remove verbose_generic_activity_with_arg 2023-09-10 17:47:16 +02:00
rustc_query_system Auto merge of #115388 - Zoxc:sharded-lock, r=SparrowLii 2023-09-11 01:43:29 +00:00
rustc_resolve resolve: determined binding after parent module macro expand 2023-09-13 16:38:05 +08:00
rustc_serialize Use a specialized varint + bitpacking scheme for DepGraph encoding 2023-09-04 12:16:50 -04:00
rustc_session Auto merge of #115735 - bjorn3:better_list_crate_metadata, r=wesleywiser 2023-09-13 10:23:57 +00:00
rustc_smir Rollup merge of #115772 - ouz-a:smir_span2, r=oli-obk 2023-09-14 19:12:31 +02:00
rustc_span Auto merge of #114656 - bossmc:rework-no-coverage-attr, r=oli-obk 2023-09-14 01:05:18 +00:00
rustc_symbol_mangling Auto merge of #115817 - fee1-dead-contrib:fix-codegen, r=oli-obk 2023-09-14 13:42:30 +00:00
rustc_target add helper method for finding the one non-1-ZST field 2023-09-12 20:52:05 +02:00
rustc_trait_selection Auto merge of #115751 - lcnr:inspect-cleanup, r=compiler-errors 2023-09-14 04:42:07 +00:00
rustc_traits remove some unused crate deps 2023-09-01 19:13:09 +03:00
rustc_transmute make the eval() functions on our const types return the resulting value 2023-09-13 07:29:34 +02:00
rustc_ty_utils Auto merge of #115817 - fee1-dead-contrib:fix-codegen, r=oli-obk 2023-09-14 13:42:30 +00:00
rustc_type_ir Explain why TypeFoldable is a sub-trait of TypeVisitable. 2023-09-13 16:50:35 +10:00