Skip to content

Commit e1e93c4

Browse files
committed
Auto merge of rust-lang#12981 - kadiwa4:remove_some_imports, r=Veykril
Remove imports that are also in edition 2021's prelude small cleanup
2 parents 554f7f8 + 232176b commit e1e93c4

File tree

18 files changed

+15
-27
lines changed

18 files changed

+15
-27
lines changed

crates/base-db/src/input.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//! actual IO. See `vfs` and `project_model` in the `rust-analyzer` crate for how
77
//! actual IO is done and lowered to input.
88
9-
use std::{fmt, iter::FromIterator, ops, panic::RefUnwindSafe, str::FromStr, sync::Arc};
9+
use std::{fmt, ops, panic::RefUnwindSafe, str::FromStr, sync::Arc};
1010

1111
use cfg::CfgOptions;
1212
use rustc_hash::{FxHashMap, FxHashSet};

crates/hir-ty/src/consteval.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
33
use std::{
44
collections::HashMap,
5-
convert::TryInto,
65
fmt::{Display, Write},
76
};
87

crates/ide-db/src/search.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! get a super-set of matches. Then, we we confirm each match using precise
55
//! name resolution.
66
7-
use std::{convert::TryInto, mem, sync::Arc};
7+
use std::{mem, sync::Arc};
88

99
use base_db::{FileId, FileRange, SourceDatabase, SourceDatabaseExt};
1010
use hir::{DefWithBody, HasAttrs, HasSource, InFile, ModuleSource, Semantics, Visibility};

crates/ide/src/goto_definition.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{convert::TryInto, mem::discriminant};
1+
use std::mem::discriminant;
22

33
use crate::{doc_links::token_as_doc_comment, FilePosition, NavigationTarget, RangeInfo, TryToNav};
44
use hir::{AsAssocItem, AssocItem, Semantics};

crates/ide/src/status.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{fmt, iter::FromIterator, sync::Arc};
1+
use std::{fmt, sync::Arc};
22

33
use hir::{ExpandResult, MacroFile};
44
use ide_db::base_db::{

crates/proc-macro-api/src/msg/flat.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@
3535
//! as we don't have bincode in Cargo.toml yet, lets stick with serde_json for
3636
//! the time being.
3737
38-
use std::{
39-
collections::{HashMap, VecDeque},
40-
convert::TryInto,
41-
};
38+
use std::collections::{HashMap, VecDeque};
4239

4340
use serde::{Deserialize, Serialize};
4441
use tt::TokenId;

crates/proc-macro-srv/src/abis/abi_1_58/proc_macro/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,15 @@ impl From<TokenTree> for TokenStream {
157157
}
158158

159159
/// Collects a number of token trees into a single stream.
160-
impl iter::FromIterator<TokenTree> for TokenStream {
160+
impl FromIterator<TokenTree> for TokenStream {
161161
fn from_iter<I: IntoIterator<Item = TokenTree>>(trees: I) -> Self {
162162
trees.into_iter().map(TokenStream::from).collect()
163163
}
164164
}
165165

166166
/// A "flattening" operation on token streams, collects token trees
167167
/// from multiple token streams into a single stream.
168-
impl iter::FromIterator<TokenStream> for TokenStream {
168+
impl FromIterator<TokenStream> for TokenStream {
169169
fn from_iter<I: IntoIterator<Item = TokenStream>>(streams: I) -> Self {
170170
let mut builder = bridge::client::TokenStreamBuilder::new();
171171
streams.into_iter().for_each(|stream| builder.push(stream.0));

crates/proc-macro-srv/src/abis/abi_1_58/ra_server.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use super::proc_macro::bridge::{self, server};
1212

1313
use std::collections::HashMap;
1414
use std::hash::Hash;
15-
use std::iter::FromIterator;
1615
use std::ops::Bound;
1716
use std::{ascii, vec::IntoIter};
1817

crates/proc-macro-srv/src/abis/abi_1_63/proc_macro/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,15 @@ impl ConcatStreamsHelper {
207207
}
208208

209209
/// Collects a number of token trees into a single stream.
210-
impl iter::FromIterator<TokenTree> for TokenStream {
210+
impl FromIterator<TokenTree> for TokenStream {
211211
fn from_iter<I: IntoIterator<Item = TokenTree>>(trees: I) -> Self {
212212
trees.into_iter().map(TokenStream::from).collect()
213213
}
214214
}
215215

216216
/// A "flattening" operation on token streams, collects token trees
217217
/// from multiple token streams into a single stream.
218-
impl iter::FromIterator<TokenStream> for TokenStream {
218+
impl FromIterator<TokenStream> for TokenStream {
219219
fn from_iter<I: IntoIterator<Item = TokenStream>>(streams: I) -> Self {
220220
let iter = streams.into_iter();
221221
let mut builder = ConcatStreamsHelper::new(iter.size_hint().0);

crates/proc-macro-srv/src/abis/abi_1_63/ra_server.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use super::proc_macro::bridge::{self, server};
1212

1313
use std::collections::HashMap;
1414
use std::hash::Hash;
15-
use std::iter::FromIterator;
1615
use std::ops::Bound;
1716
use std::{ascii, vec::IntoIter};
1817

crates/proc-macro-srv/src/abis/abi_1_64/proc_macro/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,15 @@ impl ConcatStreamsHelper {
207207
}
208208

209209
/// Collects a number of token trees into a single stream.
210-
impl iter::FromIterator<TokenTree> for TokenStream {
210+
impl FromIterator<TokenTree> for TokenStream {
211211
fn from_iter<I: IntoIterator<Item = TokenTree>>(trees: I) -> Self {
212212
trees.into_iter().map(TokenStream::from).collect()
213213
}
214214
}
215215

216216
/// A "flattening" operation on token streams, collects token trees
217217
/// from multiple token streams into a single stream.
218-
impl iter::FromIterator<TokenStream> for TokenStream {
218+
impl FromIterator<TokenStream> for TokenStream {
219219
fn from_iter<I: IntoIterator<Item = TokenStream>>(streams: I) -> Self {
220220
let iter = streams.into_iter();
221221
let mut builder = ConcatStreamsHelper::new(iter.size_hint().0);

crates/proc-macro-srv/src/abis/abi_1_64/ra_server.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use super::proc_macro::bridge::{self, server};
1212

1313
use std::collections::HashMap;
1414
use std::hash::Hash;
15-
use std::iter::FromIterator;
1615
use std::ops::Bound;
1716
use std::{ascii, vec::IntoIter};
1817

crates/proc-macro-srv/src/abis/abi_sysroot/ra_server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use token_stream::TokenStreamBuilder;
2020
mod symbol;
2121
pub use symbol::*;
2222

23-
use std::{iter::FromIterator, ops::Bound};
23+
use std::ops::Bound;
2424

2525
type Group = tt::Subtree;
2626
type TokenTree = tt::TokenTree;

crates/proc-macro-srv/src/dylib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! Handles dynamic library loading for proc macro
22
33
use std::{
4-
convert::TryInto,
54
fmt,
65
fs::File,
76
io,

crates/rust-analyzer/src/diagnostics/to_proto.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ fn clippy_code_description(code: Option<&str>) -> Option<lsp_types::CodeDescript
512512
#[cfg(test)]
513513
#[cfg(not(windows))]
514514
mod tests {
515-
use std::{convert::TryInto, path::Path};
515+
use std::path::Path;
516516

517517
use crate::{config::Config, global_state::GlobalState};
518518

crates/rust-analyzer/src/to_proto.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,7 @@ fn main() {
13861386
#[test]
13871387
#[cfg(target_os = "windows")]
13881388
fn test_lowercase_drive_letter() {
1389-
use std::{convert::TryInto, path::Path};
1389+
use std::path::Path;
13901390

13911391
let url = url_from_abs_path(Path::new("C:\\Test").try_into().unwrap());
13921392
assert_eq!(url.to_string(), "file:///c:/Test");

crates/syntax/src/fuzz.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
//!
33
//! We don't normally run fuzzying, so this is hopelessly bitrotten :(
44
5-
use std::{
6-
convert::TryInto,
7-
str::{self, FromStr},
8-
};
5+
use std::str::{self, FromStr};
96

107
use text_edit::Indel;
118

lib/la-arena/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use std::{
77
fmt,
88
hash::{Hash, Hasher},
9-
iter::FromIterator,
109
marker::PhantomData,
1110
ops::{Index, IndexMut, Range, RangeInclusive},
1211
};

0 commit comments

Comments
 (0)