1
Fork 0
rust/compiler
Adrian Taylor e75660dad3 Arbitrary self types v2: use Receiver trait
In this new version of Arbitrary Self Types, we no longer use the Deref trait
exclusively when working out which self types are valid. Instead, we follow a
chain of Receiver traits. This enables methods to be called on smart pointer
types which fundamentally cannot support Deref (for instance because they are
wrappers for pointers that don't follow Rust's aliasing rules).

This includes:
* Changes to tests appropriately
* New tests for:
  * The basics of the feature
  * Ensuring lifetime elision works properly
  * Generic Receivers
  * A copy of the method subst test enhanced with Receiver

This is really the heart of the 'arbitrary self types v2' feature, and
is the most critical commit in the current PR.

Subsequent commits are focused on:
* Detecting "shadowing" problems, where a smart pointer type can hide
  methods in the pointee.
* Diagnostics and cleanup.

Naming: in this commit, the "Autoderef" type is modified so that it no
longer solely focuses on the "Deref" trait, but can now consider the
"Receiver" trait instead. Should it be renamed, to something like
"TraitFollower"? This was considered, but rejected, because
* even in the Receiver case, it still considers built-in derefs
* the name Autoderef is short and snappy.
2024-12-11 11:59:12 +00:00
..
rustc switch jemalloc-sys back to tikv-jemalloc-sys, and update to 0.6.0 2024-12-03 08:56:33 +00:00
rustc_abi fix safe-transmute handling of enums 2024-12-01 18:28:04 +01:00
rustc_arena move strict provenance lints to new feature gate, remove old feature gates 2024-10-21 15:22:17 +01:00
rustc_ast Introduce default_field_values feature 2024-12-09 21:55:01 +00:00
rustc_ast_ir
rustc_ast_lowering review comments: rewordings 2024-12-09 21:55:13 +00:00
rustc_ast_passes review comments: rewordings 2024-12-09 21:55:13 +00:00
rustc_ast_pretty Rollup merge of #133424 - Nadrieril:guard-patterns-parsing, r=fee1-dead 2024-12-08 17:18:50 +01:00
rustc_attr ensure that all publicly reachable const fn have const stability info 2024-11-10 10:16:26 +01:00
rustc_baked_icu_data Delete the cfg(not(parallel)) serial compiler 2024-11-12 13:38:58 +00:00
rustc_borrowck Introduce default_field_values feature 2024-12-09 21:55:01 +00:00
rustc_builtin_macros Disallow #[default] Variant {} regardless of feature flag 2024-12-09 21:55:13 +00:00
rustc_codegen_cranelift Rollup merge of #134008 - jswrenn:unsafe-fields-copy, r=compiler-errors 2024-12-10 13:51:10 +01:00
rustc_codegen_gcc Make Copy unsafe to implement for ADTs with unsafe fields 2024-12-07 20:50:00 +00:00
rustc_codegen_llvm Rollup merge of #134115 - durin42:ppc64-target-string, r=jieyouxu 2024-12-10 20:16:05 +01:00
rustc_codegen_ssa Auto merge of #134125 - fmease:rollup-u38o3ob, r=fmease 2024-12-10 13:16:09 +00:00
rustc_const_eval Rollup merge of #134010 - RalfJung:promoted-type-error-ice, r=oli-obk 2024-12-10 08:55:59 +01:00
rustc_data_structures Assert that obligations are empty before deeply normalizing 2024-12-02 22:51:18 +00:00
rustc_driver
rustc_driver_impl Use ensure for analysis calls 2024-12-08 16:57:09 +00:00
rustc_error_codes Arbitrary self types v2: use Receiver trait 2024-12-11 11:59:12 +00:00
rustc_error_messages Delete the cfg(not(parallel)) serial compiler 2024-11-12 13:38:58 +00:00
rustc_errors Handle unwinding out of the closure argument of run_compiler with pending delayed bugs 2024-12-06 18:42:31 +00:00
rustc_expand Introduce default_field_values feature 2024-12-09 21:55:01 +00:00
rustc_feature Introduce default_field_values feature 2024-12-09 21:55:01 +00:00
rustc_fluent_macro
rustc_fs_util
rustc_graphviz
rustc_hir Introduce default_field_values feature 2024-12-09 21:55:01 +00:00
rustc_hir_analysis Arbitrary self types v2: use Receiver trait 2024-12-11 11:59:12 +00:00
rustc_hir_pretty Introduce default_field_values feature 2024-12-09 21:55:01 +00:00
rustc_hir_typeck Arbitrary self types v2: use Receiver trait 2024-12-11 11:59:12 +00:00
rustc_incremental Remove all threading through of ErrorGuaranteed from the driver 2024-12-06 18:42:31 +00:00
rustc_index Use BitSet in SparseBitMatrix. 2024-12-09 08:53:33 +11:00
rustc_index_macros Auto merge of #130867 - michirakara:steps_between, r=dtolnay 2024-11-22 10:54:22 +00:00
rustc_infer Assert that obligations are empty before deeply normalizing 2024-12-02 22:51:18 +00:00
rustc_interface Rollup merge of #133567 - bjorn3:various_cleanups, r=cjgillot 2024-12-09 01:56:32 +01:00
rustc_lexer Add test to check unicode identifier version 2024-12-09 06:23:59 -08:00
rustc_lint Rollup merge of #134008 - jswrenn:unsafe-fields-copy, r=compiler-errors 2024-12-10 13:51:10 +01:00
rustc_lint_defs Actually walk into lifetimes and attrs in EarlyContextAndPass 2024-12-07 02:08:40 +00:00
rustc_llvm Respect verify-llvm-ir option in the backend 2024-11-26 15:26:03 +01:00
rustc_log
rustc_macros give a better error for tuple structs in derive(Diagnostic) 2024-10-27 21:23:28 -04:00
rustc_metadata Support x-crate default fields 2024-12-09 21:58:07 +00:00
rustc_middle Arbitrary self types v2: use Receiver trait 2024-12-11 11:59:12 +00:00
rustc_mir_build review comments: rewordings 2024-12-09 21:55:13 +00:00
rustc_mir_dataflow Rollup merge of #134065 - nnethercote:mv-write_graphviz_results, r=tmiasko 2024-12-10 13:51:12 +01:00
rustc_mir_transform Rollup merge of #134029 - Zalathar:zero, r=oli-obk 2024-12-10 08:55:59 +01:00
rustc_monomorphize Remove polymorphization 2024-12-06 16:42:09 -05:00
rustc_next_trait_solver do not implement unsafe auto traits for types with unsafe fields 2024-12-05 23:52:21 +00:00
rustc_parse Auto merge of #134096 - fmease:rollup-0asgoo8, r=fmease 2024-12-10 03:48:20 +00:00
rustc_parse_format
rustc_passes Rollup merge of #134041 - clubby789:debugvis-sourcemap, r=jieyouxu 2024-12-10 13:51:12 +01:00
rustc_pattern_analysis no more Reveal :( 2024-11-23 13:52:54 +01:00
rustc_privacy Introduce default_field_values feature 2024-12-09 21:55:01 +00:00
rustc_query_impl Remove 'tcx lifetime from OnDiskCache 2024-12-06 18:41:50 +00:00
rustc_query_system Make sure to record deps from cached task in new solver on first run 2024-12-04 16:15:44 +00:00
rustc_resolve review comments: rewordings 2024-12-09 21:55:13 +00:00
rustc_sanitizers use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
rustc_serialize
rustc_session Rollup merge of #133567 - bjorn3:various_cleanups, r=cjgillot 2024-12-09 01:56:32 +01:00
rustc_smir Fix ui-fulldep tests 2024-12-06 18:42:31 +00:00
rustc_span Introduce default_field_values feature 2024-12-09 21:55:01 +00:00
rustc_symbol_mangling Remove polymorphization 2024-12-06 16:42:09 -05:00
rustc_target Rollup merge of #134115 - durin42:ppc64-target-string, r=jieyouxu 2024-12-10 20:16:05 +01:00
rustc_trait_selection Rollup merge of #134008 - jswrenn:unsafe-fields-copy, r=compiler-errors 2024-12-10 13:51:10 +01:00
rustc_traits Delay a bug when encountering an impl with unconstrained generics in codegen_select 2024-11-23 05:27:45 +00:00
rustc_transmute fix safe-transmute handling of enums 2024-12-01 18:28:04 +01:00
rustc_ty_utils Remove polymorphization 2024-12-06 16:42:09 -05:00
rustc_type_ir do not implement unsafe auto traits for types with unsafe fields 2024-12-05 23:52:21 +00:00
rustc_type_ir_macros do not relate Abi and Safety 2024-10-22 23:13:04 +02:00
stable_mir Rollup merge of #132161 - celinval:smir-fix-indent, r=compiler-errors 2024-11-08 18:51:28 +11:00