mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
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
This commit is contained in:
parent
870825b376
commit
1574fe0d54
2 changed files with 19 additions and 19 deletions
|
@ -238,9 +238,9 @@ fn format_args_expand(
|
|||
) -> ExpandResult<tt::Subtree> {
|
||||
// We expand `format_args!("", a1, a2)` to
|
||||
// ```
|
||||
// std::fmt::Arguments::new_v1(&[], &[
|
||||
// std::fmt::ArgumentV1::new(&arg1,std::fmt::Display::fmt),
|
||||
// std::fmt::ArgumentV1::new(&arg2,std::fmt::Display::fmt),
|
||||
// $crate::fmt::Arguments::new_v1(&[], &[
|
||||
// $crate::fmt::ArgumentV1::new(&arg1,$crate::fmt::Display::fmt),
|
||||
// $crate::fmt::ArgumentV1::new(&arg2,$crate::fmt::Display::fmt),
|
||||
// ])
|
||||
// ```,
|
||||
// which is still not really correct, but close enough for now
|
||||
|
@ -262,10 +262,10 @@ fn format_args_expand(
|
|||
}
|
||||
let _format_string = args.remove(0);
|
||||
let arg_tts = args.into_iter().flat_map(|arg| {
|
||||
quote! { std::fmt::ArgumentV1::new(&(#arg), std::fmt::Display::fmt), }
|
||||
quote! { #DOLLAR_CRATE::fmt::ArgumentV1::new(&(#arg), #DOLLAR_CRATE::fmt::Display::fmt), }
|
||||
}.token_trees);
|
||||
let expanded = quote! {
|
||||
std::fmt::Arguments::new_v1(&[], &[##arg_tts])
|
||||
#DOLLAR_CRATE::fmt::Arguments::new_v1(&[], &[##arg_tts])
|
||||
};
|
||||
ExpandResult::ok(expanded)
|
||||
}
|
||||
|
@ -675,8 +675,8 @@ fn option_env_expand(
|
|||
};
|
||||
|
||||
let expanded = match get_env_inner(db, arg_id, &key) {
|
||||
None => quote! { std::option::Option::None::<&str> },
|
||||
Some(s) => quote! { std::option::Some(#s) },
|
||||
None => quote! { #DOLLAR_CRATE::option::Option::None::<&str> },
|
||||
Some(s) => quote! { #DOLLAR_CRATE::option::Some(#s) },
|
||||
};
|
||||
|
||||
ExpandResult::ok(ExpandedEager::new(expanded))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue