about summary refs log tree commit diff
path: root/compiler/rustc_const_eval
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-12-18 18:57:05 +0100
committerGitHub <noreply@github.com>2022-12-18 18:57:05 +0100
commit22379779b5842c4347b966e783a09e238f32369e (patch)
treee37159fa32666b8b760be46c6ec2f5e1d4e1d80c /compiler/rustc_const_eval
parent8892698903645843dd508603689e4fd1add6ec7f (diff)
parenta108d55ce634b6f71462c82966b791f18136360e (diff)
downloadrust-22379779b5842c4347b966e783a09e238f32369e.tar.gz
rust-22379779b5842c4347b966e783a09e238f32369e.zip
Rollup merge of #105875 - matthiaskrgr:needless_borrowed_reference, r=oli-obk
don't destuct references just to reborrow
Diffstat (limited to 'compiler/rustc_const_eval')
-rw-r--r--compiler/rustc_const_eval/src/interpret/cast.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/cast.rs b/compiler/rustc_const_eval/src/interpret/cast.rs
index b1fdeb01b10..986b6d65530 100644
--- a/compiler/rustc_const_eval/src/interpret/cast.rs
+++ b/compiler/rustc_const_eval/src/interpret/cast.rs
@@ -332,7 +332,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
                     Immediate::new_slice(ptr, length.eval_usize(*self.tcx, self.param_env), self);
                 self.write_immediate(val, dest)
             }
-            (&ty::Dynamic(ref data_a, ..), &ty::Dynamic(ref data_b, ..)) => {
+            (ty::Dynamic(data_a, ..), ty::Dynamic(data_b, ..)) => {
                 let val = self.read_immediate(src)?;
                 if data_a.principal() == data_b.principal() {
                     // A NOP cast that doesn't actually change anything, should be allowed even with mismatching vtables.