Skip to content

Commit 27c50a0

Browse files
committed
Remove all no longer necessary uses of fmt::Write.
1 parent df0a459 commit 27c50a0

File tree

28 files changed

+8
-96
lines changed

28 files changed

+8
-96
lines changed

compiler/rustc_ast/src/ast.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2003,7 +2003,6 @@ impl fmt::Display for InlineAsmTemplatePiece {
20032003
impl InlineAsmTemplatePiece {
20042004
/// Rebuilds the asm template string from its pieces.
20052005
pub fn to_string(s: &[Self]) -> String {
2006-
use fmt::Write;
20072006
let mut out = String::new();
20082007
for p in s.iter() {
20092008
let _ = write!(out, "{}", p);

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use rustc_span::source_map::{respan, DesugaringKind, Span, Spanned};
1414
use rustc_span::symbol::{sym, Ident, Symbol};
1515
use rustc_target::asm;
1616
use std::collections::hash_map::Entry;
17-
use std::fmt::Write;
1817

1918
impl<'hir> LoweringContext<'_, 'hir> {
2019
fn lower_exprs(&mut self, exprs: &[AstP<Expr>]) -> &'hir [hir::Expr<'hir>] {

compiler/rustc_builtin_macros/src/format_foreign.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ pub mod printf {
7171
/// Returns `None` in cases where the `printf` directive does not have an exact Rust
7272
/// equivalent, rather than guessing.
7373
pub fn translate(&self) -> Option<String> {
74-
use std::fmt::Write;
75-
7674
let (c_alt, c_zero, c_left, c_plus) = {
7775
let mut c_alt = false;
7876
let mut c_zero = false;
@@ -245,7 +243,6 @@ pub mod printf {
245243
}
246244

247245
fn translate(&self, s: &mut String) -> std::fmt::Result {
248-
use std::fmt::Write;
249246
match *self {
250247
Num::Num(n) => write!(s, "{}", n),
251248
Num::Arg(n) => {

compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ use tracing::debug;
4545

4646
use libc::{c_longlong, c_uint};
4747
use std::collections::hash_map::Entry;
48-
use std::fmt::{self, Write};
48+
use std::fmt;
4949
use std::hash::{Hash, Hasher};
5050
use std::iter;
5151
use std::path::{Path, PathBuf};

compiler/rustc_codegen_llvm/src/type_of.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ use rustc_target::abi::{Int, Pointer, F32, F64};
1111
use rustc_target::abi::{LayoutOf, PointeeInfo, Scalar, Size, TyAndLayoutMethods, Variants};
1212
use tracing::debug;
1313

14-
use std::fmt::Write;
15-
1614
fn uncached_llvm_type<'a, 'tcx>(
1715
cx: &CodegenCx<'a, 'tcx>,
1816
layout: TyAndLayout<'tcx>,

compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ use rustc_hir as hir;
55
use rustc_hir::def_id::DefId;
66
use rustc_middle::ty::{self, subst::SubstsRef, Ty, TyCtxt};
77

8-
use std::fmt::Write;
9-
108
// Compute the name of the type as it should be stored in debuginfo. Does not do
119
// any caching, i.e., calling the function twice with the same type will also do
1210
// the work twice. The `qualified` parameter only affects the first level of the

compiler/rustc_infer/src/infer/error_reporting/nice_region_error/placeholder_error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_middle::ty::print::{FmtPrinter, Print, RegionHighlightMode};
1111
use rustc_middle::ty::subst::SubstsRef;
1212
use rustc_middle::ty::{self, TyCtxt};
1313

14-
use std::fmt::{self, Write};
14+
use std::fmt;
1515

1616
impl NiceRegionError<'me, 'tcx> {
1717
/// When given a `ConcreteFailure` for a function with arguments containing a named region and

compiler/rustc_lint/src/builtin.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ use rustc_trait_selection::traits::misc::can_type_implement_copy;
5454

5555
use crate::nonstandard_style::{method_context, MethodLateContext};
5656

57-
use std::fmt::Write;
5857
use tracing::{debug, trace};
5958

6059
// hardwired lints from librustc_middle

compiler/rustc_middle/src/mir/mono.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,6 @@ impl CodegenUnitNameBuilder<'tcx> {
453453
C: fmt::Display,
454454
S: fmt::Display,
455455
{
456-
use std::fmt::Write;
457-
458456
let mut cgu_name = String::with_capacity(64);
459457

460458
// Start out with the crate name and disambiguator

compiler/rustc_mir/src/interpret/validity.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//! to be const-safe.
66
77
use std::convert::TryFrom;
8-
use std::fmt::Write;
98
use std::num::NonZeroUsize;
109
use std::ops::RangeInclusive;
1110

0 commit comments

Comments
 (0)