1
Fork 0
rust/compiler
Dylan DPC f1412a665f
Rollup merge of #101614 - compiler-errors:rpitit-eq, r=jackh726
Equate fn outputs when inferring RPITIT hidden types

When we are trying to infer the hidden types for RPITITs, we need to equate the output tys instead of just subtyping them. For example:

```rust
trait Foo { fn bar() -> impl Sized {} }

impl Foo for () { fn bar() -> &'static str { "" } }
```

If we just subtype the signatures `fn() -> &'static str <: fn() -> _#1t` (where `_#1t` is the variable we've used to infer `impl Sized`), we'll end up `&'static str <: _#1t`, which causes us to infer `_#1t = #'_#2r str`, where `'_#2r` is unconstrained, which gets fixed up to `ReEmpty`, and which is certainly not what we want.

I can't actually think of a way to make this fail to compile, because during borrowck we've already done the method probe, and so we just look at the `impl` method signature and see the `&'static str` any time we call `<() as Foo>::bar()`. But this _does_ cause the ICE [here](https://github.com/rust-lang/rust/pull/98559#issuecomment-1241891994) in `@jackh726's` "Remove ReEmpty" PR (#98559) to stop ICEing, because after that PR we were leaking unconstrained region variables into the typeck results.

r? types
2022-09-10 18:56:08 +05:30
..
rustc Don't rerun the build script for the compiler each time on linux 2022-07-10 23:57:25 -05:00
rustc_apfloat Add diagnostic translation lints to crates that don't emit them 2022-08-18 19:29:02 +01:00
rustc_arena Make use of [wrapping_]byte_{add,sub} 2022-08-23 19:32:37 +04:00
rustc_ast Rollup merge of #101573 - lcnr:param-kind-ord, r=BoxyUwU 2022-09-09 22:02:18 +05:30
rustc_ast_lowering Rebase fallout 2022-09-09 01:31:46 +00:00
rustc_ast_passes Rollup merge of #101573 - lcnr:param-kind-ord, r=BoxyUwU 2022-09-09 22:02:18 +05:30
rustc_ast_pretty Auto merge of #101241 - camsteffen:refactor-binding-annotations, r=cjgillot 2022-09-06 03:16:29 +00:00
rustc_attr Rollup merge of #101486 - asquared31415:invalid_repr_list, r=estebank 2022-09-07 07:43:54 +09:00
rustc_borrowck Handle generic parameters. 2022-09-09 01:31:46 +00:00
rustc_builtin_macros Refactor and re-use BindingAnnotation 2022-09-02 12:55:05 -05:00
rustc_codegen_cranelift Auto merge of #101483 - oli-obk:guaranteed_opt, r=fee1-dead 2022-09-10 09:50:21 +00:00
rustc_codegen_gcc Remove dead broken code from const zst handling in backends 2022-09-06 14:09:49 +00:00
rustc_codegen_llvm Introduce a fallible variant of LLVMConstIntGetZExtValue 2022-09-09 15:54:14 +02:00
rustc_codegen_ssa Auto merge of #101483 - oli-obk:guaranteed_opt, r=fee1-dead 2022-09-10 09:50:21 +00:00
rustc_const_eval Auto merge of #101483 - oli-obk:guaranteed_opt, r=fee1-dead 2022-09-10 09:50:21 +00:00
rustc_data_structures Use niche-filling optimization even when multiple variants have data. 2022-09-07 20:12:45 +00:00
rustc_driver Fix ICE report flags display. 2022-09-08 16:08:53 -07:00
rustc_error_codes Stabilize #![feature(label_break_value)] 2022-08-23 21:14:12 -05:00
rustc_error_messages Make async fn in traits work 2022-09-09 01:31:45 +00:00
rustc_errors Rollup merge of #101545 - TaKO8Ki:remove-unnecessary-partialord-ord, r=oli-obk 2022-09-08 20:48:38 +05:30
rustc_expand Refactor and re-use BindingAnnotation 2022-09-02 12:55:05 -05:00
rustc_feature Auto merge of #99916 - dpaoliello:stablizerawdylib, r=wesleywiser 2022-09-10 04:14:34 +00:00
rustc_fs_util Add diagnostic translation lints to crates that don't emit them 2022-08-18 19:29:02 +01:00
rustc_graphviz Add diagnostic translation lints to crates that don't emit them 2022-08-18 19:29:02 +01:00
rustc_hir Rollup merge of #101573 - lcnr:param-kind-ord, r=BoxyUwU 2022-09-09 22:02:18 +05:30
rustc_hir_pretty Handle generic parameters. 2022-09-09 01:31:46 +00:00
rustc_incremental Remove trait_of_item query. 2022-08-01 21:39:26 +02:00
rustc_index Add diagnostic translation lints to crates that don't emit them 2022-08-18 19:29:02 +01:00
rustc_infer Fix documentation lint failures 2022-09-09 01:31:46 +00:00
rustc_interface Auto merge of #100801 - Kobzol:track-pgo-profile-paths, r=michaelwoerister 2022-09-07 03:17:10 +00:00
rustc_lexer remove unnecessary PartialOrd and Ord 2022-09-08 06:15:33 +09:00
rustc_lint Rollup merge of #101501 - Jarcho:tcx_lint_passes, r=davidtwco 2022-09-08 20:48:36 +05:30
rustc_lint_defs Don't fire rust_2021_incompatible_closure_captures in edition = 2021 2022-09-04 20:04:51 +04:00
rustc_llvm Introduce a fallible variant of LLVMConstIntGetZExtValue 2022-09-09 15:54:14 +02:00
rustc_log Add diagnostic translation lints to crates that don't emit them 2022-08-18 19:29:02 +01:00
rustc_macros UPDATE - into_diagnostic to take a Handler instead of a ParseSess 2022-09-05 02:18:45 -04:00
rustc_metadata Auto merge of #99916 - dpaoliello:stablizerawdylib, r=wesleywiser 2022-09-10 04:14:34 +00:00
rustc_middle Rollup merge of #101578 - lcnr:resolve-hack, r=jackh726 2022-09-10 18:56:07 +05:30
rustc_mir_build Auto merge of #101467 - nnethercote:shrink-hir-Ty-Pat, r=spastorino 2022-09-08 13:11:57 +00:00
rustc_mir_dataflow Generalize the Assume intrinsic statement to a general Intrinsic statement 2022-09-06 14:18:32 +00:00
rustc_mir_transform Rollup merge of #101525 - eltociear:patch-16, r=cjgillot 2022-09-07 21:48:20 +02:00
rustc_monomorphize rename codegen_fulfill_obligation 2022-09-09 13:36:27 +02:00
rustc_parse Rollup merge of #101515 - chenyukang:fix-101477, r=fee1-dead 2022-09-08 20:48:37 +05:30
rustc_parse_format Separate CountIsStar from CountIsParam in rustc_parse_format. 2022-08-25 14:49:09 +02:00
rustc_passes Handle generic parameters. 2022-09-09 01:31:46 +00:00
rustc_plugin_impl Migrate rustc_plugin_impl to SessionDiagnostic 2022-08-22 16:35:05 +01:00
rustc_privacy Handle generic parameters. 2022-09-09 01:31:46 +00:00
rustc_query_impl Make HandleCycleError an enum instead of a macro-generated closure 2022-09-06 19:26:08 -05:00
rustc_query_system Rollup merge of #101549 - eholk:type-ir-derive-hashstable_generic, r=jackh726 2022-09-08 11:55:10 +05:30
rustc_resolve Handle generic parameters. 2022-09-09 01:31:46 +00:00
rustc_save_analysis Handle generic parameters. 2022-09-09 01:31:46 +00:00
rustc_serialize Replace rustc_data_structures::thin_vec::ThinVec with thin_vec::ThinVec. 2022-08-29 15:42:13 +10:00
rustc_session translations(rustc_session): migrates two diagnostics in session.rs 2022-09-08 12:22:51 +02:00
rustc_smir Add diagnostic translation lints to crates that don't emit them 2022-08-18 19:29:02 +01:00
rustc_span Auto merge of #101483 - oli-obk:guaranteed_opt, r=fee1-dead 2022-09-10 09:50:21 +00:00
rustc_symbol_mangling Pack Term in the same way as GenericArg. 2022-09-05 15:08:52 +10:00
rustc_target Use RelocModel::Pic for UEFI targets 2022-09-09 15:26:19 -04:00
rustc_trait_selection rename codegen_fulfill_obligation 2022-09-09 13:36:27 +02:00
rustc_traits Fix a bunch of typo 2022-08-31 18:24:55 +08:00
rustc_transmute Auto merge of #100726 - jswrenn:transmute, r=oli-obk 2022-09-04 07:55:44 +00:00
rustc_ty_utils rename codegen_fulfill_obligation 2022-09-09 13:36:27 +02:00
rustc_type_ir Use HashStable_Generic in rustc_type_ir 2022-09-07 16:05:06 -07:00
rustc_typeck Rollup merge of #101614 - compiler-errors:rpitit-eq, r=jackh726 2022-09-10 18:56:08 +05:30