From fe328dc9dcc3578c9b1ebad7c7ba6039d94fa9c6 Mon Sep 17 00:00:00 2001
From: Vincent Lafeychine <vincent.lafeychine@proton.me>
Date: Thu, 25 Apr 2024 23:24:43 +0200
Subject: [PATCH] rust: Fix unused_imports

---
 rr_frontend/.cargo/config.toml                              | 2 +-
 rr_frontend/attribute_parse/src/parse.rs                    | 2 --
 rr_frontend/translation/src/arg_folder.rs                   | 2 +-
 rr_frontend/translation/src/base.rs                         | 1 -
 .../translation/src/environment/dump_borrowck_info.rs       | 1 -
 rr_frontend/translation/src/environment/mod.rs              | 4 +---
 rr_frontend/translation/src/environment/polonius_info.rs    | 1 -
 rr_frontend/translation/src/traits.rs                       | 6 ++----
 8 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/rr_frontend/.cargo/config.toml b/rr_frontend/.cargo/config.toml
index fe85ef68..a119b1c3 100644
--- a/rr_frontend/.cargo/config.toml
+++ b/rr_frontend/.cargo/config.toml
@@ -16,7 +16,7 @@ rustflags = [
     # Rust warnings
     "-Ddead_code",
     "-Adeprecated",
-    "-Aunused_imports",
+    "-Dunused_imports",
     "-Aunused_mut",
     "-Aunused_variables",
 
diff --git a/rr_frontend/attribute_parse/src/parse.rs b/rr_frontend/attribute_parse/src/parse.rs
index de262be5..be3077f9 100644
--- a/rr_frontend/attribute_parse/src/parse.rs
+++ b/rr_frontend/attribute_parse/src/parse.rs
@@ -442,8 +442,6 @@ macro_rules! MToken {
     [_]           => { $crate::parse::Underscore };
 }
 
-pub(crate) use MToken;
-
 pub struct LitStr {
     sym: Symbol,
 }
diff --git a/rr_frontend/translation/src/arg_folder.rs b/rr_frontend/translation/src/arg_folder.rs
index 91c96661..fde2ec7b 100644
--- a/rr_frontend/translation/src/arg_folder.rs
+++ b/rr_frontend/translation/src/arg_folder.rs
@@ -1,5 +1,5 @@
 use rustc_middle::ty::visit::*;
-use rustc_middle::ty::{self, Binder, GenericArg, GenericArgKind, ParamConst, Ty, TyCtxt, TypeFolder};
+use rustc_middle::ty::{self, GenericArg, GenericArgKind, ParamConst, Ty, TyCtxt, TypeFolder};
 pub use rustc_type_ir::fold::{TypeFoldable, TypeSuperFoldable};
 pub use rustc_type_ir::visit::{TypeSuperVisitable, TypeVisitable, TypeVisitor};
 
diff --git a/rr_frontend/translation/src/base.rs b/rr_frontend/translation/src/base.rs
index 514d78c4..d1a3d966 100644
--- a/rr_frontend/translation/src/base.rs
+++ b/rr_frontend/translation/src/base.rs
@@ -6,7 +6,6 @@
 
 use polonius_engine::FactTypes;
 use rustc_borrowck::consumers::RustcFacts;
-use rustc_middle::mir::Location;
 
 pub type Region = <RustcFacts as FactTypes>::Origin;
 pub type PointIndex = <RustcFacts as FactTypes>::Point;
diff --git a/rr_frontend/translation/src/environment/dump_borrowck_info.rs b/rr_frontend/translation/src/environment/dump_borrowck_info.rs
index 08c356cf..7380af92 100644
--- a/rr_frontend/translation/src/environment/dump_borrowck_info.rs
+++ b/rr_frontend/translation/src/environment/dump_borrowck_info.rs
@@ -8,7 +8,6 @@ use std::cell;
 use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
 use std::fs::File;
 use std::io::{self, BufWriter, Write};
-use std::path::PathBuf;
 
 use log::{debug, trace};
 use rustc_hash::FxHashMap;
diff --git a/rr_frontend/translation/src/environment/mod.rs b/rr_frontend/translation/src/environment/mod.rs
index dadb1f53..3ecb3efb 100644
--- a/rr_frontend/translation/src/environment/mod.rs
+++ b/rr_frontend/translation/src/environment/mod.rs
@@ -13,12 +13,10 @@ use std::rc::Rc;
 
 use rustc_ast::ast::Attribute;
 use rustc_hir::def_id::{DefId, LocalDefId};
-use rustc_hir::hir_id::HirId;
 use rustc_middle::mir;
-use rustc_middle::ty::{self, ParamEnv, TyCtxt};
+use rustc_middle::ty::{self, TyCtxt};
 use rustc_span::symbol::Symbol;
 use rustc_span::Span;
-use rustc_trait_selection::infer::{InferCtxtExt, TyCtxtInferExt};
 
 pub mod borrowck;
 mod collect_closure_defs_visitor;
diff --git a/rr_frontend/translation/src/environment/polonius_info.rs b/rr_frontend/translation/src/environment/polonius_info.rs
index 22fee69f..389c8404 100644
--- a/rr_frontend/translation/src/environment/polonius_info.rs
+++ b/rr_frontend/translation/src/environment/polonius_info.rs
@@ -5,7 +5,6 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
-use std::path::PathBuf;
 
 use log::{debug, trace};
 use polonius_engine::{Algorithm, Output};
diff --git a/rr_frontend/translation/src/traits.rs b/rr_frontend/translation/src/traits.rs
index 4c472d85..72af5778 100644
--- a/rr_frontend/translation/src/traits.rs
+++ b/rr_frontend/translation/src/traits.rs
@@ -4,10 +4,8 @@ use log::info;
 use rustc_hir::def_id::DefId;
 use rustc_infer::infer::TyCtxtInferExt;
 use rustc_middle::ty;
-use rustc_middle::ty::{
-    AssocItem, AssocItemContainer, GenericArgsRef, ParamEnv, TraitRef, TyCtxt, TypeVisitableExt,
-};
-use rustc_trait_selection::traits::{ImplSource, NormalizeExt};
+use rustc_middle::ty::{AssocItemContainer, GenericArgsRef, ParamEnv, TraitRef, TyCtxt, TypeVisitableExt};
+use rustc_trait_selection::traits::ImplSource;
 
 /// Normalize a type in the given environment.
 pub fn normalize_type<'tcx, T>(
-- 
GitLab