Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_attr_parsing/src/attributes/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use rustc_hir::{

use super::prelude::*;
use super::util::parse_version;
use crate::session_diagnostics::{self};
use crate::session_diagnostics;

macro_rules! reject_outside_std {
($cx: ident) => {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_attr_parsing/src/session_diagnostics.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::num::IntErrorKind;

use rustc_ast::{self as ast};
use rustc_ast as ast;
use rustc_errors::codes::*;
use rustc_errors::{
Applicability, Diag, DiagArgValue, DiagCtxtHandle, Diagnostic, EmissionGuarantee, Level,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/cmdline_attrs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Attributes injected into the crate root from command line using `-Z crate-attr`.
use rustc_ast::{self as ast};
use rustc_ast as ast;
use rustc_errors::Diag;
use rustc_parse::parser::attr::InnerAttrPolicy;
use rustc_parse::{parse_in, source_str_to_stream};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ use crate::debuginfo::metadata::{
size_and_align_of, type_di_node, unknown_file_metadata, visibility_di_flags,
};
use crate::debuginfo::utils::DIB;
use crate::llvm;
use crate::llvm::debuginfo::{DIFile, DIFlags, DIType};
use crate::llvm::{self};

// The names of the associated constants in each variant wrapper struct.
// These have to match up with the names being used in `intrinsic.natvis`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ use crate::debuginfo::metadata::{
file_metadata_from_def_id, type_di_node, unknown_file_metadata,
};
use crate::debuginfo::utils::{DIB, create_DIArray, get_namespace_for_item};
use crate::llvm;
use crate::llvm::debuginfo::{DIFlags, DIType};
use crate::llvm::{self};

mod cpp_like;
mod native;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ use rustc_abi::{Size, TagEncoding, VariantIdx, Variants};
use rustc_codegen_ssa::debuginfo::type_names::compute_debuginfo_type_name;
use rustc_codegen_ssa::debuginfo::{tag_base_type, wants_c_like_enum_debuginfo};
use rustc_codegen_ssa::traits::{ConstCodegenMethods, MiscCodegenMethods};
use rustc_middle::bug;
use rustc_middle::ty::layout::{LayoutOf, TyAndLayout};
use rustc_middle::ty::{self};
use rustc_middle::{bug, ty};
use smallvec::smallvec;

use crate::common::{AsCCharPtr, CodegenCx};
Expand All @@ -18,8 +17,8 @@ use crate::debuginfo::metadata::{
unknown_file_metadata, visibility_di_flags,
};
use crate::debuginfo::utils::{DIB, create_DIArray, get_namespace_for_item};
use crate::llvm;
use crate::llvm::debuginfo::{DIFile, DIFlags, DIType};
use crate::llvm::{self};

/// Build the debuginfo node for an enum type. The listing below shows how such a
/// type looks like at the LLVM IR/DWARF level. It is a `DW_TAG_structure_type`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use rustc_middle::ty::{self, ExistentialTraitRef, Ty, TyCtxt};
use super::{DefinitionLocation, SmallVec, UNKNOWN_LINE_NUMBER, unknown_file_metadata};
use crate::common::CodegenCx;
use crate::debuginfo::utils::{DIB, create_DIArray, debug_context};
use crate::llvm;
use crate::llvm::debuginfo::{DIFlags, DIScope, DIType};
use crate::llvm::{self};

mod private {
use rustc_macros::HashStable;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue};
use rustc_codegen_ssa::mir::place::{PlaceRef, PlaceValue};
use rustc_codegen_ssa::traits::*;
use rustc_data_structures::assert_matches;
use rustc_hir as hir;
use rustc_hir::def_id::LOCAL_CRATE;
use rustc_hir::{self as hir};
use rustc_middle::mir::BinOp;
use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt, HasTypingEnv, LayoutOf};
use rustc_middle::ty::offload_meta::OffloadMetadata;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/fallback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::cell::OnceCell;
use std::ops::ControlFlow;

use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::graph;
use rustc_data_structures::graph::vec_graph::VecGraph;
use rustc_data_structures::graph::{self};
use rustc_data_structures::unord::{UnordMap, UnordSet};
use rustc_hir as hir;
use rustc_hir::HirId;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ use rustc_span::source_map::Spanned;
use rustc_span::{DUMMY_SP, Ident, InnerSpan, Span, Symbol, kw, sym};
use rustc_target::asm::InlineAsmArch;
use rustc_trait_selection::infer::{InferCtxtExt, TyCtxtInferExt};
use rustc_trait_selection::traits;
use rustc_trait_selection::traits::misc::type_allowed_to_implement_copy;
use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt as _;
use rustc_trait_selection::traits::{self};

use crate::errors::BuiltinEllipsisInclusiveRangePatterns;
use crate::lints::{
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/map_unit_fn.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use rustc_hir::{Expr, ExprKind, Stmt, StmtKind};
use rustc_middle::ty::{self};
use rustc_middle::ty;
use rustc_session::{declare_lint, declare_lint_pass};
use rustc_span::sym;

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/reference_casting.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use rustc_ast::Mutability;
use rustc_hir::{Expr, ExprKind, UnOp};
use rustc_middle::ty;
use rustc_middle::ty::layout::{LayoutOf as _, TyAndLayout};
use rustc_middle::ty::{self};
use rustc_session::{declare_lint, declare_lint_pass};
use rustc_span::sym;

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/transmute.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use rustc_ast::LitKind;
use rustc_errors::Applicability;
use rustc_hir as hir;
use rustc_hir::def::{DefKind, Res};
use rustc_hir::def_id::LocalDefId;
use rustc_hir::{self as hir};
use rustc_macros::Diagnostic;
use rustc_middle::ty::{self, Ty};
use rustc_session::{declare_lint, impl_lint_pass};
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/unqualified_local_imports.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use rustc_hir::{self as hir};
use rustc_hir as hir;
use rustc_session::{declare_lint, declare_lint_pass};
use rustc_span::kw;

Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_middle/src/ty/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ use crate::arena::ArenaAllocatable;
use crate::infer::canonical::{CanonicalVarKind, CanonicalVarKinds};
use crate::mir::interpret::{AllocId, ConstAllocation, CtfeProvenance};
use crate::mir::mono::MonoItem;
use crate::mir::{self};
use crate::traits;
use crate::ty::{self, AdtDef, GenericArgsRef, Ty, TyCtxt};
use crate::{mir, traits};

/// The shorthand encoding uses an enum's variant index `usize`
/// and is offset by this value so it never matches a real variant.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/context/impl_interner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ use std::fmt;
use rustc_abi::ExternAbi;
use rustc_data_structures::debug_assert_matches;
use rustc_errors::ErrorGuaranteed;
use rustc_hir as hir;
use rustc_hir::def::{CtorKind, CtorOf, DefKind};
use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_hir::lang_items::LangItem;
use rustc_hir::{self as hir};
use rustc_span::{DUMMY_SP, Span, Symbol};
use rustc_type_ir::lang_items::{SolverAdtLangItem, SolverLangItem, SolverTraitLangItem};
use rustc_type_ir::{CollectAndApply, Interner, TypeFoldable, search_graph};
Expand Down
4 changes: 1 addition & 3 deletions compiler/rustc_middle/src/ty/pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ use std::fmt;
use rustc_data_structures::intern::Interned;
use rustc_macros::HashStable;
use rustc_type_ir::ir_print::IrPrint;
use rustc_type_ir::{
FlagComputation, Flags, {self as ir},
};
use rustc_type_ir::{self as ir, FlagComputation, Flags};

use super::TyCtxt;
use crate::ty;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_build/src/builder/expr/as_constant.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! See docs in builder/expr/mod.rs
use rustc_abi::Size;
use rustc_ast::{self as ast};
use rustc_ast as ast;
use rustc_hir::LangItem;
use rustc_middle::mir::interpret::{CTFE_ALLOC_SALT, Scalar};
use rustc_middle::mir::*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ use rustc_middle::ty::{self, TyCtxt};
use rustc_mir_dataflow::impls::MaybeInitializedPlaces;
use rustc_mir_dataflow::move_paths::{LookupResult, MoveData, MovePathIndex};
use rustc_mir_dataflow::{Analysis, MaybeReachable, ResultsCursor};
use rustc_session::lint;
use rustc_session::lint::builtin::TAIL_EXPR_DROP_ORDER;
use rustc_session::lint::{self};
use rustc_span::{DUMMY_SP, Span, Symbol};
use tracing::debug;

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_parse/src/parser/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ use std::fmt::Write;
use std::mem;

use ast::token::IdentIsRaw;
use rustc_ast as ast;
use rustc_ast::ast::*;
use rustc_ast::token::{self, Delimiter, InvisibleOrigin, MetaVarKind, TokenKind};
use rustc_ast::tokenstream::{DelimSpan, TokenStream, TokenTree};
use rustc_ast::util::case::Case;
use rustc_ast::{self as ast};
use rustc_ast_pretty::pprust;
use rustc_errors::codes::*;
use rustc_errors::{Applicability, PResult, StashKey, msg, struct_span_code_err};
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_resolve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

use std::cell::Ref;
use std::collections::BTreeSet;
use std::fmt::{self};
use std::fmt;
use std::ops::ControlFlow;
use std::sync::Arc;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ use std::{cmp, fmt, iter};
use rustc_abi::ExternAbi;
use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
use rustc_errors::{Applicability, Diag, DiagStyledString, IntoDiagArg, StringPart, pluralize};
use rustc_hir as hir;
use rustc_hir::def::DefKind;
use rustc_hir::def_id::DefId;
use rustc_hir::intravisit::Visitor;
use rustc_hir::lang_items::LangItem;
use rustc_hir::{self as hir};
use rustc_infer::infer::DefineOpaqueTypes;
use rustc_macros::extension;
use rustc_middle::bug;
Expand Down
3 changes: 1 addition & 2 deletions library/alloc/src/vec/drain.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use core::fmt;
use core::iter::{FusedIterator, TrustedLen};
use core::mem::{self, ManuallyDrop, SizedTypeProperties};
use core::ptr::{self, NonNull};
use core::slice::{self};
use core::{fmt, slice};

use super::Vec;
use crate::alloc::{Allocator, Global};
Expand Down
3 changes: 1 addition & 2 deletions library/alloc/src/vec/into_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ use core::num::NonZero;
use core::ops::Deref;
use core::panic::UnwindSafe;
use core::ptr::{self, NonNull};
use core::slice::{self};
use core::{array, fmt};
use core::{array, fmt, slice};

#[cfg(not(no_global_oom_handling))]
use super::AsVecIntoIter;
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/vec/spec_extend.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use core::clone::TrivialClone;
use core::iter::TrustedLen;
use core::slice::{self};
use core::slice;

use super::{IntoIter, Vec};
use crate::alloc::Allocator;
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/vec/spec_from_iter.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use core::mem::ManuallyDrop;
use core::ptr::{self};
use core::ptr;

use super::{IntoIter, SpecExtend, SpecFromIterNested, Vec};

Expand Down
3 changes: 1 addition & 2 deletions library/alloc/src/vec/splice.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use core::ptr::{self};
use core::slice::{self};
use core::{ptr, slice};

use super::{Drain, Vec};
use crate::alloc::{Allocator, Global};
Expand Down
2 changes: 1 addition & 1 deletion library/coretests/tests/cmp.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use core::cmp;
use core::cmp::Ordering::{self, *};
use core::cmp::{self};

#[test]
fn test_int_totalord() {
Expand Down
2 changes: 1 addition & 1 deletion library/coretests/tests/iter/adapters/array_chunks.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use core::iter::{self};
use core::iter;

use super::*;

Expand Down
2 changes: 1 addition & 1 deletion library/test/src/formatters/junit.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::io;
use std::io::prelude::Write;
use std::io::{self};
use std::time::Duration;

use super::OutputFormatter;
Expand Down
2 changes: 1 addition & 1 deletion library/test/src/term.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#![deny(missing_docs)]

use std::io;
use std::io::prelude::*;
use std::io::{self};

pub(crate) use terminfo::TerminfoTerminal;
#[cfg(windows)]
Expand Down
3 changes: 1 addition & 2 deletions src/librustdoc/html/render/type_layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ use std::fmt;
use askama::Template;
use rustc_abi::{Primitive, TagEncoding, Variants};
use rustc_hir::def_id::DefId;
use rustc_middle::span_bug;
use rustc_middle::ty::layout::LayoutError;
use rustc_middle::ty::{self};
use rustc_middle::{span_bug, ty};
use rustc_span::symbol::Symbol;

use crate::html::render::Context;
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/scrape_examples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use std::path::PathBuf;

use rustc_data_structures::fx::FxIndexMap;
use rustc_errors::DiagCtxtHandle;
use rustc_hir as hir;
use rustc_hir::intravisit::{self, Visitor};
use rustc_hir::{self as hir};
use rustc_macros::{Decodable, Encodable};
use rustc_middle::hir::nested_filter;
use rustc_middle::ty::{self, TyCtxt};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use clippy_utils::res::{MaybeDef, MaybeTypeckRes};
use rustc_ast::LitKind;
use rustc_hir::{Expr, ExprKind};
use rustc_lint::LateContext;
use rustc_middle::ty::{self};
use rustc_middle::ty;

use super::ITER_OUT_OF_BOUNDS;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rustc_errors::Applicability;
use rustc_hir::def::Res;
use rustc_hir::{BinOpKind, Body, Expr, ExprKind, HirId, QPath};
use rustc_lint::LateContext;
use rustc_middle::ty::{self};
use rustc_middle::ty;
use rustc_span::source_map::Spanned;

use super::MANUAL_CONTAINS;
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_lints/src/types/linked_list.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use clippy_utils::diagnostics::span_lint_and_help;
use clippy_utils::sym;
use rustc_hir::def_id::DefId;
use rustc_hir::{self as hir};
use rustc_hir as hir;
use rustc_lint::LateContext;

use super::LINKEDLIST;
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_lints/src/types/owned_cow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use clippy_utils::source::snippet_opt;
use clippy_utils::sym;
use rustc_errors::Applicability;
use rustc_hir::def_id::DefId;
use rustc_hir::{self as hir};
use rustc_hir as hir;
use rustc_lint::LateContext;
use rustc_span::Span;

Expand Down
3 changes: 1 addition & 2 deletions src/tools/lld-wrapper/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
//! On Windows it spawns a `..\rust-lld.exe` child process.

use std::env::consts::EXE_SUFFIX;
use std::env::{self};
use std::fmt::Display;
use std::path::{Path, PathBuf};
use std::process;
use std::{env, process};

trait UnwrapOrExitWith<T> {
fn unwrap_or_exit_with(self, context: &str) -> T;
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/crates/base-db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub use crate::{
},
};
use dashmap::{DashMap, mapref::entry::Entry};
pub use query_group::{self};
pub use query_group;
use rustc_hash::{FxHashSet, FxHasher};
use salsa::{Durability, Setter};
pub use semver::{BuildMetadata, Prerelease, Version, VersionReq};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use cfg::CfgExpr;
use either::Either;
use intern::{
Symbol,
sym::{self},
sym,
};
use itertools::Itertools;
use mbe::{DelimiterKind, expect_fragment};
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/crates/hir-ty/src/lower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use rustc_hash::FxHashSet;
use rustc_type_ir::{
AliasTyKind, BoundVarIndexKind, ConstKind, DebruijnIndex, ExistentialPredicate,
ExistentialProjection, ExistentialTraitRef, FnSig, Interner, OutlivesPredicate, TermKind,
TyKind::{self},
TyKind,
TypeFoldable, TypeVisitableExt, Upcast, UpcastFrom, elaborate,
inherent::{Clause as _, GenericArgs as _, IntoKind as _, Region as _, Ty as _},
};
Expand Down
Loading
Loading