about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/traits/codegen.rs
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-01-31 19:55:34 +0100
committerCamille GILLOT <gillot.camille@gmail.com>2022-02-09 20:07:38 +0100
commit6c2ee885e635a411946329e974d6be3d94d3b715 (patch)
tree89d664a13c30f9340e1ee9bccfced13a75b0d61d /compiler/rustc_trait_selection/src/traits/codegen.rs
parentbf242bb1199e25ca2274df5c4114e0c9436b74e9 (diff)
downloadrust-6c2ee885e635a411946329e974d6be3d94d3b715.tar.gz
rust-6c2ee885e635a411946329e974d6be3d94d3b715.zip
Ensure that queries only return Copy types.
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits/codegen.rs')
-rw-r--r--compiler/rustc_trait_selection/src/traits/codegen.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/codegen.rs b/compiler/rustc_trait_selection/src/traits/codegen.rs
index 04a7da06063..138d535a569 100644
--- a/compiler/rustc_trait_selection/src/traits/codegen.rs
+++ b/compiler/rustc_trait_selection/src/traits/codegen.rs
@@ -22,7 +22,7 @@ use rustc_middle::ty::{self, TyCtxt};
 pub fn codegen_fulfill_obligation<'tcx>(
     tcx: TyCtxt<'tcx>,
     (param_env, trait_ref): (ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>),
-) -> Result<ImplSource<'tcx, ()>, ErrorReported> {
+) -> Result<&'tcx ImplSource<'tcx, ()>, ErrorReported> {
     // Remove any references to regions; this helps improve caching.
     let trait_ref = tcx.erase_regions(trait_ref);
     // We expect the input to be fully normalized.
@@ -96,7 +96,7 @@ pub fn codegen_fulfill_obligation<'tcx>(
         drop(infcx.inner.borrow_mut().opaque_type_storage.take_opaque_types());
 
         debug!("Cache miss: {:?} => {:?}", trait_ref, impl_source);
-        Ok(impl_source)
+        Ok(&*tcx.arena.alloc(impl_source))
     })
 }