Skip to content

Commit edb357f

Browse files
committed
Deinline all session global functions.
These are all called very rarely, so there is no need for them to be inline.
1 parent f405ce8 commit edb357f

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

compiler/rustc_span/src/lib.rs

-6
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ impl SessionGlobals {
119119
}
120120
}
121121

122-
#[inline]
123122
pub fn create_session_globals_then<R>(edition: Edition, f: impl FnOnce() -> R) -> R {
124123
assert!(
125124
!SESSION_GLOBALS.is_set(),
@@ -130,7 +129,6 @@ pub fn create_session_globals_then<R>(edition: Edition, f: impl FnOnce() -> R) -
130129
SESSION_GLOBALS.set(&session_globals, f)
131130
}
132131

133-
#[inline]
134132
pub fn set_session_globals_then<R>(session_globals: &SessionGlobals, f: impl FnOnce() -> R) -> R {
135133
assert!(
136134
!SESSION_GLOBALS.is_set(),
@@ -140,15 +138,13 @@ pub fn set_session_globals_then<R>(session_globals: &SessionGlobals, f: impl FnO
140138
SESSION_GLOBALS.set(session_globals, f)
141139
}
142140

143-
#[inline]
144141
pub fn create_default_session_if_not_set_then<R, F>(f: F) -> R
145142
where
146143
F: FnOnce(&SessionGlobals) -> R,
147144
{
148145
create_session_if_not_set_then(edition::DEFAULT_EDITION, f)
149146
}
150147

151-
#[inline]
152148
pub fn create_session_if_not_set_then<R, F>(edition: Edition, f: F) -> R
153149
where
154150
F: FnOnce(&SessionGlobals) -> R,
@@ -161,15 +157,13 @@ where
161157
}
162158
}
163159

164-
#[inline]
165160
pub fn with_session_globals<R, F>(f: F) -> R
166161
where
167162
F: FnOnce(&SessionGlobals) -> R,
168163
{
169164
SESSION_GLOBALS.with(f)
170165
}
171166

172-
#[inline]
173167
pub fn create_default_session_globals_then<R>(f: impl FnOnce() -> R) -> R {
174168
create_session_globals_then(edition::DEFAULT_EDITION, f)
175169
}

0 commit comments

Comments
 (0)