tracing icon indicating copy to clipboard operation
tracing copied to clipboard

Attach follows_from() before constructing future

Open matthiasbeyer opened this issue 1 year ago • 7 comments

Motivation

See #2650

Solution

Moving loop that makes the attribute span follows_from() other attribute spans before the creation of the future to remove the implicit Copy requirement for attributes.


CC @hawkw does this look right to you? How and where can I add a testcase for this ( I am a first time contributor to this project)?

CC @TheNeikos (submitted the issue mentioned above with me)

matthiasbeyer avatar Aug 17 '23 07:08 matthiasbeyer

Thanks for working on this!

CC @hawkw does this look right to you? How and where can I add a testcase for this ( I am a first time contributor to this project)?

There are tests for the #[instrument] macro's follows_from support in this file. I would add a test where a non-Copy parameter is used in follows_from --- we probably start by copying the example provided in #2650 into a test in that file, I think. Since this is a compile error rather than a runtime error, we would expect the test to not compile on the master branch, and we would expect it to compile successfully on this branch.

Let me know if you have any more questions!

hawkw avatar Aug 17 '23 16:08 hawkw

Does this look like it is going in the right direction to you?

matthiasbeyer avatar Aug 19 '23 17:08 matthiasbeyer

I think we can make the Id in NonCopyContext an Option<Id>, because the actual id is irrelevant for the testcase.

matthiasbeyer avatar Aug 22 '23 06:08 matthiasbeyer

It seems that the only thing left here is formatting. I hope I can get this squashed tomorrow. If not, I am off for one week (see you all at Rustconf), so this has to wait for after I return home. 😂

matthiasbeyer avatar Sep 08 '23 20:09 matthiasbeyer

@matthiasbeyer if you don't mind selecting "Allow changes from maintainers", I'm happy to pull the branch and run rustfmt on my machine, and then I can merge it? Otherwise, pushing a commit to fix rustfmt tomorrow is good with me!

hawkw avatar Sep 08 '23 21:09 hawkw

Squashed the changes and ensured the changes in the commits are formatted. ~~I'll also enable edits!~~ Was already enabled. :smile: :+1:

matthiasbeyer avatar Sep 09 '23 08:09 matthiasbeyer

Hi! Can this be merged soon?

zohnannor avatar Dec 19 '23 12:12 zohnannor