rust/compiler
bors d163e5e515 Auto merge of #123737 - compiler-errors:alias-wf, r=lcnr
Check alias args for WF even if they have escaping bound vars

#### What

This PR stops skipping arguments of aliases if they have escaping bound vars, instead recursing into them and only discarding the resulting obligations referencing bounds vars.

#### An example:

From the test:
```
trait Trait {
    type Gat<U: ?Sized>;
}

fn test<T>(f: for<'a> fn(<&'a T as Trait>::Gat<&'a [str]>)) where for<'a> &'a T: Trait {}
//~^ ERROR the size for values of type `[()]` cannot be known at compilation time

fn main() {}
```

We now prove that `str: Sized` in order for `&'a [str]` to be well-formed. We were previously unconditionally skipping over `&'a [str]` as it referenced a buond variable. We now recurse into it and instead only discard the `[str]: 'a` obligation because of the escaping bound vars.

#### Why?

This is a change that improves consistency about proving well-formedness earlier in the pipeline, which is necessary for future work on where-bounds in binders and correctly handling higher-ranked implied bounds. I don't expect this to fix any unsoundness.

#### What doesn't it fix?

Specifically, this doesn't check projection predicates' components are well-formed, because there are too many regressions: https://github.com/rust-lang/rust/pull/123737#issuecomment-2052198478
2024-07-03 03:48:06 +00:00
..
rustc Change SIGPIPE ui from #[unix_sigpipe = "..."] to -Zon-broken-pipe=... 2024-05-02 19:48:29 +02:00
rustc_abi Auto merge of #126326 - eggyal:ununsafe-StableOrd, r=michaelwoerister 2024-06-25 15:51:35 +00:00
rustc_arena Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_ast Rollup merge of #126883 - dtolnay:breakvalue, r=fmease 2024-07-02 17:47:45 +02:00
rustc_ast_ir Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_ast_lowering implement new effects desugaring 2024-06-28 10:57:35 +00:00
rustc_ast_passes Rollup merge of #127106 - spastorino:improve-unsafe-extern-blocks-diagnostics, r=compiler-errors 2024-06-29 22:10:57 +02:00
rustc_ast_pretty Rollup merge of #126883 - dtolnay:breakvalue, r=fmease 2024-07-02 17:47:45 +02:00
rustc_attr Use a dedicated type instead of a reference for the diagnostic context 2024-06-18 15:42:11 +00:00
rustc_baked_icu_data Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_borrowck Auto merge of #123720 - amandasystems:dyn-enable-refactor, r=nikomatsakis 2024-07-03 01:24:07 +00:00
rustc_builtin_macros Tighten spans for async blocks 2024-06-27 15:19:08 -04:00
rustc_codegen_cranelift Merge commit '49cd5dd454d0115cfbe9e39102a8b3ba4616aa40' into sync_cg_clif-2024-06-30 2024-06-30 11:28:14 +00:00
rustc_codegen_gcc Remove type_i1 and type_struct from cg_ssa 2024-06-21 19:30:26 +00:00
rustc_codegen_llvm Rollup merge of #127168 - DianQK:cast-size, r=workingjubilee 2024-07-02 17:47:48 +02:00
rustc_codegen_ssa Rollup merge of #127230 - hattizai:patch01, r=saethlin 2024-07-02 17:47:50 +02:00
rustc_const_eval chore: remove duplicate words 2024-07-02 11:25:31 +08:00
rustc_data_structures rustc_data_structures: Explicitly check for 64-bit atomics support 2024-06-28 10:26:45 +02:00
rustc_driver Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_driver_impl Auto merge of #126834 - bjorn3:interface_refactor, r=michaelwoerister 2024-06-25 09:35:53 +00:00
rustc_error_codes Auto merge of #126319 - workingjubilee:rollup-lendnud, r=workingjubilee 2024-06-12 11:10:50 +00:00
rustc_error_messages Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_errors Auto merge of #126996 - oli-obk:do_not_count_errors, r=nnethercote 2024-07-01 06:35:58 +00:00
rustc_expand Rollup merge of #126928 - nnethercote:124141-pre, r=oli-obk 2024-06-27 02:06:19 -04:00
rustc_feature add rustc_dump_def_parents attribute 2024-06-30 19:31:21 +01:00
rustc_fluent_macro Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_fs_util Remove useless tidy-alphabetical markers. 2024-06-20 09:23:20 +10:00
rustc_graphviz Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_hir address review comments 2024-06-28 15:44:20 +00:00
rustc_hir_analysis Rollup merge of #127181 - BoxyUwU:dump_def_parents, r=compiler-errors 2024-07-01 08:53:07 +02:00
rustc_hir_pretty implement new effects desugaring 2024-06-28 10:57:35 +00:00
rustc_hir_typeck Rollup merge of #127230 - hattizai:patch01, r=saethlin 2024-07-02 17:47:50 +02:00
rustc_incremental Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_index Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_index_macros rustc_span: Minor improvements 2024-06-16 14:08:25 +03:00
rustc_infer Auto merge of #126996 - oli-obk:do_not_count_errors, r=nnethercote 2024-07-01 06:35:58 +00:00
rustc_interface Reduce merge conflicts from rustfmt's wrapping 2024-06-28 18:15:12 +01:00
rustc_lexer Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_lint Rollup merge of #126018 - nnethercote:rm-box_pointers-lint, r=lcnr 2024-06-30 18:25:31 +02:00
rustc_lint_defs Ensure out_of_scope_macro_calls lint is registered 2024-07-01 00:25:25 +01:00
rustc_llvm Auto merge of #126907 - glaubitz:sparc-fixes, r=nagisa 2024-06-27 05:44:47 +00:00
rustc_log Bump tracing-tree and allow rendering lines again 2024-06-12 10:11:41 +00:00
rustc_macros Remove redundant argument from subdiagnostic method 2024-06-18 15:42:11 +00:00
rustc_metadata Auto merge of #120639 - fee1-dead-contrib:new-effects-desugaring, r=oli-obk 2024-06-29 20:08:10 +00:00
rustc_middle Auto merge of #123720 - amandasystems:dyn-enable-refactor, r=nikomatsakis 2024-07-03 01:24:07 +00:00
rustc_mir_build chore: remove duplicate words 2024-07-02 11:25:31 +08:00
rustc_mir_dataflow Auto merge of #126996 - oli-obk:do_not_count_errors, r=nnethercote 2024-07-01 06:35:58 +00:00
rustc_mir_transform Rollup merge of #127230 - hattizai:patch01, r=saethlin 2024-07-02 17:47:50 +02:00
rustc_monomorphize Use a dedicated type instead of a reference for the diagnostic context 2024-06-18 15:42:11 +00:00
rustc_next_trait_solver Rollup merge of #127146 - compiler-errors:fast-reject, r=lcnr 2024-07-02 17:47:47 +02:00
rustc_parse Rollup merge of #127103 - compiler-errors:tighten-trait-bound-parsing, r=fmease 2024-06-29 09:14:59 +02:00
rustc_parse_format Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_passes chore: remove duplicate words 2024-07-02 11:25:31 +08:00
rustc_pattern_analysis Replace f16 and f128 pattern matching stubs with real implementations 2024-06-23 04:28:42 -05:00
rustc_privacy Do not ICE in privacy when type inference fails. 2024-06-17 10:09:27 +00:00
rustc_query_impl Allow tracing through item_bounds query invocations on opaques 2024-06-19 08:47:55 +00:00
rustc_query_system Auto merge of #126326 - eggyal:ununsafe-StableOrd, r=michaelwoerister 2024-06-25 15:51:35 +00:00
rustc_resolve Fix import suggestion error when failed not from starting 2024-07-01 20:07:29 +08:00
rustc_sanitizers Split out IntoIterator and non-Iterator constructors for AliasTy/AliasTerm/TraitRef/projection 2024-06-24 11:28:21 -04:00
rustc_serialize chore: remove duplicate words 2024-07-02 11:25:31 +08:00
rustc_session Avoid MIR bloat in inlining 2024-07-01 05:17:13 -07:00
rustc_smir implement new effects desugaring 2024-06-28 10:57:35 +00:00
rustc_span add rustc_dump_def_parents attribute 2024-06-30 19:31:21 +01:00
rustc_symbol_mangling Fix FnMut/Fn shim for coroutine-closures that capture references 2024-06-29 17:38:02 -04:00
rustc_target Use the aligned size for alloca at args when the pass mode is cast. 2024-07-02 06:33:35 +08:00
rustc_trait_selection Auto merge of #123737 - compiler-errors:alias-wf, r=lcnr 2024-07-03 03:48:06 +00:00
rustc_traits Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_transmute safe transmute: support non-ZST, variantful, uninhabited enums 2024-06-14 21:11:08 +00:00
rustc_ty_utils Rollup merge of #127136 - compiler-errors:coroutine-closure-env-shim, r=oli-obk 2024-07-02 17:47:46 +02:00
rustc_type_ir Rollup merge of #127146 - compiler-errors:fast-reject, r=lcnr 2024-07-02 17:47:47 +02:00
rustc_type_ir_macros Uplift TraitPredicate 2024-05-11 18:20:00 -04:00
stable_mir Add method to get all attributes on a definition 2024-06-28 13:24:41 +08:00