diff options
| author | Michael Goulet <michael@errs.io> | 2023-04-09 00:09:53 +0000 | 
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-04-10 16:08:14 +0000 | 
| commit | d92f74e43b76a7ec37d2ef7dfe6d930331ff5157 (patch) | |
| tree | 026a365fac7dbb58f0f2ed0b4f0751837aaa0688 /compiler/rustc_trait_selection/src/solve/assembly/mod.rs | |
| parent | 2a198c7f62a6dea507ba950750bc928237ad7a00 (diff) | |
| download | rust-d92f74e43b76a7ec37d2ef7dfe6d930331ff5157.tar.gz rust-d92f74e43b76a7ec37d2ef7dfe6d930331ff5157.zip | |
Support safe transmute in new solver
Diffstat (limited to 'compiler/rustc_trait_selection/src/solve/assembly/mod.rs')
| -rw-r--r-- | compiler/rustc_trait_selection/src/solve/assembly/mod.rs | 7 | 
1 files changed, 7 insertions, 0 deletions
| diff --git a/compiler/rustc_trait_selection/src/solve/assembly/mod.rs b/compiler/rustc_trait_selection/src/solve/assembly/mod.rs index 12ee80b6722..a33e8ef4b4a 100644 --- a/compiler/rustc_trait_selection/src/solve/assembly/mod.rs +++ b/compiler/rustc_trait_selection/src/solve/assembly/mod.rs @@ -225,6 +225,11 @@ pub(super) trait GoalKind<'tcx>: TypeFoldable<TyCtxt<'tcx>> + Copy + Eq { ecx: &mut EvalCtxt<'_, 'tcx>, goal: Goal<'tcx, Self>, ) -> QueryResult<'tcx>; + + fn consider_builtin_transmute_candidate( + ecx: &mut EvalCtxt<'_, 'tcx>, + goal: Goal<'tcx, Self>, + ) -> QueryResult<'tcx>; } impl<'tcx> EvalCtxt<'_, 'tcx> { @@ -373,6 +378,8 @@ impl<'tcx> EvalCtxt<'_, 'tcx> { G::consider_builtin_discriminant_kind_candidate(self, goal) } else if lang_items.destruct_trait() == Some(trait_def_id) { G::consider_builtin_destruct_candidate(self, goal) + } else if lang_items.transmute_trait() == Some(trait_def_id) { + G::consider_builtin_transmute_candidate(self, goal) } else { Err(NoSolution) }; | 
