about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2023-03-26 16:18:30 +0200
committerUrgau <urgau@numericable.fr>2023-05-10 19:36:01 +0200
commitd36e390d8176babedcf326581959958d447170cd (patch)
treeea5b730bbc57f6a0a9e3c08ddd4052755a0a7714 /compiler
parentf7b831ac8a897273f78b9f47165cf8e54066ce4b (diff)
downloadrust-d36e390d8176babedcf326581959958d447170cd.tar.gz
rust-d36e390d8176babedcf326581959958d447170cd.zip
Remove and fix useless drop of reference
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_infer/src/infer/nll_relate/mod.rs2
-rw-r--r--compiler/rustc_middle/src/mir/visit.rs3
2 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_infer/src/infer/nll_relate/mod.rs b/compiler/rustc_infer/src/infer/nll_relate/mod.rs
index 88a0a81e276..9c139d17c18 100644
--- a/compiler/rustc_infer/src/infer/nll_relate/mod.rs
+++ b/compiler/rustc_infer/src/infer/nll_relate/mod.rs
@@ -828,7 +828,7 @@ where
                 } else {
                     match variables.probe(vid) {
                         TypeVariableValue::Known { value: u } => {
-                            drop(variables);
+                            drop(inner);
                             self.relate(u, u)
                         }
                         TypeVariableValue::Unknown { universe: _universe } => {
diff --git a/compiler/rustc_middle/src/mir/visit.rs b/compiler/rustc_middle/src/mir/visit.rs
index 6718605ed0b..d13b846d96a 100644
--- a/compiler/rustc_middle/src/mir/visit.rs
+++ b/compiler/rustc_middle/src/mir/visit.rs
@@ -880,12 +880,11 @@ macro_rules! make_mir_visitor {
             ) {
                 let Constant {
                     span,
-                    user_ty,
+                    user_ty: _, // no visit method for this
                     literal,
                 } = constant;
 
                 self.visit_span($(& $mutability)? *span);
-                drop(user_ty); // no visit method for this
                 match literal {
                     ConstantKind::Ty(ct) => self.visit_ty_const($(&$mutability)? *ct, location),
                     ConstantKind::Val(_, ty) => self.visit_ty($(& $mutability)? *ty, TyContext::Location(location)),