From 37d1ce91b5d81c9a7239eb33e17e3d73f7f81aea Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 30 Aug 2024 13:16:08 +1000 Subject: [PATCH 1/3] Remove `#[macro_use] extern crate tracing` from rustdoc. --- src/librustdoc/clean/auto_trait.rs | 1 + src/librustdoc/clean/blanket_impl.rs | 1 + src/librustdoc/clean/inline.rs | 1 + src/librustdoc/clean/mod.rs | 1 + src/librustdoc/clean/types.rs | 1 + src/librustdoc/clean/utils.rs | 1 + src/librustdoc/core.rs | 1 + src/librustdoc/doctest.rs | 1 + src/librustdoc/doctest/make.rs | 1 + src/librustdoc/formats/cache.rs | 1 + src/librustdoc/formats/renderer.rs | 1 + src/librustdoc/html/format.rs | 1 + src/librustdoc/html/markdown.rs | 1 + src/librustdoc/html/render/context.rs | 1 + src/librustdoc/html/render/mod.rs | 1 + src/librustdoc/html/render/print_item.rs | 1 + src/librustdoc/html/render/search_index.rs | 1 + src/librustdoc/html/render/sidebar.rs | 1 + src/librustdoc/html/sources.rs | 1 + src/librustdoc/json/mod.rs | 1 + src/librustdoc/lib.rs | 3 +-- src/librustdoc/passes/calculate_doc_coverage.rs | 1 + src/librustdoc/passes/check_doc_test_visibility.rs | 1 + src/librustdoc/passes/collect_intra_doc_links.rs | 1 + src/librustdoc/passes/collect_trait_impls.rs | 1 + src/librustdoc/passes/lint/bare_urls.rs | 1 + src/librustdoc/passes/strip_hidden.rs | 1 + src/librustdoc/passes/stripper.rs | 1 + src/librustdoc/scrape_examples.rs | 1 + src/librustdoc/visit_ast.rs | 1 + 30 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/clean/auto_trait.rs b/src/librustdoc/clean/auto_trait.rs index f46ffea830e..467f349ef9a 100644 --- a/src/librustdoc/clean/auto_trait.rs +++ b/src/librustdoc/clean/auto_trait.rs @@ -7,6 +7,7 @@ use rustc_span::def_id::DefId; use rustc_span::symbol::{kw, Symbol}; use rustc_trait_selection::traits::auto_trait::{self, RegionTarget}; use thin_vec::ThinVec; +use tracing::{debug, instrument}; use crate::clean::{ self, clean_generic_param_def, clean_middle_ty, clean_predicate, diff --git a/src/librustdoc/clean/blanket_impl.rs b/src/librustdoc/clean/blanket_impl.rs index 48c3fb65203..0729a2af875 100644 --- a/src/librustdoc/clean/blanket_impl.rs +++ b/src/librustdoc/clean/blanket_impl.rs @@ -6,6 +6,7 @@ use rustc_span::def_id::DefId; use rustc_span::DUMMY_SP; use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt; use thin_vec::ThinVec; +use tracing::{debug, instrument, trace}; use crate::clean; use crate::clean::{ diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index f8953f0ebcf..4e4a45b6cfb 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -14,6 +14,7 @@ use rustc_span::def_id::LOCAL_CRATE; use rustc_span::hygiene::MacroKind; use rustc_span::symbol::{sym, Symbol}; use thin_vec::{thin_vec, ThinVec}; +use tracing::{debug, trace}; use {rustc_ast as ast, rustc_hir as hir}; use super::Item; diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 5260e363dd6..58ef900127e 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -52,6 +52,7 @@ use rustc_span::symbol::{kw, sym, Ident, Symbol}; use rustc_span::ExpnKind; use rustc_trait_selection::traits::wf::object_region_bounds; use thin_vec::ThinVec; +use tracing::{debug, instrument}; use utils::*; use {rustc_ast as ast, rustc_attr as attr, rustc_hir as hir}; diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 63d71a73cdf..4b5d3c802e6 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -31,6 +31,7 @@ use rustc_span::{FileName, Loc, DUMMY_SP}; use rustc_target::abi::VariantIdx; use rustc_target::spec::abi::Abi; use thin_vec::ThinVec; +use tracing::{debug, trace}; use {rustc_ast as ast, rustc_hir as hir}; pub(crate) use self::ItemKind::*; diff --git a/src/librustdoc/clean/utils.rs b/src/librustdoc/clean/utils.rs index 68266f3506a..caa448cd4b3 100644 --- a/src/librustdoc/clean/utils.rs +++ b/src/librustdoc/clean/utils.rs @@ -11,6 +11,7 @@ use rustc_middle::mir; use rustc_middle::ty::{self, GenericArgKind, GenericArgsRef, TyCtxt, TypeVisitableExt}; use rustc_span::symbol::{kw, sym, Symbol}; use thin_vec::{thin_vec, ThinVec}; +use tracing::{debug, warn}; use {rustc_ast as ast, rustc_hir as hir}; use crate::clean::auto_trait::synthesize_auto_trait_impls; diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index 08a4a3f3fb2..bcb4c3a8b70 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -25,6 +25,7 @@ pub(crate) use rustc_session::config::{Options, UnstableOptions}; use rustc_session::{lint, Session}; use rustc_span::symbol::sym; use rustc_span::{source_map, Span}; +use tracing::{debug, info}; use crate::clean::inline::build_external_trait; use crate::clean::{self, ItemId}; diff --git a/src/librustdoc/doctest.rs b/src/librustdoc/doctest.rs index 743c1ed507e..74f8cf1ecf5 100644 --- a/src/librustdoc/doctest.rs +++ b/src/librustdoc/doctest.rs @@ -26,6 +26,7 @@ use rustc_span::symbol::sym; use rustc_span::FileName; use rustc_target::spec::{Target, TargetTriple}; use tempfile::{Builder as TempFileBuilder, TempDir}; +use tracing::debug; use self::rust::HirCollector; use crate::config::Options as RustdocOptions; diff --git a/src/librustdoc/doctest/make.rs b/src/librustdoc/doctest/make.rs index aed079e5887..47a4c2fe0b5 100644 --- a/src/librustdoc/doctest/make.rs +++ b/src/librustdoc/doctest/make.rs @@ -14,6 +14,7 @@ use rustc_span::edition::Edition; use rustc_span::source_map::SourceMap; use rustc_span::symbol::sym; use rustc_span::FileName; +use tracing::debug; use super::GlobalTestOptions; use crate::html::markdown::LangString; diff --git a/src/librustdoc/formats/cache.rs b/src/librustdoc/formats/cache.rs index 947bae99305..a1cb59b5679 100644 --- a/src/librustdoc/formats/cache.rs +++ b/src/librustdoc/formats/cache.rs @@ -4,6 +4,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexSet}; use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, DefIdSet}; use rustc_middle::ty::{self, TyCtxt}; use rustc_span::Symbol; +use tracing::debug; use crate::clean::types::ExternalLocation; use crate::clean::{self, ExternalCrate, ItemId, PrimitiveType}; diff --git a/src/librustdoc/formats/renderer.rs b/src/librustdoc/formats/renderer.rs index 2535668b83f..cc57dca86c3 100644 --- a/src/librustdoc/formats/renderer.rs +++ b/src/librustdoc/formats/renderer.rs @@ -1,4 +1,5 @@ use rustc_middle::ty::TyCtxt; +use tracing::debug; use crate::clean; use crate::config::RenderOptions; diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 5cbf8c5e19f..bd19a2ec367 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -24,6 +24,7 @@ use rustc_middle::ty::TyCtxt; use rustc_span::symbol::kw; use rustc_span::{sym, Symbol}; use rustc_target::spec::abi::Abi; +use tracing::{debug, trace}; use {rustc_ast as ast, rustc_hir as hir}; use super::url_parts_builder::{estimate_item_path_byte_length, UrlPartsBuilder}; diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs index 364d4e077b1..e37c24c1438 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -46,6 +46,7 @@ pub(crate) use rustc_resolve::rustdoc::main_body_opts; use rustc_resolve::rustdoc::may_be_doc_link; use rustc_span::edition::Edition; use rustc_span::{Span, Symbol}; +use tracing::{debug, trace}; use crate::clean::RenderedLink; use crate::doctest; diff --git a/src/librustdoc/html/render/context.rs b/src/librustdoc/html/render/context.rs index 0ed8921b1e8..19386fe5e69 100644 --- a/src/librustdoc/html/render/context.rs +++ b/src/librustdoc/html/render/context.rs @@ -12,6 +12,7 @@ use rustc_middle::ty::TyCtxt; use rustc_session::Session; use rustc_span::edition::Edition; use rustc_span::{sym, FileName, Symbol}; +use tracing::info; use super::print_item::{full_path, item_path, print_item}; use super::sidebar::{print_sidebar, sidebar_module_like, Sidebar}; diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index 47f321a4c4a..fc4033f8320 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -57,6 +57,7 @@ use rustc_span::symbol::{sym, Symbol}; use rustc_span::{BytePos, FileName, RealFileName, DUMMY_SP}; use serde::ser::SerializeMap; use serde::{Serialize, Serializer}; +use tracing::{debug, info}; pub(crate) use self::context::*; pub(crate) use self::span_map::{collect_spans_and_sources, LinkFromSrc}; diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index d8b111471b8..a0a72d59d12 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -15,6 +15,7 @@ use rustc_middle::ty::{self, TyCtxt}; use rustc_span::hygiene::MacroKind; use rustc_span::symbol::{kw, sym, Symbol}; use rustc_target::abi::VariantIdx; +use tracing::{debug, info}; use super::type_layout::document_type_layout; use super::{ diff --git a/src/librustdoc/html/render/search_index.rs b/src/librustdoc/html/render/search_index.rs index d7682bd1c19..bfdf457c529 100644 --- a/src/librustdoc/html/render/search_index.rs +++ b/src/librustdoc/html/render/search_index.rs @@ -11,6 +11,7 @@ use rustc_span::sym; use rustc_span::symbol::{kw, Symbol}; use serde::ser::{Serialize, SerializeSeq, SerializeStruct, Serializer}; use thin_vec::ThinVec; +use tracing::instrument; use crate::clean; use crate::clean::types::{Function, Generics, ItemId, Type, WherePredicate}; diff --git a/src/librustdoc/html/render/sidebar.rs b/src/librustdoc/html/render/sidebar.rs index 101cc839f09..5b9c93ef74a 100644 --- a/src/librustdoc/html/render/sidebar.rs +++ b/src/librustdoc/html/render/sidebar.rs @@ -6,6 +6,7 @@ use rustc_data_structures::fx::FxHashSet; use rustc_hir::def::CtorKind; use rustc_hir::def_id::DefIdSet; use rustc_middle::ty::{self, TyCtxt}; +use tracing::debug; use super::{item_ty_to_section, Context, ItemSection}; use crate::clean; diff --git a/src/librustdoc/html/sources.rs b/src/librustdoc/html/sources.rs index 22f115f92cc..ae65dd76b5f 100644 --- a/src/librustdoc/html/sources.rs +++ b/src/librustdoc/html/sources.rs @@ -11,6 +11,7 @@ use rustc_hir::def_id::LOCAL_CRATE; use rustc_middle::ty::TyCtxt; use rustc_session::Session; use rustc_span::{sym, FileName}; +use tracing::info; use crate::clean; use crate::clean::utils::has_doc_flag; diff --git a/src/librustdoc/json/mod.rs b/src/librustdoc/json/mod.rs index e2860292aa3..1b2d61a7637 100644 --- a/src/librustdoc/json/mod.rs +++ b/src/librustdoc/json/mod.rs @@ -22,6 +22,7 @@ use rustdoc_json_types as types; // the one from rustc_data_structures, as they're different types due to sysroots. // See #110051 and #127456 for details use rustdoc_json_types::FxHashMap; +use tracing::{debug, trace}; use crate::clean::types::{ExternalCrate, ExternalLocation}; use crate::clean::ItemKind; diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index e651501a184..f25acbe080a 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -22,8 +22,6 @@ #![allow(rustc::untranslatable_diagnostic)] extern crate thin_vec; -#[macro_use] -extern crate tracing; // N.B. these need `extern crate` even in 2018 edition // because they're loaded implicitly from the sysroot. @@ -83,6 +81,7 @@ use rustc_interface::interface; use rustc_middle::ty::TyCtxt; use rustc_session::config::{make_crate_type_option, ErrorOutputType, RustcOptGroup}; use rustc_session::{getopts, EarlyDiagCtxt}; +use tracing::info; use crate::clean::utils::DOC_RUST_LANG_ORG_CHANNEL; diff --git a/src/librustdoc/passes/calculate_doc_coverage.rs b/src/librustdoc/passes/calculate_doc_coverage.rs index d6eef43902c..1d0b41fc429 100644 --- a/src/librustdoc/passes/calculate_doc_coverage.rs +++ b/src/librustdoc/passes/calculate_doc_coverage.rs @@ -9,6 +9,7 @@ use rustc_middle::lint::LintLevelSource; use rustc_session::lint; use rustc_span::FileName; use serde::Serialize; +use tracing::debug; use crate::clean; use crate::core::DocContext; diff --git a/src/librustdoc/passes/check_doc_test_visibility.rs b/src/librustdoc/passes/check_doc_test_visibility.rs index 5015d665955..d456e8e24e6 100644 --- a/src/librustdoc/passes/check_doc_test_visibility.rs +++ b/src/librustdoc/passes/check_doc_test_visibility.rs @@ -8,6 +8,7 @@ use rustc_hir as hir; use rustc_middle::lint::LintLevelSource; use rustc_session::lint; +use tracing::debug; use super::Pass; use crate::clean; diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs index ab03f620230..0090141287e 100644 --- a/src/librustdoc/passes/collect_intra_doc_links.rs +++ b/src/librustdoc/passes/collect_intra_doc_links.rs @@ -27,6 +27,7 @@ use rustc_span::hygiene::MacroKind; use rustc_span::symbol::{sym, Ident, Symbol}; use rustc_span::BytePos; use smallvec::{smallvec, SmallVec}; +use tracing::{debug, info, instrument, trace}; use crate::clean::utils::find_nearest_parent_module; use crate::clean::{self, Crate, Item, ItemLink, PrimitiveType}; diff --git a/src/librustdoc/passes/collect_trait_impls.rs b/src/librustdoc/passes/collect_trait_impls.rs index 1f00891ffa1..394a64df4bc 100644 --- a/src/librustdoc/passes/collect_trait_impls.rs +++ b/src/librustdoc/passes/collect_trait_impls.rs @@ -6,6 +6,7 @@ use rustc_data_structures::fx::FxHashSet; use rustc_hir::def_id::{DefId, DefIdMap, DefIdSet, LOCAL_CRATE}; use rustc_middle::ty; use rustc_span::symbol::sym; +use tracing::debug; use super::Pass; use crate::clean::*; diff --git a/src/librustdoc/passes/lint/bare_urls.rs b/src/librustdoc/passes/lint/bare_urls.rs index a0a369a7b85..22051dd954d 100644 --- a/src/librustdoc/passes/lint/bare_urls.rs +++ b/src/librustdoc/passes/lint/bare_urls.rs @@ -9,6 +9,7 @@ use pulldown_cmark::{Event, Parser, Tag}; use regex::Regex; use rustc_errors::Applicability; use rustc_resolve::rustdoc::source_span_for_markdown_range; +use tracing::trace; use crate::clean::*; use crate::core::DocContext; diff --git a/src/librustdoc/passes/strip_hidden.rs b/src/librustdoc/passes/strip_hidden.rs index 23e298571d5..86f14ddbe85 100644 --- a/src/librustdoc/passes/strip_hidden.rs +++ b/src/librustdoc/passes/strip_hidden.rs @@ -5,6 +5,7 @@ use std::mem; use rustc_hir::def_id::{LocalDefId, CRATE_DEF_ID}; use rustc_middle::ty::TyCtxt; use rustc_span::symbol::sym; +use tracing::debug; use crate::clean; use crate::clean::utils::inherits_doc_hidden; diff --git a/src/librustdoc/passes/stripper.rs b/src/librustdoc/passes/stripper.rs index f807c3362c4..3f706ac951f 100644 --- a/src/librustdoc/passes/stripper.rs +++ b/src/librustdoc/passes/stripper.rs @@ -4,6 +4,7 @@ use std::mem; use rustc_hir::def_id::DefId; use rustc_middle::ty::{TyCtxt, Visibility}; +use tracing::debug; use crate::clean::utils::inherits_doc_hidden; use crate::clean::{self, Item, ItemId, ItemIdSet}; diff --git a/src/librustdoc/scrape_examples.rs b/src/librustdoc/scrape_examples.rs index f001fb26b81..9d4d203562c 100644 --- a/src/librustdoc/scrape_examples.rs +++ b/src/librustdoc/scrape_examples.rs @@ -18,6 +18,7 @@ use rustc_session::getopts; use rustc_span::def_id::{CrateNum, DefPathHash, LOCAL_CRATE}; use rustc_span::edition::Edition; use rustc_span::{BytePos, FileName, SourceFile}; +use tracing::{debug, trace, warn}; use crate::formats::renderer::FormatRenderer; use crate::html::render::Context; diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index d7a4a0d88ac..ba172f86539 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -15,6 +15,7 @@ use rustc_span::def_id::{CRATE_DEF_ID, LOCAL_CRATE}; use rustc_span::hygiene::MacroKind; use rustc_span::symbol::{kw, sym, Symbol}; use rustc_span::Span; +use tracing::debug; use crate::clean::cfg::Cfg; use crate::clean::utils::{inherits_doc_hidden, should_ignore_res}; From de02c4af61f73998bbd01cb05c5d214fc6deb384 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 30 Aug 2024 13:31:05 +1000 Subject: [PATCH 2/3] Remove `#[macro_use] extern crate tracing` from rustfmt helpers. --- src/tools/rustfmt/src/format-diff/main.rs | 4 +--- src/tools/rustfmt/src/git-rustfmt/main.rs | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/tools/rustfmt/src/format-diff/main.rs b/src/tools/rustfmt/src/format-diff/main.rs index f9eb70f6e04..d8616c63df9 100644 --- a/src/tools/rustfmt/src/format-diff/main.rs +++ b/src/tools/rustfmt/src/format-diff/main.rs @@ -4,12 +4,10 @@ #![deny(warnings)] -#[macro_use] -extern crate tracing; - use serde::{Deserialize, Serialize}; use serde_json as json; use thiserror::Error; +use tracing::debug; use tracing_subscriber::EnvFilter; use std::collections::HashSet; diff --git a/src/tools/rustfmt/src/git-rustfmt/main.rs b/src/tools/rustfmt/src/git-rustfmt/main.rs index 5674f40bef9..b8b0432aa95 100644 --- a/src/tools/rustfmt/src/git-rustfmt/main.rs +++ b/src/tools/rustfmt/src/git-rustfmt/main.rs @@ -2,9 +2,6 @@ // `rustc_driver`. #![feature(rustc_private)] -#[macro_use] -extern crate tracing; - use std::env; use std::io::stdout; use std::path::{Path, PathBuf}; @@ -13,6 +10,7 @@ use std::str::FromStr; use getopts::{Matches, Options}; use rustfmt_nightly as rustfmt; +use tracing::debug; use tracing_subscriber::EnvFilter; use crate::rustfmt::{load_config, CliOptions, FormatReportFormatterBuilder, Input, Session}; From ee5ec5a1966d3c77cb64fb9900b472765bf76359 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 30 Aug 2024 13:35:05 +1000 Subject: [PATCH 3/3] Remove `#[macro_use] extern crate tracing` from rustfmt. --- src/tools/rustfmt/src/attr.rs | 1 + src/tools/rustfmt/src/chains.rs | 1 + src/tools/rustfmt/src/closures.rs | 1 + src/tools/rustfmt/src/comment.rs | 1 + src/tools/rustfmt/src/expr.rs | 1 + src/tools/rustfmt/src/formatting.rs | 1 + src/tools/rustfmt/src/items.rs | 1 + src/tools/rustfmt/src/lib.rs | 4 ++-- src/tools/rustfmt/src/macros.rs | 1 + src/tools/rustfmt/src/matches.rs | 1 + src/tools/rustfmt/src/missed_spans.rs | 1 + src/tools/rustfmt/src/modules/visitor.rs | 1 + src/tools/rustfmt/src/overflow.rs | 1 + src/tools/rustfmt/src/test/mod.rs | 1 + src/tools/rustfmt/src/types.rs | 1 + src/tools/rustfmt/src/visitor.rs | 1 + 16 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/tools/rustfmt/src/attr.rs b/src/tools/rustfmt/src/attr.rs index 433b9256202..a2c0a28d66e 100644 --- a/src/tools/rustfmt/src/attr.rs +++ b/src/tools/rustfmt/src/attr.rs @@ -3,6 +3,7 @@ use rustc_ast::ast; use rustc_ast::HasAttrs; use rustc_span::{symbol::sym, Span}; +use tracing::debug; use self::doc_comment::DocCommentFormatter; use crate::comment::{contains_comment, rewrite_doc_comment, CommentStyle}; diff --git a/src/tools/rustfmt/src/chains.rs b/src/tools/rustfmt/src/chains.rs index ea23690caed..96fbe7a963a 100644 --- a/src/tools/rustfmt/src/chains.rs +++ b/src/tools/rustfmt/src/chains.rs @@ -60,6 +60,7 @@ use std::cmp::min; use rustc_ast::{ast, ptr}; use rustc_span::{symbol, BytePos, Span}; +use tracing::debug; use crate::comment::{rewrite_comment, CharClasses, FullCodeCharKind, RichChar}; use crate::config::{IndentStyle, Version}; diff --git a/src/tools/rustfmt/src/closures.rs b/src/tools/rustfmt/src/closures.rs index 5bf29441b54..b5c26235e77 100644 --- a/src/tools/rustfmt/src/closures.rs +++ b/src/tools/rustfmt/src/closures.rs @@ -1,6 +1,7 @@ use rustc_ast::{ast, ptr}; use rustc_span::Span; use thin_vec::thin_vec; +use tracing::debug; use crate::attr::get_attrs_from_stmt; use crate::config::lists::*; diff --git a/src/tools/rustfmt/src/comment.rs b/src/tools/rustfmt/src/comment.rs index 24a5a1be2c3..e76be0fd162 100644 --- a/src/tools/rustfmt/src/comment.rs +++ b/src/tools/rustfmt/src/comment.rs @@ -4,6 +4,7 @@ use std::{borrow::Cow, iter}; use itertools::{multipeek, MultiPeek}; use rustc_span::Span; +use tracing::{debug, trace}; use crate::config::Config; use crate::rewrite::RewriteContext; diff --git a/src/tools/rustfmt/src/expr.rs b/src/tools/rustfmt/src/expr.rs index c7c4b680b07..6ba5217bc92 100644 --- a/src/tools/rustfmt/src/expr.rs +++ b/src/tools/rustfmt/src/expr.rs @@ -5,6 +5,7 @@ use itertools::Itertools; use rustc_ast::token::{Delimiter, Lit, LitKind}; use rustc_ast::{ast, ptr, token, ForLoopKind, MatchKind}; use rustc_span::{BytePos, Span}; +use tracing::debug; use crate::chains::rewrite_chain; use crate::closures; diff --git a/src/tools/rustfmt/src/formatting.rs b/src/tools/rustfmt/src/formatting.rs index 7f442230b12..5e71fe107eb 100644 --- a/src/tools/rustfmt/src/formatting.rs +++ b/src/tools/rustfmt/src/formatting.rs @@ -6,6 +6,7 @@ use std::time::{Duration, Instant}; use rustc_ast::ast; use rustc_span::Span; +use tracing::debug; use self::newline_style::apply_newline_style; use crate::comment::{CharClasses, FullCodeCharKind}; diff --git a/src/tools/rustfmt/src/items.rs b/src/tools/rustfmt/src/items.rs index eb11604b277..cbf7ce90e37 100644 --- a/src/tools/rustfmt/src/items.rs +++ b/src/tools/rustfmt/src/items.rs @@ -7,6 +7,7 @@ use regex::Regex; use rustc_ast::visit; use rustc_ast::{ast, ptr}; use rustc_span::{symbol, BytePos, Span, DUMMY_SP}; +use tracing::debug; use crate::attr::filter_inline_attrs; use crate::comment::{ diff --git a/src/tools/rustfmt/src/lib.rs b/src/tools/rustfmt/src/lib.rs index ff2b14af078..4263a49fd72 100644 --- a/src/tools/rustfmt/src/lib.rs +++ b/src/tools/rustfmt/src/lib.rs @@ -5,8 +5,8 @@ #![allow(clippy::match_like_matches_macro)] #![allow(unreachable_pub)] -#[macro_use] -extern crate tracing; +// #[macro_use] +// extern crate tracing; // N.B. these crates are loaded from the sysroot, so they need extern crate. extern crate rustc_ast; diff --git a/src/tools/rustfmt/src/macros.rs b/src/tools/rustfmt/src/macros.rs index a0582b061c0..b14b74a4938 100644 --- a/src/tools/rustfmt/src/macros.rs +++ b/src/tools/rustfmt/src/macros.rs @@ -20,6 +20,7 @@ use rustc_span::{ symbol::{self, kw}, BytePos, Span, Symbol, DUMMY_SP, }; +use tracing::debug; use crate::comment::{ contains_comment, CharClasses, FindUncommented, FullCodeCharKind, LineClasses, diff --git a/src/tools/rustfmt/src/matches.rs b/src/tools/rustfmt/src/matches.rs index e4fa077073c..30bf6271b2e 100644 --- a/src/tools/rustfmt/src/matches.rs +++ b/src/tools/rustfmt/src/matches.rs @@ -4,6 +4,7 @@ use std::iter::repeat; use rustc_ast::{ast, ptr, MatchKind}; use rustc_span::{BytePos, Span}; +use tracing::debug; use crate::comment::{combine_strs_with_missing_comments, rewrite_comment, FindUncommented}; use crate::config::lists::*; diff --git a/src/tools/rustfmt/src/missed_spans.rs b/src/tools/rustfmt/src/missed_spans.rs index b1a7769c21b..56adb2e5e69 100644 --- a/src/tools/rustfmt/src/missed_spans.rs +++ b/src/tools/rustfmt/src/missed_spans.rs @@ -1,4 +1,5 @@ use rustc_span::{BytePos, Pos, Span}; +use tracing::debug; use crate::comment::{is_last_comment_block, rewrite_comment, CodeCharKind, CommentCodeSlices}; use crate::config::file_lines::FileLines; diff --git a/src/tools/rustfmt/src/modules/visitor.rs b/src/tools/rustfmt/src/modules/visitor.rs index 3e05b6d0c5d..8b46899eaf2 100644 --- a/src/tools/rustfmt/src/modules/visitor.rs +++ b/src/tools/rustfmt/src/modules/visitor.rs @@ -1,6 +1,7 @@ use rustc_ast::ast; use rustc_ast::visit::Visitor; use rustc_span::Symbol; +use tracing::debug; use crate::attr::MetaVisitor; use crate::parse::macros::cfg_if::parse_cfg_if; diff --git a/src/tools/rustfmt/src/overflow.rs b/src/tools/rustfmt/src/overflow.rs index a1de71a35be..cdb735be8a4 100644 --- a/src/tools/rustfmt/src/overflow.rs +++ b/src/tools/rustfmt/src/overflow.rs @@ -6,6 +6,7 @@ use itertools::Itertools; use rustc_ast::token::Delimiter; use rustc_ast::{ast, ptr}; use rustc_span::Span; +use tracing::debug; use crate::closures; use crate::config::Version; diff --git a/src/tools/rustfmt/src/test/mod.rs b/src/tools/rustfmt/src/test/mod.rs index 7c563801c32..286e8b8760a 100644 --- a/src/tools/rustfmt/src/test/mod.rs +++ b/src/tools/rustfmt/src/test/mod.rs @@ -16,6 +16,7 @@ use crate::source_file; use crate::{is_nightly_channel, FormatReport, FormatReportFormatterBuilder, Input, Session}; use rustfmt_config_proc_macro::nightly_only_test; +use tracing::{debug, warn}; mod configuration_snippet; mod mod_resolver; diff --git a/src/tools/rustfmt/src/types.rs b/src/tools/rustfmt/src/types.rs index c826547e9d0..875c61113c5 100644 --- a/src/tools/rustfmt/src/types.rs +++ b/src/tools/rustfmt/src/types.rs @@ -3,6 +3,7 @@ use std::ops::Deref; use rustc_ast::ast::{self, FnRetTy, Mutability, Term}; use rustc_ast::ptr; use rustc_span::{symbol::kw, BytePos, Pos, Span}; +use tracing::debug; use crate::comment::{combine_strs_with_missing_comments, contains_comment}; use crate::config::lists::*; diff --git a/src/tools/rustfmt/src/visitor.rs b/src/tools/rustfmt/src/visitor.rs index 1de9f5a9524..ac68fc5fecf 100644 --- a/src/tools/rustfmt/src/visitor.rs +++ b/src/tools/rustfmt/src/visitor.rs @@ -4,6 +4,7 @@ use std::rc::Rc; use rustc_ast::{ast, token::Delimiter, visit}; use rustc_data_structures::sync::Lrc; use rustc_span::{symbol, BytePos, Pos, Span}; +use tracing::debug; use crate::attr::*; use crate::comment::{contains_comment, rewrite_comment, CodeCharKind, CommentCodeSlices};