Rollup merge of #129774 - nnethercote:rm-extern-crate-tracing-remainder, r=GuillaumeGomez

Remove `#[macro_use] extern crate tracing` from rustdoc and rustfmt

A follow-up to #129767 and earlier PRs doing this for `rustc_*` crates.

r? ```@GuillaumeGomez```
This commit is contained in:
Matthias Krüger 2024-08-31 14:46:12 +02:00 committed by GitHub
commit 893d073a2e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
48 changed files with 49 additions and 10 deletions

View File

@ -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,

View File

@ -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::{

View File

@ -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;

View File

@ -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};

View File

@ -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::*;

View File

@ -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;

View File

@ -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};

View File

@ -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;

View File

@ -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;

View File

@ -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};

View File

@ -1,4 +1,5 @@
use rustc_middle::ty::TyCtxt;
use tracing::debug;
use crate::clean;
use crate::config::RenderOptions;

View File

@ -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};

View File

@ -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;

View File

@ -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};

View File

@ -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};

View File

@ -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::{

View File

@ -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};

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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};

View File

@ -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::*;

View File

@ -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;

View File

@ -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;

View File

@ -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};

View File

@ -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;

View File

@ -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};

View File

@ -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};

View File

@ -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};

View File

@ -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::*;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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};

View File

@ -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};

View File

@ -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::{

View File

@ -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;

View File

@ -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,

View File

@ -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::*;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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::*;

View File

@ -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};