rust/compiler
Matthias Krüger 01c17f83cf
Rollup merge of #146037 - aapoalas:reborrow-lang-experiment, r=tmandry
Introduce CoerceShared lang item and trait, and basic Reborrow tests

Part of rust-lang/rust#145612: This introduces the `CoerceShared` trait which is the `Reborrow` equivalent of a `&mut T` -> `&T` coercion. The trait has a `Target` GAT which makes this (currently) unique in the `core/src/marker.rs`; I'm not sure if this can be considered problematic. Maybe this is not the way such things should be done at the marker trait level? Or maybe it is fine.

Improtantly, this PR introduces a battery of basic `Reborrow` and `CoerceShared` tests. These test the very basics of the feature; custom marker types intended to have exclusive semantics (`Custom<'a>(PhantomData<&'a mut ()>)`), custom exclusive reference wrappers, and standard library exclusive reference wrappers (`Pin<&mut T>` and `Option<&mut T>`). None of these of course work since the implementation for `Reborrow` and `CoerceShared` is entirely missing, but this is the first step towards making these work.

Future PRs will introduce more tests, such as "recursive" reborrowing (ie. reborrowing structs that contain multiple reborrowable fields) and checks around the lifetime semantics of reborrowing ie. that a reborrow produces a new type with the same lifetime as the original.
2025-09-27 21:25:56 +02:00
..
rustc Make llvm_enzyme a regular cargo feature 2025-09-15 15:31:56 +00:00
rustc_abi Rollup merge of #144066 - RalfJung:extern-c-variadics, r=workingjubilee 2025-09-02 17:08:52 +02:00
rustc_arena Introduce Arena::try_alloc_from_iter. 2025-04-19 01:13:18 +00:00
rustc_ast c-variadic: reject functions with unsupported extern ABI 2025-09-09 21:38:38 +02:00
rustc_ast_ir turn pointer width into an integer in target.json 2025-08-27 23:44:49 +02:00
rustc_ast_lowering Auto merge of #145882 - m-ou-se:format-args-extend-1-arg, r=petrochenkov 2025-09-26 04:34:09 +00:00
rustc_ast_passes Improve code and better check doc(cfg(...)) attributes 2025-09-27 11:29:49 +02:00
rustc_ast_pretty Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_attr_parsing Rollup merge of #146704 - jdonszelmann:port-debug-visualizer, r=petrochenkov 2025-09-26 18:11:09 +02:00
rustc_baked_icu_data Use default locale fallback data 2025-08-28 09:48:54 +00:00
rustc_borrowck Rollup merge of #146711 - lcnr:fix-placeholder-ice, r=lqd 2025-09-24 20:34:19 +02:00
rustc_builtin_macros Rollup merge of #146766 - nikic:global-alloc-attr, r=nnethercote 2025-09-25 20:31:56 +10:00
rustc_codegen_cranelift Rollup merge of #146667 - calebzulawski:simd-mono-lane-limit, r=lcnr,RalfJung 2025-09-25 20:31:53 +10:00
rustc_codegen_gcc Rollup merge of #146667 - calebzulawski:simd-mono-lane-limit, r=lcnr,RalfJung 2025-09-25 20:31:53 +10:00
rustc_codegen_llvm Rollup merge of #146778 - nikic:allocator-shim-attributes, r=jackh726 2025-09-26 18:11:11 +02:00
rustc_codegen_ssa Rollup merge of #146704 - jdonszelmann:port-debug-visualizer, r=petrochenkov 2025-09-26 18:11:09 +02:00
rustc_const_eval Apply cfg(bootstrap) replacement 2025-09-26 19:09:23 -04:00
rustc_data_structures avoid calling insert_presorted more than once 2025-09-10 08:40:12 +02:00
rustc_driver compiler: Add Windows resources to rustc-main and rustc_driver 2025-09-05 14:06:31 -04:00
rustc_driver_impl fixes for numerous clippy warnings 2025-09-19 20:56:07 +00:00
rustc_error_codes Changes to the uitests 2025-08-27 20:25:18 +02:00
rustc_error_messages Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_errors fix: Filter suggestion parts that match existing code 2025-09-04 17:42:13 -06:00
rustc_expand Rollup merge of #147031 - joshtriplett:mbe-opt-collect, r=lcnr 2025-09-26 18:11:14 +02:00
rustc_feature Remove doc_auto_cfg feature as well 2025-09-27 11:30:57 +02:00
rustc_fluent_macro Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_fs_util Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_graphviz Remove #![warn(unreachable_pub)] from all compiler/ crates. 2025-03-11 13:14:21 +11:00
rustc_hashes Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
rustc_hir Rollup merge of #146037 - aapoalas:reborrow-lang-experiment, r=tmandry 2025-09-27 21:25:56 +02:00
rustc_hir_analysis Rollup merge of #146667 - calebzulawski:simd-mono-lane-limit, r=lcnr,RalfJung 2025-09-25 20:31:53 +10:00
rustc_hir_id rustc_hir_id: Add a comment explaining why the crate exists 2025-08-20 15:04:00 -07:00
rustc_hir_pretty Rollup merge of #146102 - fmease:rm-dead-eff-code-iii, r=fee1-dead 2025-09-02 17:08:58 +02:00
rustc_hir_typeck review 2025-09-26 16:37:08 +02:00
rustc_incremental Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_index Apply cfg(bootstrap) replacement 2025-09-26 19:09:23 -04:00
rustc_index_macros Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_infer review 2025-09-26 16:37:08 +02:00
rustc_interface Rollup merge of #147005 - GuillaumeGomez:string-formatting-cleanup, r=jdonszelmann 2025-09-25 20:31:58 +10:00
rustc_lexer Fix a crash/mislex when more than one frontmatter closing possibility is considered 2025-09-22 15:10:41 -04:00
rustc_lint Port #[macro_export] to the new attribute parsing infrastructure 2025-09-21 10:42:47 -04:00
rustc_lint_defs Apply cfg(bootstrap) replacement 2025-09-26 19:09:23 -04:00
rustc_llvm Rollup merge of #147015 - Zalathar:dispose-tm, r=lqd 2025-09-25 20:32:00 +10:00
rustc_log Update tracing, again 2025-09-08 09:23:37 -07:00
rustc_macros resolve: Do not finalize shadowed bindings 2025-09-25 20:36:14 +03:00
rustc_metadata Add panic=immediate-abort 2025-09-21 13:12:18 -04:00
rustc_middle Auto merge of #146636 - Mark-Simulacrum:bootstrap-bump, r=jieyouxu 2025-09-27 03:50:03 +00:00
rustc_mir_build fix doc comments to be more standard 2025-09-26 09:25:56 +00:00
rustc_mir_dataflow Rollup merge of #146664 - fmease:clean-up-dyn, r=jdonszelmann 2025-09-18 11:48:51 +10:00
rustc_mir_transform Handle self-loops too. 2025-09-26 20:44:06 +00:00
rustc_monomorphize Auto merge of #145717 - BoxyUwU:erase_regions_rename, r=lcnr 2025-09-09 15:04:44 +00:00
rustc_next_trait_solver allow method calls on opaques 2025-09-26 16:33:15 +02:00
rustc_parse Detect top-level ... in argument type 2025-09-16 11:38:08 -07:00
rustc_parse_format Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_passes Improve code and fix typo 2025-09-27 11:29:50 +02:00
rustc_pattern_analysis Remove DynKind 2025-09-17 04:46:46 +02:00
rustc_privacy fix doc comments to be more standard 2025-09-26 09:25:56 +00:00
rustc_proc_macro Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_public Rollup merge of #146664 - fmease:clean-up-dyn, r=jdonszelmann 2025-09-18 11:48:51 +10:00
rustc_public_bridge Remove useless lifetime parameter. 2025-07-23 23:54:37 +00:00
rustc_query_impl fixup limit handling code 2025-09-08 15:07:12 -07:00
rustc_query_system fixup limit handling code 2025-09-08 15:07:12 -07:00
rustc_resolve Rollup merge of #145113 - petrochenkov:lessfinalize, r=lcnr 2025-09-26 18:11:08 +02:00
rustc_sanitizers Remove DynKind 2025-09-17 04:46:46 +02:00
rustc_serialize Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_session Auto merge of #146338 - CrooseGit:dev/reucru01/AArch64-enable-GCS, r=Urgau,davidtwco 2025-09-24 13:04:19 +00:00
rustc_span Rollup merge of #146037 - aapoalas:reborrow-lang-experiment, r=tmandry 2025-09-27 21:25:56 +02:00
rustc_symbol_mangling Add proper name mangling for pattern types 2025-09-23 10:59:29 +00:00
rustc_target Rollup merge of #146758 - mati865:amd64_mingw_no_rs_objects, r=petrochenkov 2025-09-26 18:11:10 +02:00
rustc_thread_pool Fix a dangling reference in rustc_thread_pool 2025-09-22 14:04:04 -07:00
rustc_trait_selection allow method calls on opaques 2025-09-26 16:33:15 +02:00
rustc_traits erase_regions to erase_and_anonymize_regions 2025-09-09 14:49:16 +02:00
rustc_transmute Add an attribute to check the number of lanes in a SIMD vector after monomorphization 2025-09-23 20:47:34 -04:00
rustc_ty_utils Rollup merge of #146667 - calebzulawski:simd-mono-lane-limit, r=lcnr,RalfJung 2025-09-25 20:31:53 +10:00
rustc_type_ir predefined opaques use List 2025-09-26 16:33:15 +02:00
rustc_type_ir_macros Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_windows_rc [win] Use find-msvc-tools instead of cc to find the linker and rc on Windows 2025-09-19 12:00:30 -07:00