rust/compiler
Matthias Krüger 03ff673dcc
Rollup merge of #124990 - fmease:expand-weak-aliases-within-cts, r=compiler-errors
Also expand weak alias tys inside consts inside `expand_weak_alias_tys`

Ever since #121344 has been merged, I couldn't let go of the fear that I might've slipped a tiny bug into rustc (:P).

Checking the type flags of the `Const` is strictly more correct than only checking the ones of the `Const`'s `Ty`. I don't think it's possible to trigger an ICE rn (i.e., one of the two `bug!("unexpected weak alias type")` I added in branches where `expand_weak_alias_tys` should've expanded *all* weak alias tys) because presently const exprs aren't allowed to capture late-bound vars. To be future-proof however, we should iron this out.

A possible reproducer would be the following if I'm not mistaken (currently fails to compile due to the aforementioned restriction):

```rs
#![feature(lazy_type_alias, adt_const_params, generic_const_exprs)]

type F = for<'a> fn(A<{ S::<Weak<'a>>(loop {}) }>) -> &'a ();

type A<const N: S<Weak<'static>>> = ();

#[derive(PartialEq, Eq, std::marker::ConstParamTy)]
struct S<T>(T);

type Weak<'a> = &'a ();
```

Whether a late-bound region should actually be considered constrained by a const expr is a separate question — one which we don't need to answer until / unless we actually allow them in such contexts (probable answer: only inside the return exprs of a block but not inside the stmts).

r? oli-obk (he's not available rn but that's fine) or types or compiler
2024-05-15 07:16:47 +02:00
..
rustc Change SIGPIPE ui from #[unix_sigpipe = "..."] to -Zon-broken-pipe=... 2024-05-02 19:48:29 +02:00
rustc_abi Make index_by_increasing_offset return one item for primitives 2024-05-11 21:22:51 -07:00
rustc_arena rename ptr::invalid -> ptr::without_provenance 2024-02-21 20:15:52 +01:00
rustc_ast Remove NtIdent and NtLifetime. 2024-05-14 08:19:58 +10:00
rustc_ast_ir Remove extern crate rustc_macros from numerous crates. 2024-04-29 10:21:54 +10:00
rustc_ast_lowering Warn against redundant use<...> 2024-05-13 23:57:56 -04:00
rustc_ast_passes Stabilize exclusive_range 2024-05-02 19:42:31 -04:00
rustc_ast_pretty Auto merge of #124256 - nnethercote:rm-NtIdent-NtLifetime, r=petrochenkov 2024-05-14 01:10:38 +00:00
rustc_attr Remove extern crate rustc_macros from numerous crates. 2024-04-29 10:21:54 +10:00
rustc_baked_icu_data
rustc_borrowck split out AliasTy -> AliasTerm 2024-05-13 11:59:42 -04:00
rustc_builtin_macros Rollup merge of #124919 - nnethercote:Recovered-Yes-ErrorGuaranteed, r=compiler-errors 2024-05-09 19:09:30 +02:00
rustc_codegen_cranelift Merge commit '3270432f4b0583104c8b9b6f695bf97d6bbf3ac2' into sync_cg_clif-2024-05-13 2024-05-13 13:26:33 +00:00
rustc_codegen_gcc Auto merge of #124972 - matthiaskrgr:rollup-3fablim, r=matthiaskrgr 2024-05-10 16:04:26 +00:00
rustc_codegen_llvm Auto merge of #124972 - matthiaskrgr:rollup-3fablim, r=matthiaskrgr 2024-05-10 16:04:26 +00:00
rustc_codegen_ssa Make index_by_increasing_offset return one item for primitives 2024-05-11 21:22:51 -07:00
rustc_const_eval Remove extern crate rustc_middle from rustc_const_eval. 2024-05-13 08:02:14 +10:00
rustc_data_structures Rollup merge of #124818 - compiler-errors:ena, r=Mark-Simulacrum 2024-05-11 08:00:15 +02:00
rustc_driver
rustc_driver_impl Don't call env::set_var in rustc_driver::install_ice_hook 2024-05-13 09:37:29 +02:00
rustc_error_codes Remove a stray backtick in an error explanation. 2024-05-13 07:53:38 +10:00
rustc_error_messages Rename SubdiagnosticMessage as SubdiagMessage. 2024-03-05 12:14:49 +11:00
rustc_errors Uplift AliasTy 2024-05-13 22:45:01 -04:00
rustc_expand Remove NtIdent and NtLifetime. 2024-05-14 08:19:58 +10:00
rustc_feature Auto merge of #124747 - MasterAwesome:master, r=davidtwco 2024-05-06 00:55:49 +00:00
rustc_fluent_macro Rename SubdiagnosticMessage as SubdiagMessage. 2024-03-05 12:14:49 +11:00
rustc_fs_util Stabilize std::path::absolute 2024-04-24 14:35:02 +00:00
rustc_graphviz
rustc_hir Warn against redundant use<...> 2024-05-13 23:57:56 -04:00
rustc_hir_analysis Warn against redundant use<...> 2024-05-13 23:57:56 -04:00
rustc_hir_pretty Make handling of Comments more iterator-like. 2024-05-13 10:11:29 +10:00
rustc_hir_typeck Auto merge of #125084 - Jules-Bertholet:fix-125058, r=Nadrieril 2024-05-15 00:04:28 +00:00
rustc_incremental Auto merge of #123441 - saethlin:fixed-len-file-names, r=oli-obk 2024-05-03 17:41:48 +00:00
rustc_index Simplify static_assert_sizes. 2024-04-18 15:36:25 +10:00
rustc_index_macros rustc_index: Add a ZERO constant to index types 2024-04-03 19:06:22 +03:00
rustc_infer Auto merge of #125076 - compiler-errors:alias-term, r=lcnr 2024-05-13 22:20:43 +00:00
rustc_interface Improve check-cfg CLI errors with more structured diagnostics 2024-05-06 07:44:41 +02:00
rustc_lexer Improved the compiler code with clippy 2024-04-24 09:41:44 +02:00
rustc_lint And finally add tests 2024-05-13 23:57:56 -04:00
rustc_lint_defs Match ergonomics 2024: migration lint 2024-05-12 11:13:33 -04:00
rustc_llvm Update cc crate to v1.0.97 2024-05-08 15:06:35 +00:00
rustc_log Construct SourceMap at the same time as SessionGlobals. 2024-04-16 13:02:53 +10:00
rustc_macros Lift Lift 2024-05-10 15:44:03 -04:00
rustc_metadata Remove extern crate rustc_middle from rustc_metadata. 2024-05-13 08:20:18 +10:00
rustc_middle Rollup merge of #124990 - fmease:expand-weak-aliases-within-cts, r=compiler-errors 2024-05-15 07:16:47 +02:00
rustc_mir_build Auto merge of #124914 - nnethercote:rm-extern-crate-rustc_middle, r=saethlin 2024-05-13 00:13:34 +00:00
rustc_mir_dataflow Inline & delete Ty::new_unit, since it's just a field access 2024-05-02 17:49:23 +02:00
rustc_mir_transform Auto merge of #125076 - compiler-errors:alias-term, r=lcnr 2024-05-13 22:20:43 +00:00
rustc_monomorphize Lift TraitRef into rustc_type_ir 2024-05-10 15:44:03 -04:00
rustc_next_trait_solver Lift TraitRef into rustc_type_ir 2024-05-10 15:44:03 -04:00
rustc_parse Warn against redundant use<...> 2024-05-13 23:57:56 -04:00
rustc_parse_format Simplify static_assert_sizes. 2024-04-18 15:36:25 +10:00
rustc_passes Rollup merge of #124904 - RalfJung:reachable, r=tmiasko 2024-05-11 01:15:10 +01:00
rustc_pattern_analysis Stabilize exclusive_range 2024-05-02 19:42:31 -04:00
rustc_privacy split out AliasTy -> AliasTerm 2024-05-13 11:59:42 -04:00
rustc_query_impl Remove extern crate rustc_middle from rustc_query_impl. 2024-05-13 08:20:18 +10:00
rustc_query_system Remove some unneeded Cargo.toml dependencies. 2024-05-03 15:33:52 +10:00
rustc_resolve Rollup merge of #123344 - pietroalbini:pa-unused-imports, r=Nilstrieb 2024-05-08 23:33:24 +02:00
rustc_sanitizers Apply nits, uplift ExistentialPredicate too 2024-05-11 18:20:00 -04:00
rustc_serialize Step bootstrap cfgs 2024-05-01 22:19:11 -04:00
rustc_session Add rustfmt cfg to well known cfgs list 2024-05-05 14:30:35 +02:00
rustc_smir Apply nits 2024-05-13 16:55:58 -04:00
rustc_span Auto merge of #124747 - MasterAwesome:master, r=davidtwco 2024-05-06 00:55:49 +00:00
rustc_symbol_mangling Add v0 symbol mangling for f16 and f128 2024-05-14 06:11:25 -04:00
rustc_target Add x86_64-unknown-linux-none target 2024-05-11 21:37:23 +02:00
rustc_trait_selection Use a proper probe for shadowing impl 2024-05-13 23:58:33 -04:00
rustc_traits split out AliasTy -> AliasTerm 2024-05-13 11:59:42 -04:00
rustc_transmute Align: add bytes_usize and bits_usize 2024-05-01 15:57:33 +02:00
rustc_ty_utils Auto merge of #125076 - compiler-errors:alias-term, r=lcnr 2024-05-13 22:20:43 +00:00
rustc_type_ir Remove to_term 2024-05-13 22:45:01 -04:00
rustc_type_ir_macros Uplift TraitPredicate 2024-05-11 18:20:00 -04:00
stable_mir split out AliasTy -> AliasTerm 2024-05-13 11:59:42 -04:00