Skip to content

Commit f05a92d

Browse files
Remove some comments, inline interner fn
1 parent 34e0581 commit f05a92d

File tree

4 files changed

+4
-39
lines changed

4 files changed

+4
-39
lines changed

compiler/rustc_metadata/src/rmeta/decoder.rs

+1
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ impl<'a, 'tcx> TyDecoder for DecodeContext<'a, 'tcx> {
382382

383383
type I = TyInterner<'tcx>;
384384

385+
#[inline]
385386
fn interner(&self) -> Self::I {
386387
TyInterner { tcx: self.tcx() }
387388
}

compiler/rustc_middle/src/ty/context.rs

+1-37
Original file line numberDiff line numberDiff line change
@@ -94,43 +94,6 @@ pub struct TyInterner<'tcx> {
9494
pub tcx: TyCtxt<'tcx>,
9595
}
9696

97-
/*
98-
/// We don't ever actually need this. It's only required for derives.
99-
impl<'tcx> Hash for TyInterner<'tcx> {
100-
fn hash<H: Hasher>(&self, _state: &mut H) {}
101-
}
102-
103-
/// We don't ever actually need this. It's only required for derives.
104-
impl<'tcx> Ord for TyInterner<'tcx> {
105-
fn cmp(&self, _other: &Self) -> Ordering {
106-
Ordering::Equal
107-
}
108-
}
109-
110-
/// We don't ever actually need this. It's only required for derives.
111-
impl<'tcx> PartialOrd for TyInterner<'tcx> {
112-
fn partial_cmp(&self, _other: &Self) -> Option<Ordering> {
113-
None
114-
}
115-
}
116-
117-
/// We don't ever actually need this. It's only required for derives.
118-
impl<'tcx> PartialEq for TyInterner<'tcx> {
119-
fn eq(&self, _other: &Self) -> bool {
120-
false
121-
}
122-
}
123-
124-
/// We don't ever actually need this. It's only required for derives.
125-
impl<'tcx> Eq for TyInterner<'tcx> {}
126-
127-
impl fmt::Debug for TyInterner<'_> {
128-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
129-
write!(f, "TyInterner")
130-
}
131-
}
132-
*/
133-
13497
#[allow(rustc::usage_of_ty_tykind)]
13598
impl<'tcx> Interner for TyInterner<'tcx> {
13699
type AdtDef = ty::AdtDef<'tcx>;
@@ -1140,6 +1103,7 @@ pub struct GlobalCtxt<'tcx> {
11401103
}
11411104

11421105
impl<'tcx> TyCtxt<'tcx> {
1106+
#[inline]
11431107
pub fn interner(self) -> TyInterner<'tcx> {
11441108
TyInterner { tcx: self }
11451109
}

compiler/rustc_middle/src/ty/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ static_assert_size!(WithStableHash<TyS<'_>>, 56);
463463
#[rustc_pass_by_value]
464464
pub struct Ty<'tcx>(Interned<'tcx, WithStableHash<TyS<'tcx>>>);
465465

466-
const LEAKED_BOOL_TY_ALREADY: std::sync::atomic::AtomicBool =
466+
static LEAKED_BOOL_TY_ALREADY: std::sync::atomic::AtomicBool =
467467
std::sync::atomic::AtomicBool::new(false);
468468

469469
/// "Static" bool only used for internal testing.

compiler/rustc_typeck/src/check/intrinsicck.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use rustc_errors::struct_span_err;
44
use rustc_hir as hir;
55
use rustc_index::vec::Idx;
66
use rustc_middle::ty::layout::{LayoutError, SizeSkeleton};
7-
use rustc_middle::ty::{self, FloatTy, InferTy, IntTy, Ty, TyCtxt, TypeFoldable, UintTy, Article};
7+
use rustc_middle::ty::{self, Article, FloatTy, InferTy, IntTy, Ty, TyCtxt, TypeFoldable, UintTy};
88
use rustc_session::lint;
99
use rustc_span::{Span, Symbol, DUMMY_SP};
1010
use rustc_target::abi::{Pointer, VariantIdx};

0 commit comments

Comments
 (0)