Skip to content

Commit ab47cb4

Browse files
authored
Rollup merge of #123890 - klensy:cl, r=fee1-dead
removed (mostly) unused code First commit removes unused code, second one - some old debug output, probably unused?
2 parents 3fb529e + 7085ff2 commit ab47cb4

File tree

4 files changed

+0
-48
lines changed

4 files changed

+0
-48
lines changed

compiler/rustc_hir_analysis/src/check/check.rs

-1
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,6 @@ fn check_static_linkage(tcx: TyCtxt<'_>, def_id: LocalDefId) {
505505
}
506506

507507
pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) {
508-
let _indenter = indenter();
509508
match tcx.def_kind(def_id) {
510509
DefKind::Static { .. } => {
511510
tcx.ensure().typeck(def_id);

compiler/rustc_hir_analysis/src/check/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ use rustc_trait_selection::traits::ObligationCtxt;
103103

104104
use crate::errors;
105105
use crate::require_c_abi_if_c_variadic;
106-
use crate::util::common::indenter;
107106

108107
use self::compare_impl_item::collect_return_position_impl_trait_in_trait_tys;
109108
use self::region::region_scope_tree;

compiler/rustc_hir_analysis/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ use rustc_middle::middle;
103103
use rustc_middle::mir::interpret::GlobalId;
104104
use rustc_middle::query::Providers;
105105
use rustc_middle::ty::{self, Ty, TyCtxt};
106-
use rustc_middle::util;
107106
use rustc_session::parse::feature_err;
108107
use rustc_span::{symbol::sym, Span};
109108
use rustc_target::spec::abi::Abi;

compiler/rustc_middle/src/util/common.rs

-45
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
use rustc_data_structures::sync::Lock;
2-
3-
use std::fmt::Debug;
4-
use std::time::{Duration, Instant};
5-
61
#[cfg(test)]
72
mod tests;
83

@@ -26,46 +21,6 @@ pub fn to_readable_str(mut val: usize) -> String {
2621
groups.join("_")
2722
}
2823

29-
pub fn record_time<T, F>(accu: &Lock<Duration>, f: F) -> T
30-
where
31-
F: FnOnce() -> T,
32-
{
33-
let start = Instant::now();
34-
let rv = f();
35-
let duration = start.elapsed();
36-
let mut accu = accu.lock();
37-
*accu += duration;
38-
rv
39-
}
40-
41-
pub fn indent<R, F>(op: F) -> R
42-
where
43-
R: Debug,
44-
F: FnOnce() -> R,
45-
{
46-
// Use in conjunction with the log post-processor like `src/etc/indenter`
47-
// to make debug output more readable.
48-
debug!(">>");
49-
let r = op();
50-
debug!("<< (Result = {:?})", r);
51-
r
52-
}
53-
54-
pub struct Indenter {
55-
_cannot_construct_outside_of_this_module: (),
56-
}
57-
58-
impl Drop for Indenter {
59-
fn drop(&mut self) {
60-
debug!("<<");
61-
}
62-
}
63-
64-
pub fn indenter() -> Indenter {
65-
debug!(">>");
66-
Indenter { _cannot_construct_outside_of_this_module: () }
67-
}
68-
6924
// const wrapper for `if let Some((_, tail)) = name.rsplit_once(':') { tail } else { name }`
7025
pub const fn c_name(name: &'static str) -> &'static str {
7126
// FIXME Simplify the implementation once more `str` methods get const-stable.

0 commit comments

Comments
 (0)