@@ -1926,13 +1926,15 @@ pub mod tls {
1926
1926
/// to `value` during the call to `f`. It is restored to its previous value after.
1927
1927
/// This is used to set the pointer to the new ImplicitCtxt.
1928
1928
#[ cfg( parallel_queries) ]
1929
+ #[ inline]
1929
1930
fn set_tlv < F : FnOnce ( ) -> R , R > ( value : usize , f : F ) -> R {
1930
1931
rayon_core:: tlv:: with ( value, f)
1931
1932
}
1932
1933
1933
1934
/// Gets Rayon's thread local variable which is preserved for Rayon jobs.
1934
1935
/// This is used to get the pointer to the current ImplicitCtxt.
1935
1936
#[ cfg( parallel_queries) ]
1937
+ #[ inline]
1936
1938
fn get_tlv ( ) -> usize {
1937
1939
rayon_core:: tlv:: get ( )
1938
1940
}
@@ -1945,6 +1947,7 @@ pub mod tls {
1945
1947
/// It is restored to its previous value after.
1946
1948
/// This is used to set the pointer to the new ImplicitCtxt.
1947
1949
#[ cfg( not( parallel_queries) ) ]
1950
+ #[ inline]
1948
1951
fn set_tlv < F : FnOnce ( ) -> R , R > ( value : usize , f : F ) -> R {
1949
1952
let old = get_tlv ( ) ;
1950
1953
let _reset = OnDrop ( move || TLV . with ( |tlv| tlv. set ( old) ) ) ;
@@ -2009,6 +2012,7 @@ pub mod tls {
2009
2012
}
2010
2013
2011
2014
/// Sets `context` as the new current ImplicitCtxt for the duration of the function `f`
2015
+ #[ inline]
2012
2016
pub fn enter_context < ' a , ' gcx : ' tcx , ' tcx , F , R > ( context : & ImplicitCtxt < ' a , ' gcx , ' tcx > ,
2013
2017
f : F ) -> R
2014
2018
where F : FnOnce ( & ImplicitCtxt < ' a , ' gcx , ' tcx > ) -> R
@@ -2080,6 +2084,7 @@ pub mod tls {
2080
2084
}
2081
2085
2082
2086
/// Allows access to the current ImplicitCtxt in a closure if one is available
2087
+ #[ inline]
2083
2088
pub fn with_context_opt < F , R > ( f : F ) -> R
2084
2089
where F : for <' a , ' gcx , ' tcx > FnOnce ( Option < & ImplicitCtxt < ' a , ' gcx , ' tcx > > ) -> R
2085
2090
{
@@ -2097,6 +2102,7 @@ pub mod tls {
2097
2102
2098
2103
/// Allows access to the current ImplicitCtxt.
2099
2104
/// Panics if there is no ImplicitCtxt available
2105
+ #[ inline]
2100
2106
pub fn with_context < F , R > ( f : F ) -> R
2101
2107
where F : for <' a , ' gcx , ' tcx > FnOnce ( & ImplicitCtxt < ' a , ' gcx , ' tcx > ) -> R
2102
2108
{
@@ -2108,6 +2114,7 @@ pub mod tls {
2108
2114
/// with the same 'gcx lifetime as the TyCtxt passed in.
2109
2115
/// This will panic if you pass it a TyCtxt which has a different global interner from
2110
2116
/// the current ImplicitCtxt's tcx field.
2117
+ #[ inline]
2111
2118
pub fn with_related_context < ' a , ' gcx , ' tcx1 , F , R > ( tcx : TyCtxt < ' a , ' gcx , ' tcx1 > , f : F ) -> R
2112
2119
where F : for <' b , ' tcx2 > FnOnce ( & ImplicitCtxt < ' b , ' gcx , ' tcx2 > ) -> R
2113
2120
{
@@ -2126,6 +2133,7 @@ pub mod tls {
2126
2133
/// is given an ImplicitCtxt with the same 'tcx and 'gcx lifetimes as the TyCtxt passed in.
2127
2134
/// This will panic if you pass it a TyCtxt which has a different global interner or
2128
2135
/// a different local interner from the current ImplicitCtxt's tcx field.
2136
+ #[ inline]
2129
2137
pub fn with_fully_related_context < ' a , ' gcx , ' tcx , F , R > ( tcx : TyCtxt < ' a , ' gcx , ' tcx > , f : F ) -> R
2130
2138
where F : for < ' b > FnOnce ( & ImplicitCtxt < ' b , ' gcx , ' tcx > ) -> R
2131
2139
{
@@ -2143,6 +2151,7 @@ pub mod tls {
2143
2151
2144
2152
/// Allows access to the TyCtxt in the current ImplicitCtxt.
2145
2153
/// Panics if there is no ImplicitCtxt available
2154
+ #[ inline]
2146
2155
pub fn with < F , R > ( f : F ) -> R
2147
2156
where F : for <' a , ' gcx , ' tcx > FnOnce ( TyCtxt < ' a , ' gcx , ' tcx > ) -> R
2148
2157
{
@@ -2151,6 +2160,7 @@ pub mod tls {
2151
2160
2152
2161
/// Allows access to the TyCtxt in the current ImplicitCtxt.
2153
2162
/// The closure is passed None if there is no ImplicitCtxt available
2163
+ #[ inline]
2154
2164
pub fn with_opt < F , R > ( f : F ) -> R
2155
2165
where F : for <' a , ' gcx , ' tcx > FnOnce ( Option < TyCtxt < ' a , ' gcx , ' tcx > > ) -> R
2156
2166
{
0 commit comments