Skip to content
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

Maybe #mm_override_path expression should be isolated in some way #10

Closed
gui1117 opened this issue Jun 13, 2023 · 3 comments · Fixed by #11
Closed

Maybe #mm_override_path expression should be isolated in some way #10

gui1117 opened this issue Jun 13, 2023 · 3 comments · Fixed by #11

Comments

@gui1117
Copy link
Contributor

gui1117 commented Jun 13, 2023

let resolved_mm_override_path = match syn::parse2::<syn::Path>(String::from(#mm_override_path).parse().unwrap()) {

the expression in #mm_override_path is executed inside the block and have some import like:

macro_magic/core/src/lib.rs

Lines 844 to 846 in 7a69251

use #mm_path::__private::*;
use #mm_path::__private::quote::ToTokens;
use #mm_path::mm_core::*;

best would be that the expression doesn't have those imports in scope so user expression evaluation is less confusing.

@sam0x17
Copy link
Owner

sam0x17 commented Jun 13, 2023

This is a fair point. Are those imports currently actually accessible to the user code? I think previously they weren't but now they are

@gui1117
Copy link
Contributor Author

gui1117 commented Jun 13, 2023

only to the expression passed in attribute AFAICT, the other user code is safe except if I made a mistake

@gui1117
Copy link
Contributor Author

gui1117 commented Jun 13, 2023

I can try to work on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants