Skip to content

Commit

Permalink
Remove #[macro_use] extern crate tracing from rustfmt.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Aug 30, 2024
1 parent de02c4a commit ee5ec5a
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/tools/rustfmt/src/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
1 change: 1 addition & 0 deletions src/tools/rustfmt/src/chains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
1 change: 1 addition & 0 deletions src/tools/rustfmt/src/closures.rs
Original file line number Diff line number Diff line change
@@ -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::*;
Expand Down
1 change: 1 addition & 0 deletions src/tools/rustfmt/src/comment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/tools/rustfmt/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/tools/rustfmt/src/formatting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
1 change: 1 addition & 0 deletions src/tools/rustfmt/src/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down
4 changes: 2 additions & 2 deletions src/tools/rustfmt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/tools/rustfmt/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/tools/rustfmt/src/matches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down
1 change: 1 addition & 0 deletions src/tools/rustfmt/src/missed_spans.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/tools/rustfmt/src/modules/visitor.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/tools/rustfmt/src/overflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/tools/rustfmt/src/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/tools/rustfmt/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down
1 change: 1 addition & 0 deletions src/tools/rustfmt/src/visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down

0 comments on commit ee5ec5a

Please sign in to comment.