]> git.lizzy.rs Git - rust.git/commitdiff
compiler: remove unnecessary imports and qualified paths
authorKaDiWa <kalle.wachsmuth@gmail.com>
Tue, 9 Aug 2022 00:14:43 +0000 (02:14 +0200)
committerKaDiWa <kalle.wachsmuth@gmail.com>
Sat, 10 Dec 2022 17:45:34 +0000 (18:45 +0100)
76 files changed:
compiler/rustc_abi/src/lib.rs
compiler/rustc_apfloat/src/ieee.rs
compiler/rustc_arena/src/lib.rs
compiler/rustc_ast/src/ast.rs
compiler/rustc_ast/src/ptr.rs
compiler/rustc_ast/src/tokenstream.rs
compiler/rustc_ast_lowering/src/lib.rs
compiler/rustc_builtin_macros/src/concat.rs
compiler/rustc_codegen_ssa/src/base.rs
compiler/rustc_const_eval/src/const_eval/eval_queries.rs
compiler/rustc_const_eval/src/interpret/cast.rs
compiler/rustc_const_eval/src/interpret/intrinsics.rs
compiler/rustc_const_eval/src/interpret/intrinsics/caller_location.rs
compiler/rustc_const_eval/src/interpret/operator.rs
compiler/rustc_const_eval/src/interpret/util.rs
compiler/rustc_const_eval/src/interpret/validity.rs
compiler/rustc_const_eval/src/util/aggregate.rs
compiler/rustc_data_structures/src/fingerprint.rs
compiler/rustc_data_structures/src/graph/scc/mod.rs
compiler/rustc_data_structures/src/graph/vec_graph/mod.rs
compiler/rustc_data_structures/src/owning_ref/mod.rs
compiler/rustc_data_structures/src/owning_ref/tests.rs
compiler/rustc_data_structures/src/profiling.rs
compiler/rustc_data_structures/src/sorted_map.rs
compiler/rustc_data_structures/src/sorted_map/index_map.rs
compiler/rustc_data_structures/src/sso/either_iter.rs
compiler/rustc_data_structures/src/sso/map.rs
compiler/rustc_data_structures/src/sso/set.rs
compiler/rustc_data_structures/src/sync.rs
compiler/rustc_data_structures/src/tagged_ptr/drop.rs
compiler/rustc_data_structures/src/vec_map.rs
compiler/rustc_driver/src/lib.rs
compiler/rustc_error_codes/src/error_codes/E0492.md
compiler/rustc_errors/src/diagnostic_impls.rs
compiler/rustc_expand/src/base.rs
compiler/rustc_hir/src/pat_util.rs
compiler/rustc_hir_analysis/src/check/wfcheck.rs
compiler/rustc_incremental/src/persist/dirty_clean.rs
compiler/rustc_incremental/src/persist/fs.rs
compiler/rustc_index/src/vec.rs
compiler/rustc_interface/src/tests.rs
compiler/rustc_lexer/src/lib.rs
compiler/rustc_lint/src/types.rs
compiler/rustc_metadata/src/rmeta/table.rs
compiler/rustc_middle/src/mir/coverage.rs
compiler/rustc_middle/src/mir/interpret/mod.rs
compiler/rustc_middle/src/mir/interpret/pointer.rs
compiler/rustc_middle/src/mir/interpret/value.rs
compiler/rustc_middle/src/mir/mod.rs
compiler/rustc_middle/src/traits/query.rs
compiler/rustc_middle/src/ty/consts/int.rs
compiler/rustc_middle/src/ty/consts/kind.rs
compiler/rustc_middle/src/ty/print/pretty.rs
compiler/rustc_middle/src/ty/vtable.rs
compiler/rustc_mir_build/src/build/matches/mod.rs
compiler/rustc_mir_build/src/build/matches/util.rs
compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs
compiler/rustc_mir_dataflow/src/framework/lattice.rs
compiler/rustc_mir_transform/src/simplify.rs
compiler/rustc_monomorphize/src/polymorphize.rs
compiler/rustc_parse/src/parser/attr.rs
compiler/rustc_parse/src/parser/attr_wrapper.rs
compiler/rustc_parse/src/parser/item.rs
compiler/rustc_query_system/src/dep_graph/graph.rs
compiler/rustc_query_system/src/dep_graph/serialized.rs
compiler/rustc_query_system/src/query/caches.rs
compiler/rustc_query_system/src/query/job.rs
compiler/rustc_save_analysis/src/lib.rs
compiler/rustc_serialize/src/opaque.rs
compiler/rustc_session/src/config.rs
compiler/rustc_session/src/filesearch.rs
compiler/rustc_span/src/source_map.rs
compiler/rustc_span/src/symbol.rs
compiler/rustc_target/src/lib.rs
compiler/rustc_target/src/spec/mod.rs
compiler/rustc_type_ir/src/sty.rs

index e14c9ea9a5d1a913d1af20f97776f5a7a43f4b9f..4ca59144b29902ebf2377ae220e5c9f8678f9a10 100644 (file)
@@ -1,6 +1,5 @@
 #![cfg_attr(feature = "nightly", feature(step_trait, rustc_attrs, min_specialization))]
 
-use std::convert::{TryFrom, TryInto};
 use std::fmt;
 #[cfg(feature = "nightly")]
 use std::iter::Step;
index 3db8adb2a244424a52cbf667128b7a722f92150a..2286712f02565974f2623901844c82328e562ff6 100644 (file)
@@ -2,7 +2,6 @@
 use crate::{Float, FloatConvert, ParseError, Round, Status, StatusAnd};
 
 use core::cmp::{self, Ordering};
-use core::convert::TryFrom;
 use core::fmt::{self, Write};
 use core::marker::PhantomData;
 use core::mem;
index 46dbbd83d19054e2c2aaf8e4751c68a9aaf974d0..4fae5ef845f7d95a2cfb947a25daeada6e46cdf7 100644 (file)
@@ -28,7 +28,7 @@
 use std::alloc::Layout;
 use std::cell::{Cell, RefCell};
 use std::cmp;
-use std::marker::{PhantomData, Send};
+use std::marker::PhantomData;
 use std::mem::{self, MaybeUninit};
 use std::ptr::{self, NonNull};
 use std::slice;
index 4d80f904ac461beafd03f212c83931e981fa1cff..74a0c13b23f7424b8408403661b28bebbea8a568 100644 (file)
@@ -33,7 +33,6 @@
 use rustc_span::source_map::{respan, Spanned};
 use rustc_span::symbol::{kw, sym, Ident, Symbol};
 use rustc_span::{Span, DUMMY_SP};
-use std::convert::TryFrom;
 use std::fmt;
 use std::mem;
 use thin_vec::{thin_vec, ThinVec};
index 30481eddf9160ee30009d679ade670127c96fc32..4b2850336a03db2479ec59804de725eb26ff23ae 100644 (file)
@@ -22,7 +22,6 @@
 //!   Moreover, a switch to, e.g., `P<'a, T>` would be easy and mostly automated.
 
 use std::fmt::{self, Debug, Display};
-use std::iter::FromIterator;
 use std::ops::{Deref, DerefMut};
 use std::{slice, vec};
 
index 482c302950f01ae7e20b16002afb4b4e114e97f1..29a5eb4b7c509260a9034296eec158af8abcb123 100644 (file)
@@ -362,7 +362,7 @@ pub fn add_comma(&self) -> Option<(TokenStream, Span)> {
     }
 }
 
-impl iter::FromIterator<TokenTree> for TokenStream {
+impl FromIterator<TokenTree> for TokenStream {
     fn from_iter<I: IntoIterator<Item = TokenTree>>(iter: I) -> Self {
         TokenStream::new(iter.into_iter().collect::<Vec<TokenTree>>())
     }
index 4fa18907fcd466cd262eeddc2968514d01022945..5d7397977e9849f79f1a2ea680ca0cb0c8697a2c 100644 (file)
@@ -456,8 +456,8 @@ pub fn lower_to_hir<'hir>(tcx: TyCtxt<'hir>, (): ()) -> hir::Crate<'hir> {
     }
 
     // Drop AST to free memory
-    std::mem::drop(ast_index);
-    sess.time("drop_ast", || std::mem::drop(krate));
+    drop(ast_index);
+    sess.time("drop_ast", || drop(krate));
 
     // Discard hygiene data, which isn't required after lowering to HIR.
     if !sess.opts.unstable_opts.keep_hygiene_data {
index e2d71825d556f69ca9bbc4277848b4aaf89047ad..c9dc6b847cdb525f3458e40277f1adf54a029866 100644 (file)
@@ -4,8 +4,6 @@
 use rustc_session::errors::report_lit_error;
 use rustc_span::symbol::Symbol;
 
-use std::string::String;
-
 pub fn expand_concat(
     cx: &mut base::ExtCtxt<'_>,
     sp: rustc_span::Span,
index 4f396e970ad70969228cae3756eec5273af4a483..664697e0edaa406f5018d4a014fe7973730785f8 100644 (file)
@@ -41,7 +41,6 @@
 use rustc_target::abi::{Align, Size, VariantIdx};
 
 use std::collections::BTreeSet;
-use std::convert::TryFrom;
 use std::time::{Duration, Instant};
 
 use itertools::Itertools;
index c27790d8887a377a67a59da57daa99ca84f5f9b3..319f2b2c25ebf320f71c6d0fe83bca042fe3f191 100644 (file)
@@ -1,5 +1,4 @@
 use std::borrow::Cow;
-use std::convert::TryInto;
 
 use either::{Left, Right};
 
index 269ae15d4974547f929544764313ce900982ecc0..b1fdeb01b100abd58f5b0b44c678b07ffc2ebe75 100644 (file)
@@ -1,5 +1,4 @@
 use std::assert_matches::assert_matches;
-use std::convert::TryFrom;
 
 use rustc_apfloat::ieee::{Double, Single};
 use rustc_apfloat::{Float, FloatConvert};
index 7940efcd2b11f1517a22631f0d5a4d77616ece7d..b9be7fa48000be54ddef02808aa26b3a100ec2fb 100644 (file)
@@ -2,8 +2,6 @@
 //! looking at their MIR. Intrinsics/functions supported here are shared by CTFE
 //! and miri.
 
-use std::convert::TryFrom;
-
 use rustc_hir::def_id::DefId;
 use rustc_middle::mir::{
     self,
index 7d94a22c43d71e467d3c8eeed2963ebc0dbcbff4..77c7b4bacb8c8a96d68b42704478166e754d0772 100644 (file)
@@ -1,5 +1,3 @@
-use std::convert::TryFrom;
-
 use rustc_ast::Mutability;
 use rustc_hir::lang_items::LangItem;
 use rustc_middle::mir::TerminatorKind;
index 1f1d0665139d093f005f9c0a81edd2e6d0c7c19a..949f95c5fa81c2a8909ac6fd353b8578946b9535 100644 (file)
@@ -1,5 +1,3 @@
-use std::convert::TryFrom;
-
 use rustc_apfloat::Float;
 use rustc_middle::mir;
 use rustc_middle::mir::interpret::{InterpResult, Scalar};
index 2bc521d5bbe0b8bca7c3ea812ee8f8d9bd38c0ba..e4f716c31945c68aacdfce6490c13a7116824508 100644 (file)
@@ -1,6 +1,5 @@
 use rustc_middle::mir::interpret::InterpResult;
 use rustc_middle::ty::{self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitor};
-use std::convert::TryInto;
 use std::ops::ControlFlow;
 
 /// Checks whether a type contains generic parameters which require substitution.
index 0e85c7d11bce560b3af9d507a25f23b2e0aa0eaf..fc65306e440a9912ead726d9d4ca871cd5eae3be 100644 (file)
@@ -4,7 +4,6 @@
 //! That's useful because it means other passes (e.g. promotion) can rely on `const`s
 //! to be const-safe.
 
-use std::convert::TryFrom;
 use std::fmt::{Display, Write};
 use std::num::NonZeroUsize;
 
index c43de3368c62fd190ec6e242e287803f9a2b1d78..10783c5ed1d1cd7389fd67f5aa72e83f74763108 100644 (file)
@@ -3,7 +3,6 @@
 use rustc_middle::ty::{Ty, TyCtxt};
 use rustc_target::abi::VariantIdx;
 
-use std::convert::TryFrom;
 use std::iter::TrustedLen;
 
 /// Expand `lhs = Rvalue::Aggregate(kind, operands)` into assignments to the fields.
index d98f4e43fe8843890fa1044df400b9b8113ea49f..b6e866f15efe3c576285798a16b4d9ce9d051afb 100644 (file)
@@ -1,6 +1,5 @@
 use crate::stable_hasher;
 use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
-use std::convert::TryInto;
 use std::hash::{Hash, Hasher};
 
 #[cfg(test)]
index 7099ca7eb88c2db01f8b5ed0af656a99e6bca869..b31092eca9837bb0a0c5536b1be7e05c188fcbf5 100644 (file)
@@ -9,7 +9,6 @@
 use crate::graph::vec_graph::VecGraph;
 use crate::graph::{DirectedGraph, GraphSuccessors, WithNumEdges, WithNumNodes, WithSuccessors};
 use rustc_index::vec::{Idx, IndexVec};
-use std::cmp::Ord;
 use std::ops::Range;
 
 #[cfg(test)]
index e8efbd09a2c38c815647ec4cd62b5acae103bbc7..94232bb7626ec885327699322d6d1357b4a9da40 100644 (file)
@@ -1,5 +1,3 @@
-use std::cmp::Ord;
-
 use crate::graph::{DirectedGraph, GraphSuccessors, WithNumEdges, WithNumNodes, WithSuccessors};
 use rustc_index::vec::{Idx, IndexVec};
 
index 980a540ccba7a5c0758f954cabd9cc5b8fc4a05a..d1d92b905b82e0b9da4db953f10c263d8bce4838 100644 (file)
@@ -867,11 +867,9 @@ pub fn try_new<F, E>(o: O, f: F) -> Result<Self, E>
 /////////////////////////////////////////////////////////////////////////////
 
 use std::borrow::Borrow;
-use std::cmp::{Eq, Ord, Ordering, PartialEq, PartialOrd};
-use std::convert::From;
+use std::cmp::Ordering;
 use std::fmt::{self, Debug};
 use std::hash::{Hash, Hasher};
-use std::marker::{Send, Sync};
 
 impl<O, T: ?Sized> Deref for OwningRef<O, T> {
     type Target = T;
@@ -1096,7 +1094,6 @@ fn hash<H: Hasher>(&self, state: &mut H) {
 // std types integration and convenience type defs
 /////////////////////////////////////////////////////////////////////////////
 
-use std::boxed::Box;
 use std::cell::{Ref, RefCell, RefMut};
 use std::rc::Rc;
 use std::sync::Arc;
index 320c03d5139f4ba0985dbaae066f61c3b92c0fe8..a9b187c4ce0a79f979ae4c562ebe56ab598c40bb 100644 (file)
@@ -3,7 +3,7 @@
 mod owning_ref {
     use super::super::OwningRef;
     use super::super::{BoxRef, Erased, ErasedBoxRef, RcRef};
-    use std::cmp::{Ord, Ordering, PartialEq, PartialOrd};
+    use std::cmp::Ordering;
     use std::collections::hash_map::DefaultHasher;
     use std::collections::HashMap;
     use std::hash::{Hash, Hasher};
@@ -368,7 +368,7 @@ fn owning_handle_safe_2() {
 mod owning_ref_mut {
     use super::super::BoxRef;
     use super::super::{BoxRefMut, Erased, ErasedBoxRefMut, OwningRefMut};
-    use std::cmp::{Ord, Ordering, PartialEq, PartialOrd};
+    use std::cmp::Ordering;
     use std::collections::hash_map::DefaultHasher;
     use std::collections::HashMap;
     use std::hash::{Hash, Hasher};
index aa7a01eed15c9a1438dbfb133632091fc4018a02..1d4014f05acdc3e5a208d301ebd534a504fb411c 100644 (file)
@@ -86,7 +86,6 @@
 
 use std::borrow::Borrow;
 use std::collections::hash_map::Entry;
-use std::convert::Into;
 use std::error::Error;
 use std::fs;
 use std::path::Path;
index d13313dfd0ebfc4c145ad4a8756141a9f62c7a7c..03ff5e5b3751fe502d5c1c3c0265dc9c07c74aa8 100644 (file)
@@ -1,7 +1,6 @@
 use crate::stable_hasher::{HashStable, StableHasher, StableOrd};
 use std::borrow::Borrow;
 use std::cmp::Ordering;
-use std::iter::FromIterator;
 use std::mem;
 use std::ops::{Bound, Index, IndexMut, RangeBounds};
 
index c2f0ae328962be15a9ac787fd62f51dd2f464b19..7af5c14942adf8c30ac0c0bc898655b97251a708 100644 (file)
@@ -1,7 +1,6 @@
 //! A variant of `SortedMap` that preserves insertion order.
 
 use std::hash::{Hash, Hasher};
-use std::iter::FromIterator;
 
 use crate::stable_hasher::{HashStable, StableHasher};
 use rustc_index::vec::{Idx, IndexVec};
index 131eeef4582de6fc35df95d90470cf9881bf48e1..bca6c0955b905f8732fb72b598fc75e62d924152 100644 (file)
@@ -1,7 +1,5 @@
 use std::fmt;
-use std::iter::ExactSizeIterator;
 use std::iter::FusedIterator;
-use std::iter::Iterator;
 
 /// Iterator which may contain instance of
 /// one of two specific implementations.
index ec6a62016a87cffad47430832d96f4554d5567aa..7cdac58197714840081099415c7fadd866b76f75 100644 (file)
@@ -3,7 +3,6 @@
 use arrayvec::ArrayVec;
 use std::fmt;
 use std::hash::Hash;
-use std::iter::FromIterator;
 use std::ops::Index;
 
 // For pointer-sized arguments arrays
index 406f0270dcc1b50587a35354ad677152f7287f47..a4b40138933dedc2cf12c370df798509f1aca3f7 100644 (file)
@@ -1,6 +1,5 @@
 use std::fmt;
 use std::hash::Hash;
-use std::iter::FromIterator;
 
 use super::map::SsoHashMap;
 
index e4f47b22ac3584d5336ed0d42d5c030f2e82872e..ed5341c40ef08b70ee2fae389ad86b949f80ba8b 100644 (file)
@@ -138,7 +138,7 @@ macro_rules! parallel {
             }
         }
 
-        pub use std::iter::Iterator as ParallelIterator;
+        pub use Iterator as ParallelIterator;
 
         pub fn par_iter<T: IntoIterator>(t: T) -> T::IntoIter {
             t.into_iter()
index d44ccd368b3cbb507c630fca26432c7a7da39da2..b0315c93d934d7a359266dd89ddfa86268c5d4a4 100644 (file)
@@ -76,7 +76,7 @@ impl<P, T, const COMPARE_PACKED: bool> Drop for TaggedPtr<P, T, COMPARE_PACKED>
     fn drop(&mut self) {
         // No need to drop the tag, as it's Copy
         unsafe {
-            std::mem::drop(P::from_usize(self.raw.pointer_raw()));
+            drop(P::from_usize(self.raw.pointer_raw()));
         }
     }
 }
index 86be0bd8775d76cdcca9553035d3a8c973fc590c..2417df66bb9d8a2b0dd0d4ac09744a0d8dba0cdc 100644 (file)
@@ -1,6 +1,5 @@
 use std::borrow::Borrow;
 use std::fmt::Debug;
-use std::iter::FromIterator;
 use std::slice::Iter;
 use std::vec::IntoIter;
 
index f06ca5a0733a58039724c244df9f27ba871be246..711eed2b2723118a11a64ceeb11f01ca651f30da 100644 (file)
@@ -45,7 +45,6 @@
 
 use std::borrow::Cow;
 use std::cmp::max;
-use std::default::Default;
 use std::env;
 use std::ffi::OsString;
 use std::fs;
index 79e7c069a91c42cdb62d62be42c245702a32798d..7c0719dc217d06089d726acca31a965d7a99a69f 100644 (file)
@@ -55,7 +55,6 @@ wrapper:
 
 ```
 use std::cell::Cell;
-use std::marker::Sync;
 
 struct NotThreadSafe<T> {
     value: Cell<T>,
index 7155db32e53b7f75e71c4e592c70aa58a4278362..88b4fffd46f616df7f31c53a78014cd3bda5d0ec 100644 (file)
@@ -59,7 +59,7 @@ fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
     i128,
     u128,
     std::io::Error,
-    std::boxed::Box<dyn std::error::Error>,
+    Box<dyn std::error::Error>,
     std::num::NonZeroU32,
     hir::Target,
     Edition,
index 9d6a4f9a1fd7d063dfc06c704e5084abf31de117..321c43a1aba8df714bcf30786b9a121d603190de 100644 (file)
@@ -26,7 +26,6 @@
 use rustc_span::{BytePos, FileName, RealFileName, Span, DUMMY_SP};
 use smallvec::{smallvec, SmallVec};
 
-use std::default::Default;
 use std::iter;
 use std::path::PathBuf;
 use std::rc::Rc;
index 6e2fbf96cbfb3f26aabf1eb23901dffc687d68d8..e870aa543d0b5ce9737ae0deb2b0ae7de088714e 100644 (file)
@@ -6,7 +6,7 @@
 use rustc_span::symbol::Ident;
 use rustc_span::Span;
 
-use std::iter::{Enumerate, ExactSizeIterator};
+use std::iter::Enumerate;
 
 pub struct EnumerateAndAdjust<I> {
     enumerate: Enumerate<I>,
index b065ace6bf5e15f826f54eecaa60c0b918be0e7c..69eb96fe8e9251871a8031c05f8278c5e2965dd3 100644 (file)
@@ -31,7 +31,6 @@
 };
 
 use std::cell::LazyCell;
-use std::convert::TryInto;
 use std::iter;
 use std::ops::{ControlFlow, Deref};
 
index a8acaf6597aaba3064b261dc005ac964ee241598..d1d328128bc15a145f7b60835cdfe62f7733beae 100644 (file)
@@ -30,8 +30,6 @@
 use rustc_middle::ty::TyCtxt;
 use rustc_span::symbol::{sym, Symbol};
 use rustc_span::Span;
-use std::iter::FromIterator;
-use std::vec::Vec;
 
 const LOADED_FROM_DISK: Symbol = sym::loaded_from_disk;
 const EXCEPT: Symbol = sym::except;
index 97ebed0585579ab99bb60bc2b6eb0889f842261c..1fd2b9b0d7b7b5a58b4d291cf039575a08715e48 100644 (file)
 
 use std::fs as std_fs;
 use std::io::{self, ErrorKind};
-use std::mem;
 use std::path::{Path, PathBuf};
 use std::time::{Duration, SystemTime, UNIX_EPOCH};
 
@@ -305,7 +304,7 @@ pub fn prepare_session_directory(
             }
 
             delete_session_dir_lock_file(sess, &lock_file_path);
-            mem::drop(directory_lock);
+            drop(directory_lock);
         }
     }
 }
@@ -864,7 +863,7 @@ pub fn garbage_collect_session_directories(sess: &Session) -> io::Result<()> {
 
                     // Let's make it explicit that the file lock is released at this point,
                     // or rather, that we held on to it until here
-                    mem::drop(lock);
+                    drop(lock);
                 }
                 Err(_) => {
                     debug!(
@@ -898,7 +897,7 @@ pub fn garbage_collect_session_directories(sess: &Session) -> io::Result<()> {
 
         // Let's make it explicit that the file lock is released at this point,
         // or rather, that we held on to it until here
-        mem::drop(lock);
+        drop(lock);
     }
 
     Ok(())
index 39aa27a23c1d2ceeb62825d123893566f57729be..c18a911b2fbcd4db06dfe417f9efbfee8579a4a2 100644 (file)
@@ -4,7 +4,6 @@
 use std::fmt;
 use std::fmt::Debug;
 use std::hash::Hash;
-use std::iter::FromIterator;
 use std::marker::PhantomData;
 use std::ops::{Index, IndexMut, RangeBounds};
 use std::slice;
index 2b8f6557c829b32042879be2c525ed09e4fbef8f..e903cb86dd20438a9264fcdf67bfedf6f3783cb4 100644 (file)
@@ -25,7 +25,6 @@
 use rustc_target::spec::{RelroLevel, SanitizerSet, SplitDebuginfo, StackProtector, TlsModel};
 
 use std::collections::{BTreeMap, BTreeSet};
-use std::iter::FromIterator;
 use std::num::NonZeroUsize;
 use std::path::{Path, PathBuf};
 
index 3fbabbc6344a7f3518b10e11b1869bb78d9fd948..50d6d5b9bab91a0bc08807c708ad7f02858d2842 100644 (file)
@@ -34,7 +34,6 @@
 use self::LiteralKind::*;
 use self::TokenKind::*;
 use crate::cursor::EOF_CHAR;
-use std::convert::TryFrom;
 
 /// Parsed token.
 /// It doesn't contain information about data that has been parsed,
index 297b509d4023d40138c47233316a38c2e41270e6..8446da6098ee9641764fa423412368ebbbd524c4 100644 (file)
@@ -16,7 +16,6 @@
 use rustc_target::abi::{Integer, TagEncoding, Variants};
 use rustc_target::spec::abi::Abi as SpecAbi;
 
-use std::cmp;
 use std::iter;
 use std::ops::ControlFlow;
 
@@ -531,7 +530,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx hir::Expr<'tcx>) {
             _ => {}
         };
 
-        fn is_valid<T: cmp::PartialOrd>(binop: hir::BinOp, v: T, min: T, max: T) -> bool {
+        fn is_valid<T: PartialOrd>(binop: hir::BinOp, v: T, min: T, max: T) -> bool {
             match binop.node {
                 hir::BinOpKind::Lt => v > min && v <= max,
                 hir::BinOpKind::Le => v >= min && v < max,
index 29fe6110797e3885947169dcbdccaa83432479b7..716655c7f144d7de62e0d5c1bc64ee9a703c5b55 100644 (file)
@@ -7,7 +7,6 @@
 use rustc_serialize::opaque::FileEncoder;
 use rustc_serialize::Encoder as _;
 use rustc_span::hygiene::MacroKind;
-use std::convert::TryInto;
 use std::marker::PhantomData;
 use std::num::NonZeroUsize;
 
index efa9464529e71ca14473852c3b6abb4cffdb04db..0b55757eb038298d32ee3598e9a07fe5732e0d15 100644 (file)
@@ -3,7 +3,6 @@
 use rustc_macros::HashStable;
 use rustc_span::Symbol;
 
-use std::cmp::Ord;
 use std::fmt::{self, Debug, Formatter};
 
 rustc_index::newtype_index! {
index d79cd8b7a8a4b075c4bfdcc30a5379141d6bc385..8fe349d9640dafd776814d0feb5f9b8175a7e92f 100644 (file)
@@ -95,7 +95,6 @@ macro_rules! throw_machine_stop {
 mod queries;
 mod value;
 
-use std::convert::TryFrom;
 use std::fmt;
 use std::io;
 use std::io::{Read, Write};
index 9c270ba1ec179939e18834ca0f773c9efbea4836..b0830991076206930b030985cdab10732d551744 100644 (file)
@@ -3,7 +3,6 @@
 use rustc_macros::HashStable;
 use rustc_target::abi::{HasDataLayout, Size};
 
-use std::convert::{TryFrom, TryInto};
 use std::fmt;
 
 ////////////////////////////////////////////////////////////////////////////////
index e6636e50e6e7ab0a1acf50e90cf57ed963c70c6a..88fb14eb359424e468ac55f953092fbc18cae2ee 100644 (file)
@@ -1,4 +1,3 @@
-use std::convert::{TryFrom, TryInto};
 use std::fmt;
 
 use either::{Either, Left, Right};
index a513444e1e08bd91b8f98fe9c428e1406554ffc2..db4fe6f886b2549044777dd6f0e7b399fc0c3bfc 100644 (file)
@@ -36,7 +36,6 @@
 use either::Either;
 
 use std::borrow::Cow;
-use std::convert::TryInto;
 use std::fmt::{self, Debug, Display, Formatter, Write};
 use std::ops::{ControlFlow, Index, IndexMut};
 use std::{iter, mem};
index fb152b63f63448675059b251cbd6191681df48fa..d40d7de5f315fc3a18194348caf84fe05baeb8c4 100644 (file)
@@ -12,7 +12,6 @@
 use crate::ty::{self, Ty, TyCtxt};
 use rustc_hir::def_id::DefId;
 use rustc_span::source_map::Span;
-use std::iter::FromIterator;
 
 pub mod type_op {
     use crate::ty::fold::TypeFoldable;
index f3186e1c30c3dc4b4229f8501ac5e91d33131edd..2a8a4d598882d0c0cd1b83abed69dd574fdc866d 100644 (file)
@@ -2,7 +2,6 @@
 use rustc_apfloat::Float;
 use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
 use rustc_target::abi::Size;
-use std::convert::{TryFrom, TryInto};
 use std::fmt;
 use std::num::NonZeroU8;
 
index becc2b805dd1ee9ffb3ca9c50eb6b346e697a996..d9721863a58c801fa49c21594cfc26309a2dc47d 100644 (file)
@@ -1,5 +1,3 @@
-use std::convert::TryInto;
-
 use super::Const;
 use crate::mir;
 use crate::mir::interpret::{AllocId, ConstValue, Scalar};
index 5303341ba443c6c285fc170b96aa81535641b3ad..01e96fa5c7ade50d8ffe3df700378abde35c9fbc 100644 (file)
@@ -23,7 +23,6 @@
 use std::cell::Cell;
 use std::char;
 use std::collections::BTreeMap;
-use std::convert::TryFrom;
 use std::fmt::{self, Write as _};
 use std::iter;
 use std::ops::{ControlFlow, Deref, DerefMut};
index 6eae94511e4d63c05f1a508da14027ac07cf0399..802925dfb043e3eafb4f70304a50cf359f0cb78b 100644 (file)
@@ -1,4 +1,3 @@
-use std::convert::TryFrom;
 use std::fmt;
 
 use crate::mir::interpret::{alloc_range, AllocId, Allocation, Pointer, Scalar};
index 691cbee2c731911acf2997bea4754b5d54c9ee16..ba6bc41c6675cdaa28463b34e4c443cc2b4a00cd 100644 (file)
@@ -30,7 +30,6 @@
 mod util;
 
 use std::borrow::Borrow;
-use std::convert::TryFrom;
 use std::mem;
 
 impl<'a, 'tcx> Builder<'a, 'tcx> {
index bd435f9ab0095a4b86e10703a3127c31bbd068b5..cbd494862a01f09ee0debdb8d4bd0eacae39f3d9 100644 (file)
@@ -7,7 +7,6 @@
 use rustc_middle::ty;
 use rustc_middle::ty::TypeVisitable;
 use smallvec::SmallVec;
-use std::convert::TryInto;
 
 impl<'a, 'tcx> Builder<'a, 'tcx> {
     pub(crate) fn field_match_pairs<'pat>(
index d60e8722cb61d5c443e20ef22d8c061d100781e0..18e9c69c4870e3b8796c5b01e1e2b73c3c6c0d18 100644 (file)
@@ -45,7 +45,7 @@
 use std::cell::Cell;
 use std::cmp::{self, max, min, Ordering};
 use std::fmt;
-use std::iter::{once, IntoIterator};
+use std::iter::once;
 use std::ops::RangeInclusive;
 
 use smallvec::{smallvec, SmallVec};
index f0e75c53ea15c93e9fa6c7fcd46843c25a191f26..8fdac7b2cf501e1540a526392a1cde97c7397216 100644 (file)
@@ -26,7 +26,7 @@
 //! ## `PartialOrd`
 //!
 //! Given that they represent partially ordered sets, you may be surprised that [`JoinSemiLattice`]
-//! and [`MeetSemiLattice`] do not have [`PartialOrd`][std::cmp::PartialOrd] as a supertrait. This
+//! and [`MeetSemiLattice`] do not have [`PartialOrd`] as a supertrait. This
 //! is because most standard library types use lexicographic ordering instead of set inclusion for
 //! their `PartialOrd` impl. Since we do not actually need to compare lattice elements to run a
 //! dataflow analysis, there's no need for a newtype wrapper with a custom `PartialOrd` impl. The
index 475e2ec9a1dea713881123d96bc84a941bb95272..8212a7b523bbc98d5d1e4d8d76e57864432d61df 100644 (file)
@@ -35,7 +35,6 @@
 use rustc_middle::mir::*;
 use rustc_middle::ty::TyCtxt;
 use smallvec::SmallVec;
-use std::convert::TryInto;
 
 pub struct SimplifyCfg {
     label: String,
index 650076c2213a35f1231e6c1bbb72b01f5ed902df..703ed09a254a96899d2019a1d29afba864a4bb97 100644 (file)
@@ -20,7 +20,6 @@
     Const, Ty, TyCtxt,
 };
 use rustc_span::symbol::sym;
-use std::convert::TryInto;
 use std::ops::ControlFlow;
 
 use crate::errors::UnusedGenericParams;
index c7d239b647f35b2bc273fdc0185a5cf224f13ac9..686454a8f18117f1323fa6dcea384719770e604f 100644 (file)
@@ -6,7 +6,6 @@
 use rustc_ast::token::{self, Delimiter, Nonterminal};
 use rustc_errors::{error_code, fluent, Diagnostic, IntoDiagnostic, PResult};
 use rustc_span::{sym, BytePos, Span};
-use std::convert::TryInto;
 
 // Public for rustfmt usage
 #[derive(Debug)]
index a084a7010885927344a3e24e834cd27e03e00fcb..b97f22417cb7bdcc82482abf2a6314d4ff664c03 100644 (file)
@@ -8,7 +8,6 @@
 use rustc_session::parse::ParseSess;
 use rustc_span::{sym, Span, DUMMY_SP};
 
-use std::convert::TryInto;
 use std::ops::Range;
 
 /// A wrapper type to ensure that the parser handles outer attributes correctly.
index 03f25392a7c1f90094ccf4fb2ce067a598f8210b..7ebcda249e23ae5fd9862a445c5753dd40931d4b 100644 (file)
@@ -21,7 +21,6 @@
 use rustc_span::source_map::{self, Span};
 use rustc_span::symbol::{kw, sym, Ident, Symbol};
 use rustc_span::DUMMY_SP;
-use std::convert::TryFrom;
 use std::mem;
 use thin_vec::ThinVec;
 use tracing::debug;
index 38c7c6cce67650680b967749481eee26dcbd1b9a..0e7d628c1eb630c030946079bfaa9259a3785c01 100644 (file)
@@ -46,7 +46,7 @@ impl DepNodeIndex {
     pub const FOREVER_RED_NODE: DepNodeIndex = DepNodeIndex::from_u32(1);
 }
 
-impl std::convert::From<DepNodeIndex> for QueryInvocationId {
+impl From<DepNodeIndex> for QueryInvocationId {
     #[inline]
     fn from(dep_node_index: DepNodeIndex) -> Self {
         QueryInvocationId(dep_node_index.as_u32())
index 3b20ec70d73cb3d5dc45a48f893af8ced9e07149..d292f4beef2ebccc33f0bebfa0894a7d756e5a1a 100644 (file)
@@ -22,7 +22,6 @@
 use rustc_serialize::opaque::{FileEncodeResult, FileEncoder, IntEncodedWithFixedSize, MemDecoder};
 use rustc_serialize::{Decodable, Decoder, Encodable};
 use smallvec::SmallVec;
-use std::convert::TryInto;
 
 // The maximum value of `SerializedDepNodeIndex` leaves the upper two bits
 // unused so that we can store multiple index types in `CompressedHybridIndex`,
index 4c4680b5d8ea89b7d241e548a0e386da06e998df..f65846fc77f6e5114bfd384ce37c013c61e10e62 100644 (file)
@@ -9,7 +9,6 @@
 use rustc_data_structures::sync::Lock;
 use rustc_data_structures::sync::WorkerLocal;
 use rustc_index::vec::{Idx, IndexVec};
-use std::default::Default;
 use std::fmt::Debug;
 use std::hash::Hash;
 use std::marker::PhantomData;
index 49bbcf57804596623ed30642d0d837d5ba1ca8af..701bbde6ad23f92d89169ce3aa3e3c7bc278685c 100644 (file)
@@ -22,8 +22,8 @@
     rustc_data_structures::{jobserver, OnDrop},
     rustc_rayon_core as rayon_core,
     rustc_span::DUMMY_SP,
-    std::iter::{self, FromIterator},
-    std::{mem, process},
+    std::iter,
+    std::process,
 };
 
 /// Represents a span and a query key.
@@ -247,7 +247,7 @@ fn wait_on_inner(&self, waiter: &Lrc<QueryWaiter>) {
             jobserver::release_thread();
             waiter.condvar.wait(&mut info);
             // Release the lock before we potentially block in `acquire_thread`
-            mem::drop(info);
+            drop(info);
             jobserver::acquire_thread();
         }
     }
index 7735c571310dd2c4e3018026b956d08e23334754..6c310abf10ac537f78b66ef160e7acd5466eb19a 100644 (file)
@@ -36,7 +36,6 @@
 use rustc_span::*;
 
 use std::cell::Cell;
-use std::default::Default;
 use std::env;
 use std::fs::File;
 use std::io::BufWriter;
index 0afeb86fceb241611867c67ee4820f4e810507ac..0e0ebc79eb2e3dfdb7c65855491987d8724ee200 100644 (file)
@@ -1,6 +1,5 @@
 use crate::leb128::{self, largest_max_leb128_len};
 use crate::serialize::{Decodable, Decoder, Encodable, Encoder};
-use std::convert::TryInto;
 use std::fs::File;
 use std::io::{self, Write};
 use std::mem::MaybeUninit;
index 7a20100fd313368ebe24f86e539789af442ed514..6de564a3a069225ebee1f06be5418c9de0e1cac1 100644 (file)
@@ -32,7 +32,7 @@
 use std::collections::{BTreeMap, BTreeSet};
 use std::fmt;
 use std::hash::Hash;
-use std::iter::{self, FromIterator};
+use std::iter;
 use std::path::{Path, PathBuf};
 use std::str::{self, FromStr};
 
index 1b66773be6f0804a02627989199547c8c6616769..1855a49c1ecdf36b331a92e362feaa3f54eec1d5 100644 (file)
@@ -3,7 +3,6 @@
 use smallvec::{smallvec, SmallVec};
 use std::env;
 use std::fs;
-use std::iter::FromIterator;
 use std::path::{Path, PathBuf};
 
 use crate::search_paths::{PathKind, SearchPath};
index 2ae57d9e56d7c5ce3ec0ff45c06bb8986fe231c2..43a3172270733ffebdc86005de630265f1b206a3 100644 (file)
 use rustc_data_structures::fx::FxHashMap;
 use rustc_data_structures::stable_hasher::StableHasher;
 use rustc_data_structures::sync::{AtomicU32, Lrc, MappedReadGuard, ReadGuard, RwLock};
+use std::cmp;
 use std::hash::Hash;
 use std::path::{Path, PathBuf};
 use std::sync::atomic::Ordering;
-use std::{clone::Clone, cmp};
-use std::{convert::TryFrom, unreachable};
 
 use std::fs;
 use std::io;
index 1fcf8c7a8bf13f06543603c5a9d1ff120861c01a..d0fe598ce086e89cbec966c1924baef30de064a7 100644 (file)
@@ -9,7 +9,6 @@
 use rustc_macros::HashStable_Generic;
 use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
 
-use std::cmp::{Ord, PartialEq, PartialOrd};
 use std::fmt;
 use std::hash::{Hash, Hasher};
 use std::str;
@@ -1974,7 +1973,6 @@ pub mod kw {
 /// For example `sym::rustfmt` or `sym::u8`.
 pub mod sym {
     use super::Symbol;
-    use std::convert::TryInto;
 
     #[doc(inline)]
     pub use super::sym_generated::*;
index b69a0a645a415913909e0dd127bff1485cfbb770..dc2cc23ffb1e40c61448af0651d18615c59eb8c9 100644 (file)
@@ -18,7 +18,6 @@
 #![deny(rustc::untranslatable_diagnostic)]
 #![deny(rustc::diagnostic_outside_of_impl)]
 
-use std::iter::FromIterator;
 use std::path::{Path, PathBuf};
 
 #[macro_use]
index 1db1d7e85adcc5fde9d05b5d4f354e13b225f718..be994eda14c004aecca3d9e0c7e3e5bf7d8f5eb0 100644 (file)
@@ -45,9 +45,7 @@
 use serde_json::Value;
 use std::borrow::Cow;
 use std::collections::BTreeMap;
-use std::convert::TryFrom;
 use std::hash::{Hash, Hasher};
-use std::iter::FromIterator;
 use std::ops::{Deref, DerefMut};
 use std::path::{Path, PathBuf};
 use std::str::FromStr;
index 3ed616d709b1edf4e1b38933c8002417eea0fb67..9aa2be124e294871f24d11a82d2d168755d5fc00 100644 (file)
@@ -1,6 +1,6 @@
 #![allow(rustc::usage_of_ty_tykind)]
 
-use std::cmp::{Eq, Ord, Ordering, PartialEq, PartialOrd};
+use std::cmp::Ordering;
 use std::{fmt, hash};
 
 use crate::DebruijnIndex;