-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ambiguous template name that isnt visible after import even if it was imported #155
Comments
Hi,
|
@la10736 if you change rstest/rstest_reuse/src/lib.rs Lines 374 to 381 in 9beb943
macro_rules! some_unique_name { ... }
use some_unique_name as #macro_name; then stuff will follow the usual scoping rules of other items, as explained here 🙂 |
I got the point... I'll fix it!
THX!
Il giorno mar 28 giu 2022 alle ore 20:53 Daniel Henry-Mantilla <
***@***.***> ha scritto:
… @la10736 <https://github.com/la10736> if you change
https://github.com/la10736/rstest/blob/9beb9431a0222e1b3e3a81ec0fd6e543092c06ea/rstest_reuse/src/lib.rs#L374-L381
to become:
macro_rules! some_unique_name { ... }
use some_unique_name as #macro_name;
then stuff will follow the usual scoping rules of other items, as explained
here
<https://stackoverflow.com/questions/26731243/how-do-i-use-a-macro-across-module-files/67140319#67140319>
🙂
—
Reply to this email directly, view it on GitHub
<#155 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA5Y34JFD2Z6ZPCYER3RPRLVRNCZDANCNFSM52CWBRHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
it works. now i can create a template and import it inside submodules like this // ...
#[template]
#[rstest]
#[case("hello")]
#[case("there")]
#[case("rust")]
#[case("is")]
#[case("the")]
#[case("best")]
fn random_words_template(#[case] input_content: &str) {}
mod fixed_color_fn {
use super::random_words_template;
//...
}
// ...
} thanks a lot man! |
this is a test file in my project
when i run the test i do get this error
the solution to this problem is to remove the modules and put everything in one module
like this
now everything is fine
my problem is this error
ambiguous because of a conflict between a
macro_rulesname and a non-
macro_rulesname from another module note:
wordscould refer to the macro defined here
and the other errors related to thetemplate
and theambiguous
partwhy is this happening ?
why cant i put the template in root module and then import the template
words
in the rest of the modules ?what im trying to achieve is to make a usable template,
words
template, that i could import from inner modules along the program as test data for multiple tests.any ideas? thanks in advance.
The text was updated successfully, but these errors were encountered: