Skip to content

Commit f99bc2d

Browse files
committed
fn class #[inline]
1 parent 5a81533 commit f99bc2d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+61
-0
lines changed

derive-impl/src/pypayload.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pub(crate) fn impl_pypayload(input: DeriveInput) -> Result<TokenStream> {
77

88
let ret = quote! {
99
impl ::rustpython_vm::PyPayload for #ty {
10+
#[inline]
1011
fn class(_ctx: &::rustpython_vm::vm::Context) -> &'static rustpython_vm::Py<::rustpython_vm::builtins::PyType> {
1112
<Self as ::rustpython_vm::class::StaticType>::static_type()
1213
}

vm/src/builtins/asyncgenerator.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ pub struct PyAsyncGen {
2121
type PyAsyncGenRef = PyRef<PyAsyncGen>;
2222

2323
impl PyPayload for PyAsyncGen {
24+
#[inline]
2425
fn class(ctx: &Context) -> &'static Py<PyType> {
2526
ctx.types.async_generator
2627
}
@@ -141,6 +142,7 @@ impl Unconstructible for PyAsyncGen {}
141142
#[derive(Debug)]
142143
pub(crate) struct PyAsyncGenWrappedValue(pub PyObjectRef);
143144
impl PyPayload for PyAsyncGenWrappedValue {
145+
#[inline]
144146
fn class(ctx: &Context) -> &'static Py<PyType> {
145147
ctx.types.async_generator_wrapped_value
146148
}
@@ -190,6 +192,7 @@ pub(crate) struct PyAsyncGenASend {
190192
}
191193

192194
impl PyPayload for PyAsyncGenASend {
195+
#[inline]
193196
fn class(ctx: &Context) -> &'static Py<PyType> {
194197
ctx.types.async_generator_asend
195198
}
@@ -283,6 +286,7 @@ pub(crate) struct PyAsyncGenAThrow {
283286
}
284287

285288
impl PyPayload for PyAsyncGenAThrow {
289+
#[inline]
286290
fn class(ctx: &Context) -> &'static Py<PyType> {
287291
ctx.types.async_generator_athrow
288292
}

vm/src/builtins/bool.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ impl PyObjectRef {
8181
pub struct PyBool;
8282

8383
impl PyPayload for PyBool {
84+
#[inline]
8485
fn class(ctx: &Context) -> &'static Py<PyType> {
8586
ctx.types.bool_type
8687
}

vm/src/builtins/bytearray.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,7 @@ pub struct PyByteArrayIterator {
884884
}
885885

886886
impl PyPayload for PyByteArrayIterator {
887+
#[inline]
887888
fn class(ctx: &Context) -> &'static Py<PyType> {
888889
ctx.types.bytearray_iterator_type
889890
}

vm/src/builtins/bytes.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ impl AsRef<[u8]> for PyBytesRef {
7878
}
7979

8080
impl PyPayload for PyBytes {
81+
#[inline]
8182
fn class(ctx: &Context) -> &'static Py<PyType> {
8283
ctx.types.bytes_type
8384
}
@@ -683,6 +684,7 @@ pub struct PyBytesIterator {
683684
}
684685

685686
impl PyPayload for PyBytesIterator {
687+
#[inline]
686688
fn class(ctx: &Context) -> &'static Py<PyType> {
687689
ctx.types.bytes_iterator_type
688690
}

vm/src/builtins/classmethod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ impl From<PyObjectRef> for PyClassMethod {
4141
}
4242

4343
impl PyPayload for PyClassMethod {
44+
#[inline]
4445
fn class(ctx: &Context) -> &'static Py<PyType> {
4546
ctx.types.classmethod_type
4647
}

vm/src/builtins/code.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ impl fmt::Debug for PyCode {
214214
}
215215

216216
impl PyPayload for PyCode {
217+
#[inline]
217218
fn class(ctx: &Context) -> &'static Py<PyType> {
218219
ctx.types.code_type
219220
}

vm/src/builtins/complex.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ impl PyComplex {
3434
}
3535

3636
impl PyPayload for PyComplex {
37+
#[inline]
3738
fn class(ctx: &Context) -> &'static Py<PyType> {
3839
ctx.types.complex_type
3940
}

vm/src/builtins/coroutine.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ pub struct PyCoroutine {
1717
}
1818

1919
impl PyPayload for PyCoroutine {
20+
#[inline]
2021
fn class(ctx: &Context) -> &'static Py<PyType> {
2122
ctx.types.coroutine_type
2223
}
@@ -127,6 +128,7 @@ pub struct PyCoroutineWrapper {
127128
}
128129

129130
impl PyPayload for PyCoroutineWrapper {
131+
#[inline]
130132
fn class(ctx: &Context) -> &'static Py<PyType> {
131133
ctx.types.coroutine_wrapper_type
132134
}

vm/src/builtins/dict.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,7 @@ macro_rules! dict_view {
823823
}
824824

825825
impl PyPayload for $iter_name {
826+
#[inline]
826827
fn class(ctx: &Context) -> &'static Py<PyType> {
827828
ctx.types.$iter_class
828829
}
@@ -896,6 +897,7 @@ macro_rules! dict_view {
896897
}
897898

898899
impl PyPayload for $reverse_iter_name {
900+
#[inline]
899901
fn class(ctx: &Context) -> &'static Py<PyType> {
900902
ctx.types.$reverse_iter_class
901903
}

0 commit comments

Comments
 (0)