Skip to content

Commit 83d48bc

Browse files
committed
Use $crate instead of std for panic builtin_fn_macro
This should be closer to the expected output and gets rid of a few type mismatches in rustc/library
1 parent 870825b commit 83d48bc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

crates/hir-expand/src/builtin_fn_macro.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,9 @@ fn format_args_expand(
238238
) -> ExpandResult<tt::Subtree> {
239239
// We expand `format_args!("", a1, a2)` to
240240
// ```
241-
// std::fmt::Arguments::new_v1(&[], &[
242-
// std::fmt::ArgumentV1::new(&arg1,std::fmt::Display::fmt),
243-
// std::fmt::ArgumentV1::new(&arg2,std::fmt::Display::fmt),
241+
// $crate::fmt::Arguments::new_v1(&[], &[
242+
// $crate::fmt::ArgumentV1::new(&arg1,$crate::fmt::Display::fmt),
243+
// $crate::fmt::ArgumentV1::new(&arg2,$crate::fmt::Display::fmt),
244244
// ])
245245
// ```,
246246
// which is still not really correct, but close enough for now
@@ -262,10 +262,10 @@ fn format_args_expand(
262262
}
263263
let _format_string = args.remove(0);
264264
let arg_tts = args.into_iter().flat_map(|arg| {
265-
quote! { std::fmt::ArgumentV1::new(&(#arg), std::fmt::Display::fmt), }
265+
quote! { #DOLLAR_CRATE::fmt::ArgumentV1::new(&(#arg), #DOLLAR_CRATE::fmt::Display::fmt), }
266266
}.token_trees);
267267
let expanded = quote! {
268-
std::fmt::Arguments::new_v1(&[], &[##arg_tts])
268+
#DOLLAR_CRATE::fmt::Arguments::new_v1(&[], &[##arg_tts])
269269
};
270270
ExpandResult::ok(expanded)
271271
}
@@ -675,8 +675,8 @@ fn option_env_expand(
675675
};
676676

677677
let expanded = match get_env_inner(db, arg_id, &key) {
678-
None => quote! { std::option::Option::None::<&str> },
679-
Some(s) => quote! { std::option::Some(#s) },
678+
None => quote! { #DOLLAR_CRATE::option::Option::None::<&str> },
679+
Some(s) => quote! { #DOLLAR_CRATE::option::Some(#s) },
680680
};
681681

682682
ExpandResult::ok(ExpandedEager::new(expanded))

0 commit comments

Comments
 (0)