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

Infer better names #16

Open
JustAPerson opened this issue Mar 5, 2017 · 3 comments
Open

Infer better names #16

JustAPerson opened this issue Mar 5, 2017 · 3 comments

Comments

@JustAPerson
Copy link

I was first curious if it was possible to easily modify things to use the full paths of items (module::fn_name instead of fn_name), but asking on #rust-internals, that may be impossible. So I guess perhaps an alternate scheme would be to allow an argument to the attribute, specifying a name.

#[flame("module::fn_name")]
fn fn_name() {}

I think that would be a really useful feature (especially if it wasn't applied recursively), perhaps deserving a different attribute.

@regexident
Copy link
Collaborator

I've been pondering with the same issue a week ago. While an automated approach would obviously be the preferred way, I'd consider an optional label a worthy workaround.

I am however not sure if it really is impossible.
At a quick glance I'd argue that my apply_attr does something similar. Rules are applied recursively, carrying along all kinds of meta-information. Why shouldn't we be able to carry along the current parent path?

@WaDelma
Copy link

WaDelma commented Feb 25, 2018

I was trying to use flamer with project that uses specs and annotated all systems run methods with flame, but because all of the methods have the same name the resulting data is basically useless.

So I cannot use flamer without this something like this.

@llogiq
Copy link
Owner

llogiq commented Feb 25, 2018

I think we should be able to do this, at the expense of requiring a global #![flamer] annotation. Then we'd just keep a stack of modules, etc. and prepend that (joined by"::") to each name.

antonok-edm added a commit to antonok-edm/flamer that referenced this issue Jul 8, 2018
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

No branches or pull requests

4 participants