Skip to content

Commit

Permalink
Unrolled build for rust-lang#123890
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#123890 - klensy:cl, r=fee1-dead

removed (mostly) unused code

First commit removes unused code, second one - some old debug output, probably unused?
  • Loading branch information
rust-timer authored Apr 13, 2024
2 parents 3a0db6c + 7085ff2 commit 7dbb28e
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 48 deletions.
1 change: 0 additions & 1 deletion compiler/rustc_hir_analysis/src/check/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,6 @@ fn check_static_linkage(tcx: TyCtxt<'_>, def_id: LocalDefId) {
}

pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) {
let _indenter = indenter();
match tcx.def_kind(def_id) {
DefKind::Static { .. } => {
tcx.ensure().typeck(def_id);
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_hir_analysis/src/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ use rustc_trait_selection::traits::ObligationCtxt;

use crate::errors;
use crate::require_c_abi_if_c_variadic;
use crate::util::common::indenter;

use self::compare_impl_item::collect_return_position_impl_trait_in_trait_tys;
use self::region::region_scope_tree;
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_hir_analysis/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ use rustc_middle::middle;
use rustc_middle::mir::interpret::GlobalId;
use rustc_middle::query::Providers;
use rustc_middle::ty::{self, Ty, TyCtxt};
use rustc_middle::util;
use rustc_session::parse::feature_err;
use rustc_span::{symbol::sym, Span};
use rustc_target::spec::abi::Abi;
Expand Down
45 changes: 0 additions & 45 deletions compiler/rustc_middle/src/util/common.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
use rustc_data_structures::sync::Lock;

use std::fmt::Debug;
use std::time::{Duration, Instant};

#[cfg(test)]
mod tests;

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

pub fn record_time<T, F>(accu: &Lock<Duration>, f: F) -> T
where
F: FnOnce() -> T,
{
let start = Instant::now();
let rv = f();
let duration = start.elapsed();
let mut accu = accu.lock();
*accu += duration;
rv
}

pub fn indent<R, F>(op: F) -> R
where
R: Debug,
F: FnOnce() -> R,
{
// Use in conjunction with the log post-processor like `src/etc/indenter`
// to make debug output more readable.
debug!(">>");
let r = op();
debug!("<< (Result = {:?})", r);
r
}

pub struct Indenter {
_cannot_construct_outside_of_this_module: (),
}

impl Drop for Indenter {
fn drop(&mut self) {
debug!("<<");
}
}

pub fn indenter() -> Indenter {
debug!(">>");
Indenter { _cannot_construct_outside_of_this_module: () }
}

// const wrapper for `if let Some((_, tail)) = name.rsplit_once(':') { tail } else { name }`
pub const fn c_name(name: &'static str) -> &'static str {
// FIXME Simplify the implementation once more `str` methods get const-stable.
Expand Down

0 comments on commit 7dbb28e

Please sign in to comment.