Skip to content

Commit 87cc8ca

Browse files
authored
Merge pull request #7 from dtolnay/core
Support no_std
2 parents 2bd4733 + 947f77b commit 87cc8ca

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/expand.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ fn transform_sig(context: Context, sig: &mut MethodSig, has_default: bool) {
161161
where_clause.predicates.push(if assume_bound {
162162
parse_quote!(Self: #lifetime)
163163
} else {
164-
parse_quote!(Self: std::marker::#bound + #lifetime)
164+
parse_quote!(Self: core::marker::#bound + #lifetime)
165165
});
166166
}
167167
} else {
@@ -188,8 +188,8 @@ fn transform_sig(context: Context, sig: &mut MethodSig, has_default: bool) {
188188
}
189189

190190
sig.decl.output = parse_quote! {
191-
-> std::pin::Pin<std::boxed::Box<
192-
dyn std::future::Future<Output = #ret> + std::marker::Send + #lifetime
191+
-> core::pin::Pin<Box<
192+
dyn core::future::Future<Output = #ret> + core::marker::Send + #lifetime
193193
>>
194194
};
195195
}
@@ -272,7 +272,7 @@ fn transform_block(context: Context, sig: &MethodSig, block: &mut Block) {
272272
};
273273
let (_, generics, _) = generics.split_for_impl();
274274
standalone.decl.generics.params.push(parse_quote! {
275-
AsyncTrait: ?Sized + #name #generics + std::marker::#bound
275+
AsyncTrait: ?Sized + #name #generics + core::marker::#bound
276276
});
277277
types.push(Ident::new("Self", Span::call_site()));
278278
}
@@ -290,7 +290,7 @@ fn transform_block(context: Context, sig: &MethodSig, block: &mut Block) {
290290
};
291291
let (_, generics, _) = generics.split_for_impl();
292292
standalone.decl.generics.params.push(parse_quote! {
293-
AsyncTrait: ?Sized + #name #generics + std::marker::Send
293+
AsyncTrait: ?Sized + #name #generics + core::marker::Send
294294
});
295295
types.push(Ident::new("Self", Span::call_site()));
296296
}
@@ -322,7 +322,7 @@ fn transform_block(context: Context, sig: &MethodSig, block: &mut Block) {
322322
let brace = block.brace_token;
323323
*block = parse_quote!({
324324
#standalone #block
325-
std::pin::Pin::from(std::boxed::Box::new(#inner::<#(#types),*>(#(#args),*)))
325+
core::pin::Pin::from(Box::new(#inner::<#(#types),*>(#(#args),*)))
326326
});
327327
block.brace_token = brace;
328328
}

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
//! impl Advertisement for AutoplayingVideo {
122122
//! fn run<'async>(
123123
//! &'async self,
124-
//! ) -> Pin<Box<dyn std::future::Future<Output = ()> + Send + 'async>>
124+
//! ) -> Pin<Box<dyn core::future::Future<Output = ()> + Send + 'async>>
125125
//! where
126126
//! Self: Sync + 'async,
127127
//! {

0 commit comments

Comments
 (0)