Skip to content

Commit 9771245

Browse files
committed
inline stuff
1 parent bc0983d commit 9771245

File tree

1 file changed

+4
-0
lines changed
  • compiler/rustc_middle/src/ty/consts

1 file changed

+4
-0
lines changed

compiler/rustc_middle/src/ty/consts/kind.rs

+4
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,29 @@ pub struct Unevaluated<'tcx, P = Option<Promoted>> {
2828
}
2929

3030
impl<'tcx> Unevaluated<'tcx> {
31+
#[inline]
3132
pub fn shrink(self) -> Unevaluated<'tcx, ()> {
3233
debug_assert_eq!(self.promoted, None);
3334
Unevaluated { def: self.def, substs_: self.substs_, promoted: () }
3435
}
3536
}
3637

3738
impl<'tcx> Unevaluated<'tcx, ()> {
39+
#[inline]
3840
pub fn expand(self) -> Unevaluated<'tcx> {
3941
Unevaluated { def: self.def, substs_: self.substs_, promoted: None }
4042
}
4143
}
4244

4345
impl<'tcx, P: Default> Unevaluated<'tcx, P> {
46+
#[inline]
4447
pub fn new(def: ty::WithOptConstParam<DefId>, substs: SubstsRef<'tcx>) -> Unevaluated<'tcx, P> {
4548
Unevaluated { def, substs_: Some(substs), promoted: Default::default() }
4649
}
4750
}
4851

4952
impl<'tcx, P: Default + PartialEq + fmt::Debug> Unevaluated<'tcx, P> {
53+
#[inline]
5054
pub fn substs(self, tcx: TyCtxt<'tcx>) -> SubstsRef<'tcx> {
5155
self.substs_.unwrap_or_else(|| {
5256
// We must not use the parents default substs for promoted constants

0 commit comments

Comments
 (0)