Closed
Description
Given the following code:
use my_macros::my_enum_macro;
use super::a::AType;
my_enum_macro! {
"key.a_type" => super::a,
"key.b_type" => super::c::b,
// Other variants
}
pub fn my_fn(param: AType) {
// ...
}
Where my_enum_macro
, among other things, uses the path provided for the variant to qualify a type based on the key. It so happens that for the first variant here, the type in the expanded code resolves to super::a::AType
.
The current output is:
warning: unnecessary qualification
--> src/my_mod.rs:5:3
|
5| "key.a_type" => super::a,
| ^^^^^^^^^^^^^^^^^^^^^
|
= note: requested on the command line with `-W unused-qualifications`
Since the type is already imported at the top, the qualification is indeed unnecessary. But I would also expect to have the same behavior with my macro what other imports there are above.
That's why I believe that this warning shouldn't trigger on expanded code, or at least between regular and expanded code.