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>> {
28
28
}
29
29
30
30
impl<'tcx> Unevaluated<'tcx> {
31
+ #[inline]
31
32
pub fn shrink(self) -> Unevaluated<'tcx, ()> {
32
33
debug_assert_eq!(self.promoted, None);
33
34
Unevaluated { def: self.def, substs_: self.substs_, promoted: () }
34
35
}
35
36
}
36
37
37
38
impl<'tcx> Unevaluated<'tcx, ()> {
39
+ #[inline]
38
40
pub fn expand(self) -> Unevaluated<'tcx> {
39
41
Unevaluated { def: self.def, substs_: self.substs_, promoted: None }
40
42
}
41
43
}
42
44
43
45
impl<'tcx, P: Default> Unevaluated<'tcx, P> {
46
+ #[inline]
44
47
pub fn new(def: ty::WithOptConstParam<DefId>, substs: SubstsRef<'tcx>) -> Unevaluated<'tcx, P> {
45
48
Unevaluated { def, substs_: Some(substs), promoted: Default::default() }
46
49
}
47
50
}
48
51
49
52
impl<'tcx, P: Default + PartialEq + fmt::Debug> Unevaluated<'tcx, P> {
53
+ #[inline]
50
54
pub fn substs(self, tcx: TyCtxt<'tcx>) -> SubstsRef<'tcx> {
51
55
self.substs_.unwrap_or_else(|| {
52
56
// We must not use the parents default substs for promoted constants
You can’t perform that action at this time.
0 commit comments