Skip to content

Commit 72545e9

Browse files
committed
Revert to use item_fn.span()
Signed-off-by: Jiahao XU <[email protected]>
1 parent 9be2622 commit 72545e9

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

gix-macros/src/momo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub(crate) fn inner(code: proc_macro2::TokenStream) -> proc_macro2::TokenStream
1414
let (has_conversion_in_effect, argtypes, argexprs, has_self) = convert(&item_fn.sig.inputs, &ty_conversions);
1515
if !has_conversion_in_effect {
1616
return Error::new(
17-
proc_macro2::Span::call_site(),
17+
item_fn.span(),
1818
"Couldn't apply a single conversion - momo is ineffective here",
1919
)
2020
.to_compile_error();

gix-macros/tests/momo/ux/error_if_ineffective.stderr

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
error: Couldn't apply a single conversion - momo is ineffective here
2-
--> tests/momo/ux/error_if_ineffective.rs:2:1
2+
--> tests/momo/ux/error_if_ineffective.rs:1:1
33
|
4-
2 | #[gix_macros::momo]
5-
| ^^^^^^^^^^^^^^^^^^^
6-
|
7-
= note: this error originates in the attribute macro `gix_macros::momo` (in Nightly builds, run with -Z macro-backtrace for more info)
4+
1 | /// If nothing is done, momo should fail.
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
86

97
error[E0601]: `main` function not found in crate `$CRATE`
108
--> tests/momo/ux/error_if_ineffective.rs:3:13

0 commit comments

Comments
 (0)