This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
compiler/rustc_middle/src/ty/consts Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -28,25 +28,29 @@ pub struct Unevaluated<'tcx, P = Option<Promoted>> {
2828}
2929
3030impl < ' 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
3738impl < ' 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
4345impl < ' 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
4952impl < ' 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
You can’t perform that action at this time.
0 commit comments