Skip to content

Commit f34356e

Browse files
committed
Auto merge of rust-lang#105554 - matthiaskrgr:rollup-ir60gc7, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - rust-lang#105411 (Introduce `with_forced_trimmed_paths`) - rust-lang#105532 (Document behaviour of `--remap-path-prefix` with several matches) - rust-lang#105537 (compiler: remove unnecessary imports and qualified paths) - rust-lang#105539 (rustdoc: Only hide lines starting with `#` in rust code blocks ) - rust-lang#105546 (Add some regression tests for rust-lang#44454) - rust-lang#105547 (Add regression test for rust-lang#104582) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents b3ddfeb + 49027db commit f34356e

File tree

126 files changed

+438
-220
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+438
-220
lines changed

compiler/rustc_abi/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![cfg_attr(feature = "nightly", feature(step_trait, rustc_attrs, min_specialization))]
22

3-
use std::convert::{TryFrom, TryInto};
43
use std::fmt;
54
#[cfg(feature = "nightly")]
65
use std::iter::Step;

compiler/rustc_apfloat/src/ieee.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use crate::{Category, ExpInt, IEK_INF, IEK_NAN, IEK_ZERO};
22
use crate::{Float, FloatConvert, ParseError, Round, Status, StatusAnd};
33

44
use core::cmp::{self, Ordering};
5-
use core::convert::TryFrom;
65
use core::fmt::{self, Write};
76
use core::marker::PhantomData;
87
use core::mem;

compiler/rustc_arena/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use smallvec::SmallVec;
2828
use std::alloc::Layout;
2929
use std::cell::{Cell, RefCell};
3030
use std::cmp;
31-
use std::marker::{PhantomData, Send};
31+
use std::marker::PhantomData;
3232
use std::mem::{self, MaybeUninit};
3333
use std::ptr::{self, NonNull};
3434
use std::slice;

compiler/rustc_ast/src/ast.rs

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
3333
use rustc_span::source_map::{respan, Spanned};
3434
use rustc_span::symbol::{kw, sym, Ident, Symbol};
3535
use rustc_span::{Span, DUMMY_SP};
36-
use std::convert::TryFrom;
3736
use std::fmt;
3837
use std::mem;
3938
use thin_vec::{thin_vec, ThinVec};

compiler/rustc_ast/src/ptr.rs

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
//! Moreover, a switch to, e.g., `P<'a, T>` would be easy and mostly automated.
2323
2424
use std::fmt::{self, Debug, Display};
25-
use std::iter::FromIterator;
2625
use std::ops::{Deref, DerefMut};
2726
use std::{slice, vec};
2827

compiler/rustc_ast/src/tokenstream.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ impl TokenStream {
362362
}
363363
}
364364

365-
impl iter::FromIterator<TokenTree> for TokenStream {
365+
impl FromIterator<TokenTree> for TokenStream {
366366
fn from_iter<I: IntoIterator<Item = TokenTree>>(iter: I) -> Self {
367367
TokenStream::new(iter.into_iter().collect::<Vec<TokenTree>>())
368368
}

compiler/rustc_ast_lowering/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,8 @@ pub fn lower_to_hir<'hir>(tcx: TyCtxt<'hir>, (): ()) -> hir::Crate<'hir> {
456456
}
457457

458458
// Drop AST to free memory
459-
std::mem::drop(ast_index);
460-
sess.time("drop_ast", || std::mem::drop(krate));
459+
drop(ast_index);
460+
sess.time("drop_ast", || drop(krate));
461461

462462
// Discard hygiene data, which isn't required after lowering to HIR.
463463
if !sess.opts.unstable_opts.keep_hygiene_data {

compiler/rustc_builtin_macros/src/concat.rs

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ use rustc_expand::base::{self, DummyResult};
44
use rustc_session::errors::report_lit_error;
55
use rustc_span::symbol::Symbol;
66

7-
use std::string::String;
8-
97
pub fn expand_concat(
108
cx: &mut base::ExtCtxt<'_>,
119
sp: rustc_span::Span,

compiler/rustc_codegen_ssa/src/base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ use rustc_span::{DebuggerVisualizerFile, DebuggerVisualizerType};
4141
use rustc_target::abi::{Align, Size, VariantIdx};
4242

4343
use std::collections::BTreeSet;
44-
use std::convert::TryFrom;
4544
use std::time::{Duration, Instant};
4645

4746
use itertools::Itertools;

compiler/rustc_const_eval/src/const_eval/eval_queries.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use std::borrow::Cow;
2-
use std::convert::TryInto;
32

43
use either::{Left, Right};
54

compiler/rustc_const_eval/src/interpret/cast.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use std::assert_matches::assert_matches;
2-
use std::convert::TryFrom;
32

43
use rustc_apfloat::ieee::{Double, Single};
54
use rustc_apfloat::{Float, FloatConvert};

compiler/rustc_const_eval/src/interpret/intrinsics.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
//! looking at their MIR. Intrinsics/functions supported here are shared by CTFE
33
//! and miri.
44
5-
use std::convert::TryFrom;
6-
75
use rustc_hir::def_id::DefId;
86
use rustc_middle::mir::{
97
self,

compiler/rustc_const_eval/src/interpret/intrinsics/caller_location.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::convert::TryFrom;
2-
31
use rustc_ast::Mutability;
42
use rustc_hir::lang_items::LangItem;
53
use rustc_middle::mir::TerminatorKind;

compiler/rustc_const_eval/src/interpret/operator.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::convert::TryFrom;
2-
31
use rustc_apfloat::Float;
42
use rustc_middle::mir;
53
use rustc_middle::mir::interpret::{InterpResult, Scalar};

compiler/rustc_const_eval/src/interpret/util.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use rustc_middle::mir::interpret::InterpResult;
22
use rustc_middle::ty::{self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitor};
3-
use std::convert::TryInto;
43
use std::ops::ControlFlow;
54

65
/// Checks whether a type contains generic parameters which require substitution.

compiler/rustc_const_eval/src/interpret/validity.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
//! That's useful because it means other passes (e.g. promotion) can rely on `const`s
55
//! to be const-safe.
66
7-
use std::convert::TryFrom;
87
use std::fmt::{Display, Write};
98
use std::num::NonZeroUsize;
109

compiler/rustc_const_eval/src/util/aggregate.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use rustc_middle::mir::*;
33
use rustc_middle::ty::{Ty, TyCtxt};
44
use rustc_target::abi::VariantIdx;
55

6-
use std::convert::TryFrom;
76
use std::iter::TrustedLen;
87

98
/// Expand `lhs = Rvalue::Aggregate(kind, operands)` into assignments to the fields.

compiler/rustc_data_structures/src/fingerprint.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use crate::stable_hasher;
22
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
3-
use std::convert::TryInto;
43
use std::hash::{Hash, Hasher};
54

65
#[cfg(test)]

compiler/rustc_data_structures/src/graph/scc/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use crate::fx::FxHashSet;
99
use crate::graph::vec_graph::VecGraph;
1010
use crate::graph::{DirectedGraph, GraphSuccessors, WithNumEdges, WithNumNodes, WithSuccessors};
1111
use rustc_index::vec::{Idx, IndexVec};
12-
use std::cmp::Ord;
1312
use std::ops::Range;
1413

1514
#[cfg(test)]

compiler/rustc_data_structures/src/graph/vec_graph/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::cmp::Ord;
2-
31
use crate::graph::{DirectedGraph, GraphSuccessors, WithNumEdges, WithNumNodes, WithSuccessors};
42
use rustc_index::vec::{Idx, IndexVec};
53

compiler/rustc_data_structures/src/owning_ref/mod.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -867,11 +867,9 @@ where
867867
/////////////////////////////////////////////////////////////////////////////
868868

869869
use std::borrow::Borrow;
870-
use std::cmp::{Eq, Ord, Ordering, PartialEq, PartialOrd};
871-
use std::convert::From;
870+
use std::cmp::Ordering;
872871
use std::fmt::{self, Debug};
873872
use std::hash::{Hash, Hasher};
874-
use std::marker::{Send, Sync};
875873

876874
impl<O, T: ?Sized> Deref for OwningRef<O, T> {
877875
type Target = T;
@@ -1096,7 +1094,6 @@ where
10961094
// std types integration and convenience type defs
10971095
/////////////////////////////////////////////////////////////////////////////
10981096

1099-
use std::boxed::Box;
11001097
use std::cell::{Ref, RefCell, RefMut};
11011098
use std::rc::Rc;
11021099
use std::sync::Arc;

compiler/rustc_data_structures/src/owning_ref/tests.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
mod owning_ref {
44
use super::super::OwningRef;
55
use super::super::{BoxRef, Erased, ErasedBoxRef, RcRef};
6-
use std::cmp::{Ord, Ordering, PartialEq, PartialOrd};
6+
use std::cmp::Ordering;
77
use std::collections::hash_map::DefaultHasher;
88
use std::collections::HashMap;
99
use std::hash::{Hash, Hasher};
@@ -368,7 +368,7 @@ mod owning_handle {
368368
mod owning_ref_mut {
369369
use super::super::BoxRef;
370370
use super::super::{BoxRefMut, Erased, ErasedBoxRefMut, OwningRefMut};
371-
use std::cmp::{Ord, Ordering, PartialEq, PartialOrd};
371+
use std::cmp::Ordering;
372372
use std::collections::hash_map::DefaultHasher;
373373
use std::collections::HashMap;
374374
use std::hash::{Hash, Hasher};

compiler/rustc_data_structures/src/profiling.rs

-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ use crate::fx::FxHashMap;
8686

8787
use std::borrow::Borrow;
8888
use std::collections::hash_map::Entry;
89-
use std::convert::Into;
9089
use std::error::Error;
9190
use std::fs;
9291
use std::path::Path;

compiler/rustc_data_structures/src/sorted_map.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::stable_hasher::{HashStable, StableHasher, StableOrd};
22
use std::borrow::Borrow;
33
use std::cmp::Ordering;
4-
use std::iter::FromIterator;
54
use std::mem;
65
use std::ops::{Bound, Index, IndexMut, RangeBounds};
76

compiler/rustc_data_structures/src/sorted_map/index_map.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! A variant of `SortedMap` that preserves insertion order.
22
33
use std::hash::{Hash, Hasher};
4-
use std::iter::FromIterator;
54

65
use crate::stable_hasher::{HashStable, StableHasher};
76
use rustc_index::vec::{Idx, IndexVec};

compiler/rustc_data_structures/src/sso/either_iter.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
use std::fmt;
2-
use std::iter::ExactSizeIterator;
32
use std::iter::FusedIterator;
4-
use std::iter::Iterator;
53

64
/// Iterator which may contain instance of
75
/// one of two specific implementations.

compiler/rustc_data_structures/src/sso/map.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use crate::fx::FxHashMap;
33
use arrayvec::ArrayVec;
44
use std::fmt;
55
use std::hash::Hash;
6-
use std::iter::FromIterator;
76
use std::ops::Index;
87

98
// For pointer-sized arguments arrays

compiler/rustc_data_structures/src/sso/set.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use std::fmt;
22
use std::hash::Hash;
3-
use std::iter::FromIterator;
43

54
use super::map::SsoHashMap;
65

compiler/rustc_data_structures/src/sync.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ cfg_if! {
138138
}
139139
}
140140

141-
pub use std::iter::Iterator as ParallelIterator;
141+
pub use Iterator as ParallelIterator;
142142

143143
pub fn par_iter<T: IntoIterator>(t: T) -> T::IntoIter {
144144
t.into_iter()

compiler/rustc_data_structures/src/tagged_ptr/drop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ where
7676
fn drop(&mut self) {
7777
// No need to drop the tag, as it's Copy
7878
unsafe {
79-
std::mem::drop(P::from_usize(self.raw.pointer_raw()));
79+
drop(P::from_usize(self.raw.pointer_raw()));
8080
}
8181
}
8282
}

compiler/rustc_data_structures/src/vec_map.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use std::borrow::Borrow;
22
use std::fmt::Debug;
3-
use std::iter::FromIterator;
43
use std::slice::Iter;
54
use std::vec::IntoIter;
65

compiler/rustc_driver/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ use rustc_target::json::ToJson;
4545

4646
use std::borrow::Cow;
4747
use std::cmp::max;
48-
use std::default::Default;
4948
use std::env;
5049
use std::ffi::OsString;
5150
use std::fs;

compiler/rustc_error_codes/src/error_codes/E0492.md

-1

compiler/rustc_errors/src/diagnostic_impls.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ into_diagnostic_arg_using_display!(
5959
i128,
6060
u128,
6161
std::io::Error,
62-
std::boxed::Box<dyn std::error::Error>,
62+
Box<dyn std::error::Error>,
6363
std::num::NonZeroU32,
6464
hir::Target,
6565
Edition,

compiler/rustc_expand/src/base.rs

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ use rustc_span::symbol::{kw, sym, Ident, Symbol};
3434
use rustc_span::{BytePos, FileName, RealFileName, Span, DUMMY_SP};
3535
use smallvec::{smallvec, SmallVec};
3636

37-
use std::default::Default;
3837
use std::iter;
3938
use std::path::PathBuf;
4039
use std::rc::Rc;

compiler/rustc_hir/src/pat_util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rustc_span::hygiene::DesugaringKind;
66
use rustc_span::symbol::Ident;
77
use rustc_span::Span;
88

9-
use std::iter::{Enumerate, ExactSizeIterator};
9+
use std::iter::Enumerate;
1010

1111
pub struct EnumerateAndAdjust<I> {
1212
enumerate: Enumerate<I>,

compiler/rustc_hir_analysis/src/check/wfcheck.rs

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ use rustc_trait_selection::traits::{
3131
};
3232

3333
use std::cell::LazyCell;
34-
use std::convert::TryInto;
3534
use std::iter;
3635
use std::ops::{ControlFlow, Deref};
3736

compiler/rustc_incremental/src/persist/dirty_clean.rs

-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ use rustc_middle::hir::nested_filter;
3030
use rustc_middle::ty::TyCtxt;
3131
use rustc_span::symbol::{sym, Symbol};
3232
use rustc_span::Span;
33-
use std::iter::FromIterator;
34-
use std::vec::Vec;
3533

3634
const LOADED_FROM_DISK: Symbol = sym::loaded_from_disk;
3735
const EXCEPT: Symbol = sym::except;

compiler/rustc_incremental/src/persist/fs.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ use rustc_span::Symbol;
113113

114114
use std::fs as std_fs;
115115
use std::io::{self, ErrorKind};
116-
use std::mem;
117116
use std::path::{Path, PathBuf};
118117
use std::time::{Duration, SystemTime, UNIX_EPOCH};
119118

@@ -305,7 +304,7 @@ pub fn prepare_session_directory(
305304
}
306305

307306
delete_session_dir_lock_file(sess, &lock_file_path);
308-
mem::drop(directory_lock);
307+
drop(directory_lock);
309308
}
310309
}
311310
}
@@ -864,7 +863,7 @@ pub fn garbage_collect_session_directories(sess: &Session) -> io::Result<()> {
864863

865864
// Let's make it explicit that the file lock is released at this point,
866865
// or rather, that we held on to it until here
867-
mem::drop(lock);
866+
drop(lock);
868867
}
869868
Err(_) => {
870869
debug!(
@@ -898,7 +897,7 @@ pub fn garbage_collect_session_directories(sess: &Session) -> io::Result<()> {
898897

899898
// Let's make it explicit that the file lock is released at this point,
900899
// or rather, that we held on to it until here
901-
mem::drop(lock);
900+
drop(lock);
902901
}
903902

904903
Ok(())

compiler/rustc_index/src/vec.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
44
use std::fmt;
55
use std::fmt::Debug;
66
use std::hash::Hash;
7-
use std::iter::FromIterator;
87
use std::marker::PhantomData;
98
use std::ops::{Index, IndexMut, RangeBounds};
109
use std::slice;

compiler/rustc_interface/src/tests.rs

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use rustc_target::spec::{CodeModel, LinkerFlavorCli, MergeFunctions, PanicStrate
2525
use rustc_target::spec::{RelroLevel, SanitizerSet, SplitDebuginfo, StackProtector, TlsModel};
2626

2727
use std::collections::{BTreeMap, BTreeSet};
28-
use std::iter::FromIterator;
2928
use std::num::NonZeroUsize;
3029
use std::path::{Path, PathBuf};
3130

compiler/rustc_lexer/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ pub use crate::cursor::Cursor;
3434
use self::LiteralKind::*;
3535
use self::TokenKind::*;
3636
use crate::cursor::EOF_CHAR;
37-
use std::convert::TryFrom;
3837

3938
/// Parsed token.
4039
/// It doesn't contain information about data that has been parsed,

compiler/rustc_lint/src/types.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use rustc_target::abi::{Abi, Size, WrappingRange};
1616
use rustc_target::abi::{Integer, TagEncoding, Variants};
1717
use rustc_target::spec::abi::Abi as SpecAbi;
1818

19-
use std::cmp;
2019
use std::iter;
2120
use std::ops::ControlFlow;
2221

@@ -531,7 +530,7 @@ impl<'tcx> LateLintPass<'tcx> for TypeLimits {
531530
_ => {}
532531
};
533532

534-
fn is_valid<T: cmp::PartialOrd>(binop: hir::BinOp, v: T, min: T, max: T) -> bool {
533+
fn is_valid<T: PartialOrd>(binop: hir::BinOp, v: T, min: T, max: T) -> bool {
535534
match binop.node {
536535
hir::BinOpKind::Lt => v > min && v <= max,
537536
hir::BinOpKind::Le => v >= min && v < max,

0 commit comments

Comments
 (0)